/* ==========================================================================
   Di Arche Construction — Responsive Breakpoints
   Breakpoints: 1200px | 1024px | 768px | 480px | 360px
   ========================================================================== */


/* ==========================================================================
   LARGE DESKTOPS — max-width: 1200px
   ========================================================================== */

@media (max-width: 1200px) {

  :root {
    --container-pad: 32px;
  }

  .hero__content {
    padding-left: 60px;
    max-width: 55%;
  }

  .footer__grid {
    gap: 36px;
  }

  .services-grid {
    gap: 24px;
  }

}


/* ==========================================================================
   TABLETS / SMALL LAPTOPS — max-width: 1024px
   ========================================================================== */

@media (max-width: 1024px) {

  :root {
    --section-pad: 72px;
    --nav-height: 70px;
  }

  /* ----- Typography ----- */
  .hero__title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
  }

  .section-heading {
    font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  }

  /* ----- Navigation ----- */
  .navbar {
    padding: 0 24px;
  }

  .navbar__links {
    gap: 24px;
  }

  .navbar__link {
    font-size: 0.75rem;
  }

  .navbar__phone {
    display: none;
  }

  /* ----- Hero ----- */
  .hero__content {
    max-width: 60%;
    padding-left: 40px;
  }

  /* ----- Stats ----- */
  .stats-bar__number {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
  }

  /* ----- Services ----- */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .service-card {
    padding: 36px 28px 32px;
  }

  .service-card__number {
    font-size: 5.5rem;
  }

  /* ----- Why Section ----- */
  .why-section__grid {
    gap: 40px;
  }

  /* ----- Gallery ----- */
  .gallery-grid {
    columns: 2;
    column-gap: 20px;
  }

  /* ----- Footer ----- */
  .footer__grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 28px;
  }

  /* ----- Form ----- */
  .form-progress__line {
    width: 40px;
  }

  /* ----- Reviews ----- */
  .review-card {
    flex: 0 0 320px;
  }

}


/* ==========================================================================
   TABLETS PORTRAIT — max-width: 768px
   ========================================================================== */

@media (max-width: 768px) {

  :root {
    --section-pad: 56px;
    --container-pad: 20px;
  }

  /* ----- Navigation — Hamburger ----- */
  .navbar__links,
  .navbar__right .navbar__phone,
  .navbar__right .navbar__cta,
  .navbar__right .lang-toggle {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
  }

  .navbar {
    padding: 0 20px;
    height: 64px;
  }

  .navbar.scrolled {
    height: 60px;
  }

  /* ----- Hero ----- */
  .hero {
    min-height: 500px;
  }

  .hero__content {
    max-width: 85%;
    padding-left: 0;
    padding: 0 var(--container-pad);
  }

  .hero__title {
    font-size: clamp(1.85rem, 5vw, 3rem);
  }

  .hero__subtitle {
    font-size: 1rem;
    max-width: 400px;
  }

  .hero__label {
    font-size: 0.7rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__scroll {
    display: none;
  }

  .hero__blueprint {
    width: 200px;
    height: 200px;
  }

  /* ----- Sub-page Hero ----- */
  .hero-sub {
    height: 40vh;
    min-height: 280px;
  }

  .hero-sub__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
  }

  /* ----- Stats Bar — 2x2 Grid ----- */
  .stats-bar {
    padding: 32px 0;
  }

  .stats-bar__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }

  .stats-bar__item {
    padding: 20px 16px;
  }

  /* Remove vertical dividers, add subtle border */
  .stats-bar__item + .stats-bar__item::before {
    display: none;
  }

  .stats-bar__item:nth-child(1),
  .stats-bar__item:nth-child(2) {
    border-bottom: 1px solid rgba(154, 154, 154, 0.15);
  }

  .stats-bar__item:nth-child(odd) {
    border-right: 1px solid rgba(154, 154, 154, 0.15);
  }

  /* ----- Service Cards — Stack ----- */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .service-card {
    padding: 32px 24px 28px;
  }

  .service-card__number {
    font-size: 5rem;
  }

  /* ----- Why Section — Stack ----- */
  .why-section__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .why-section__image {
    order: -1;
    max-height: 360px;
  }

  .why-section__image::after {
    display: none;
  }

  /* ----- Gallery — 2 cols ----- */
  .gallery-grid {
    columns: 2;
    column-gap: 16px;
  }

  .gallery-item {
    margin-bottom: 16px;
  }

  /* Always show gallery overlay on touch devices */
  .gallery-item__overlay {
    opacity: 1;
    background: linear-gradient(
      180deg,
      transparent 50%,
      rgba(26, 26, 26, 0.7) 100%
    );
  }

  /* ----- Reviews ----- */
  .review-card {
    flex: 0 0 280px;
    padding: 24px;
  }

  .reviews-section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .reviews-nav {
    align-self: flex-end;
  }

  /* ----- Before/After ----- */
  .before-after {
    border-radius: var(--radius-sm);
  }

  .before-after__handle {
    width: 40px;
    height: 40px;
  }

  /* ----- CTA Banner ----- */
  .cta-banner {
    padding: 56px 0;
  }

  .cta-banner__heading {
    font-size: clamp(1.5rem, 3vw, 2rem);
  }

  .cta-banner__actions {
    flex-direction: column;
    gap: 12px;
  }

  .cta-banner__actions .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* ----- Footer — 2 cols ----- */
  .footer {
    padding-top: 48px;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 28px;
  }

  .footer__brand-desc {
    max-width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .footer__legal {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* ----- Form ----- */
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: 16px;
    font-size: 1rem;
  }

  .form-progress__line {
    width: 28px;
  }

  .form-progress__label {
    font-size: 0.6rem;
  }

  .upload-zone {
    padding: 28px 20px;
  }

  /* ----- Back to Top ----- */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  /* ----- Cookie Banner ----- */
  .cookie-banner__inner {
    flex-direction: column;
    text-align: center;
  }

  .cookie-banner__actions {
    width: 100%;
    justify-content: center;
  }

  /* ----- Section Headings ----- */
  .section-heading {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
  }

  .section-heading--underline::after {
    width: 48px;
  }

  /* ----- Buttons ----- */
  .btn {
    padding: 12px 28px;
    font-size: 0.85rem;
  }

  .btn--lg {
    padding: 14px 32px;
  }

}


/* ==========================================================================
   MOBILE PHONES — max-width: 480px
   ========================================================================== */

@media (max-width: 480px) {

  :root {
    --section-pad: 44px;
    --container-pad: 16px;
  }

  body {
    font-size: 15px;
  }

  /* ----- Typography ----- */
  .hero__title {
    font-size: clamp(1.6rem, 7vw, 2.25rem);
  }

  .section-heading {
    font-size: clamp(1.3rem, 5vw, 1.75rem);
  }

  .hero-sub__title {
    font-size: clamp(1.3rem, 5vw, 1.75rem);
  }

  /* ----- Hero ----- */
  .hero {
    min-height: 480px;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  .hero__label {
    font-size: 0.65rem;
    margin-bottom: 16px;
  }

  .hero__label::before {
    width: 30px;
  }

  /* Full-width hero buttons */
  .hero__actions .btn {
    width: 100%;
    text-align: center;
  }

  /* ----- Stats ----- */
  .stats-bar__number {
    font-size: 1.5rem;
  }

  .stats-bar__label {
    font-size: 0.75rem;
  }

  /* ----- Service Cards ----- */
  .service-card {
    padding: 28px 20px 24px;
  }

  .service-card__number {
    font-size: 4rem;
  }

  .service-card__title {
    font-size: 1.2rem;
  }

  /* ----- Gallery — 1 col ----- */
  .gallery-grid {
    columns: 1;
  }

  .gallery-item {
    margin-bottom: 16px;
  }

  .gallery-filters {
    gap: 4px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  .gallery-filters::-webkit-scrollbar {
    display: none;
  }

  .gallery-filter-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  /* ----- Reviews ----- */
  .review-card {
    flex: 0 0 260px;
    padding: 20px;
  }

  .review-card__text {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }

  .reviews-overall__score {
    font-size: 2rem;
  }

  /* ----- Footer — 1 col ----- */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer__heading {
    margin-bottom: 16px;
  }

  /* ----- Form ----- */
  .quote-form {
    padding: 0 4px;
  }

  .form-progress {
    margin-bottom: 36px;
  }

  .form-progress__circle {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .form-progress__line {
    width: 20px;
  }

  .form-progress__label {
    display: none;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: 14px;
  }

  .upload-zone {
    padding: 24px 16px;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* ----- CTA Banner ----- */
  .cta-banner {
    padding: 44px 0;
  }

  .cta-banner__heading {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
  }

  .cta-banner__text {
    font-size: 0.9rem;
  }

  .cta-banner__actions .btn {
    max-width: 100%;
  }

  /* ----- Before/After ----- */
  .before-after__label {
    font-size: 0.65rem;
    padding: 4px 12px;
    top: 12px;
  }

  .before-after__label--before {
    left: 12px;
  }

  .before-after__label--after {
    right: 12px;
  }

  .before-after__handle {
    width: 36px;
    height: 36px;
  }

  /* ----- Why Section ----- */
  .why-feature {
    gap: 14px;
  }

  .why-feature__icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .why-feature__text h4 {
    font-size: 1.05rem;
  }

  .why-feature__text p {
    font-size: 0.85rem;
  }

  /* ----- Buttons — Full Width ----- */
  .btn {
    padding: 14px 24px;
    width: 100%;
    justify-content: center;
  }

  .btn--sm {
    padding: 10px 20px;
  }

  /* Override for inline small buttons */
  .btn--inline {
    width: auto;
  }

  /* ----- Cards ----- */
  .card__body {
    padding: 20px;
  }

  /* ----- Mobile Menu ----- */
  .mobile-menu__link {
    font-size: 1.5rem;
    padding: 10px 20px;
  }

  /* ----- Cookie Banner ----- */
  .cookie-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .cookie-banner__accept,
  .cookie-banner__reject {
    width: 100%;
    text-align: center;
  }

  /* ----- Back to Top ----- */
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* ----- Breadcrumb ----- */
  .breadcrumb {
    font-size: 0.8rem;
  }

}


/* ==========================================================================
   SMALL MOBILE — max-width: 360px
   ========================================================================== */

@media (max-width: 360px) {

  :root {
    --section-pad: 36px;
    --container-pad: 14px;
  }

  body {
    font-size: 14px;
  }

  /* ----- Typography ----- */
  .hero__title {
    font-size: 1.5rem;
  }

  .section-heading {
    font-size: 1.2rem;
  }

  .hero-sub__title {
    font-size: 1.2rem;
  }

  /* ----- Navigation ----- */
  .navbar {
    padding: 0 14px;
    height: 56px;
  }

  .navbar__logo img {
    height: 30px;
  }

  /* ----- Hero ----- */
  .hero {
    min-height: 420px;
  }

  .hero__subtitle {
    font-size: 0.85rem;
  }

  .hero__label {
    font-size: 0.6rem;
    gap: 10px;
  }

  .hero__label::before {
    width: 24px;
  }

  /* ----- Stats ----- */
  .stats-bar {
    padding: 24px 0;
  }

  .stats-bar__item {
    padding: 14px 10px;
  }

  .stats-bar__number {
    font-size: 1.3rem;
  }

  .stats-bar__label {
    font-size: 0.7rem;
  }

  /* ----- Service Cards ----- */
  .service-card {
    padding: 24px 16px 20px;
  }

  .service-card__title {
    font-size: 1.1rem;
  }

  .service-card__desc {
    font-size: 0.85rem;
  }

  .service-card__number {
    font-size: 3.5rem;
  }

  /* ----- Reviews ----- */
  .review-card {
    flex: 0 0 240px;
    padding: 16px;
  }

  .review-card__text {
    font-size: 0.85rem;
  }

  /* ----- CTA Banner ----- */
  .cta-banner {
    padding: 36px 0;
  }

  .cta-banner__heading {
    font-size: 1.15rem;
  }

  .cta-banner__text {
    font-size: 0.85rem;
  }

  /* ----- Footer ----- */
  .footer {
    padding-top: 36px;
  }

  .footer__grid {
    gap: 24px;
  }

  .footer__heading {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }

  .footer__links a {
    font-size: 0.85rem;
  }

  .footer__copyright {
    font-size: 0.75rem;
  }

  .footer__legal a {
    font-size: 0.75rem;
  }

  /* ----- Form ----- */
  .form-progress__circle {
    width: 30px;
    height: 30px;
    font-size: 0.7rem;
  }

  .form-progress__line {
    width: 16px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px;
    font-size: 0.95rem;
  }

  .upload-zone {
    padding: 20px 12px;
  }

  .upload-zone__icon {
    font-size: 1.5rem;
  }

  .upload-zone__text {
    font-size: 0.8rem;
  }

  /* ----- Why Section ----- */
  .why-feature {
    flex-direction: column;
    gap: 10px;
  }

  /* ----- Buttons ----- */
  .btn {
    padding: 12px 20px;
    font-size: 0.8rem;
  }

  /* ----- Cards ----- */
  .card__body {
    padding: 16px;
  }

  .card__title {
    font-size: 1.05rem;
  }

  /* ----- Mobile Menu ----- */
  .mobile-menu__link {
    font-size: 1.3rem;
  }

  .mobile-menu__close {
    top: 14px;
    right: 14px;
  }

  /* ----- Before/After ----- */
  .before-after__handle {
    width: 32px;
    height: 32px;
  }

  .before-after__handle::before {
    font-size: 1rem;
  }

}


/* ==========================================================================
   TOUCH DEVICE ENHANCEMENTS
   Ensures minimum 44x44px touch targets per WCAG 2.5.5
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {

  /* Ensure all interactive elements meet minimum touch target */
  .btn,
  .navbar__cta,
  .gallery-filter-btn,
  .reviews-nav__btn,
  .back-to-top,
  .mobile-menu__close,
  .mobile-menu__socials a,
  .footer__socials a,
  .cookie-banner__accept,
  .cookie-banner__reject {
    min-height: 44px;
    min-width: 44px;
  }

  /* Larger tap targets for nav links */
  .navbar__link {
    padding: 12px 8px;
  }

  /* Gallery overlays always visible on touch */
  .gallery-item__overlay {
    opacity: 1;
  }

  /* Remove hover-only effects that cause sticky-hover on touch */
  .service-card:hover {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  /* Remove hover zoom on gallery to prevent accidental activation */
  .gallery-item:hover img {
    transform: none;
  }

  /* Preview grid remove button always visible */
  .preview-grid__remove {
    opacity: 1;
  }

}


/* ==========================================================================
   LANDSCAPE MOBILE
   ========================================================================== */

@media (max-height: 500px) and (orientation: landscape) {

  .hero {
    height: auto;
    min-height: 100vh;
    padding: 80px 0 40px;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 0.9rem;
    margin-bottom: 24px;
  }

  .hero__scroll {
    display: none;
  }

  .hero-sub {
    height: auto;
    min-height: 50vh;
    padding: 80px 0 40px;
  }

  .mobile-menu {
    overflow-y: auto;
    padding: 20px;
    justify-content: flex-start;
    padding-top: 80px;
  }

  .mobile-menu__link {
    font-size: 1.2rem;
    padding: 8px 16px;
  }

}


/* ==========================================================================
   HIGH-RESOLUTION / RETINA DISPLAYS
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {

  /* Ensure borders are crisp on retina */
  .stats-bar__item + .stats-bar__item::before {
    transform: translateY(-50%) scaleX(0.5);
  }

  .service-card::before {
    height: 2px;
  }

}


/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {

  /* Hide non-essential elements */
  .navbar,
  .mobile-menu,
  .back-to-top,
  .cookie-banner,
  .hero__scroll,
  .hero__blueprint,
  .cta-banner__blueprint,
  .reviews-nav,
  .btn-whatsapp,
  .footer__socials {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  .hero {
    height: auto;
    min-height: auto;
    padding: 24pt 0;
    page-break-after: always;
  }

  .hero__overlay {
    background: transparent;
  }

  .hero__content {
    max-width: 100%;
    padding: 0;
  }

  .hero__title,
  .section-heading,
  h1, h2, h3 {
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  .section {
    padding: 24pt 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .services-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12pt;
  }

  .service-card {
    box-shadow: none;
    border: 0.5pt solid #ccc;
    break-inside: avoid;
  }

  .footer {
    background: white;
    color: black;
    border-top: 1pt solid #ccc;
    padding-top: 12pt;
  }

  .footer__heading {
    color: black;
  }

  .footer__links a {
    color: black;
  }

  img {
    max-width: 100% !important;
  }

}
