/* =============================================================
   DOMUS — COMPREHENSIVE MOBILE RESPONSIVE FIX
   Applied to ALL pages. Breakpoints: 768px / 480px / 390px
   ============================================================= */

/* ─ 1. GLOBAL OVERFLOW PREVENTION ─────────────────────────── */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

section, header, footer, main {
  overflow-x: hidden;
  max-width: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
}

/* ─ 2. SITE HEADER — All Pages ─────────────────────────────── */
@media (max-width: 768px) {
  .footer-logo-img {
    height: 30px !important;
  }

  .site-header {
    padding: 0.6rem 1rem !important;
    position: fixed;
    width: 100%;
  }
  .logo-img {
    height: 32px !important;
  }
  .hamburger {
    width: 36px;
    height: 36px;
  }
}

/* ─ 3. MOBILE NAV ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.6rem 1rem !important;
    position: fixed !important;
    top: 0 !important;
    z-index: 1000 !important;
  }

  .mobile-nav {
    padding: 6rem 2rem 2rem;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.6s var(--ease-expo), visibility 0s 0.6s;
  }
  .mobile-nav.open {
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.6s var(--ease-expo), visibility 0s;
  }
  .mobile-nav a {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
  }
  /* Sub-links in projects dropdown */
  .mobile-sub-links.is-open {
    max-height: 200px;
  }
  .mobile-nav-item-wrap {
    padding: 0.1rem 0;
  }
}

/* ─ 4. HERO SECTIONS ─ ALL PAGES ───────────────────────────── */
@media (max-width: 768px) {
  /* Home page hero — Mobile Viewport & Preserved Video Composition */
  .hero-domus-style {
    height: 100vh;
    height: 100svh;
    min-height: 100svh;
    max-height: 100dvh;
    background: #000000;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
  }

  /* Obsolete mobile video hero styles removed */

  /* Index page hero fallback */
  .hero {
    min-height: 100svh;
  }
}

/* ─ 5. ABOUT.HTML SECTIONS ──────────────────────────────────── */
@media (max-width: 768px) {
  /* About hero section */
  .about-section .about-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  .about-section .about-image-wrapper img {
    min-height: 280px !important;
    aspect-ratio: 4/3;
    border-radius: 20px;
  }
  /* Stats / counters */
  .counters {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .counter .num {
    font-size: clamp(2rem, 9vw, 3rem);
  }
  /* Philosophy section */
  .philosophy {
    padding-block: 60px 50px !important;
  }
  .philosophy-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.2rem !important;
  }
  .philosophy-content {
    order: 1 !important;
    align-items: flex-start !important;
  }
  .philosophy-quote {
    font-size: clamp(36px, 8vw, 44px) !important;
    margin-top: 25px !important;
    margin-bottom: 25px !important;
    line-height: 1.06 !important;
  }
  .philosophy-rule {
    margin-bottom: 25px !important;
  }
  .philosophy-body {
    font-size: 14px !important;
    line-height: 1.65 !important;
    margin-bottom: 30px !important;
  }
  .philo-float {
    order: 2 !important;
    width: 100% !important;
  }
  .philo-float img {
    aspect-ratio: 16 / 10 !important;
    height: 100% !important;
  }
  .philo-float.f1 {
    aspect-ratio: 16 / 10 !important;
    box-shadow: none !important;
  }
  .philo-float.f2 {
    display: none !important;
  }

  /* Team 2-column on mobile */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .team-photo {
    aspect-ratio: 1;
  }
}

@media (max-width: 480px) {
  .counters {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  .team-grid {
    grid-template-columns: 1fr;
  }
}

/* ─ 6. SERVICES.HTML ─────────────────────────────────────────── */
/* Services hero 3-column → 1-column */
@media (max-width: 768px) {
  .services-hero {
    padding-top: 100px !important;
    padding-bottom: 50px !important;
    min-height: auto !important;
  }
  .services-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
  .services-hero-title {
    font-size: clamp(2rem, 8vw, 2.8rem) !important;
  }
  .services-hero-desc {
    max-width: 100% !important;
  }
  .artwork-frame {
    max-width: 260px;
    margin: 0 auto;
  }

  /* UGC Real Lives section */
  .ugc-section {
    padding: clamp(3rem, 7vw, 4.5rem) 0 !important;
    overflow: hidden !important;
  }
  .ugc-container {
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }
  .ugc-heading {
    font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
    font-family: var(--font-display) !important;
    margin-bottom: 20px !important;
  }
  .ugc-carousel {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x pan-y !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    gap: 16px !important;
    padding: 8px 16px 20px !important;
    margin: 0 -16px !important;
    width: calc(100% + 32px) !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
  .ugc-carousel::-webkit-scrollbar {
    display: none !important;
  }
  .ugc-item {
    flex: 0 0 calc(100vw - 52px) !important;
    max-width: 340px !important;
    min-width: 270px !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: normal !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  /* Services editorial blocks — stack */
  .services-intro {
    padding: 60px 0 30px !important;
  }
  .services-list-container {
    gap: 70px !important;
  }
  .service-block,
  .service-block.row-reverse {
    flex-direction: column !important;
    gap: 1.8rem !important;
    align-items: flex-start !important;
  }
  .service-media, .service-info {
    width: 100%;
    max-width: 100%;
  }
  .service-image-wrap {
    aspect-ratio: 4/3 !important;
  }
  .service-description {
    max-width: 100% !important;
  }
  .service-title {
    font-size: clamp(1.6rem, 6vw, 2rem) !important;
  }

  /* Process timeline section */
  .process-section {
    padding: 70px 0 !important;
  }
  .process-header-block {
    margin-bottom: 50px !important;
  }
  #process-heading {
    font-size: clamp(2rem, 7vw, 3rem) !important;
  }
  .process-timeline-container {
    gap: 55px !important;
  }
  .process-stage-item {
    flex-direction: column !important;
    padding-left: 28px !important;
    gap: 0.6rem !important;
  }
  .stage-number-col {
    flex: none !important;
  }
  .stage-large-num {
    font-size: 2rem !important;
  }
  .stage-desc {
    max-width: 100% !important;
  }
}

/* ─ 7. PROJECTS.HTML ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Project showcase cards */
  .projects-showcase {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 0 16px !important;
  }
  .project-showcase-card {
    padding: 12px !important;
    border-radius: 22px !important;
  }
  /* Stats luxury section (2 col → 1 col already handled above) */
  .stats-section-luxury {
    padding: clamp(50px, 8vw, 90px) 16px !important;
  }
  .stats-grid-luxury {
    grid-template-columns: 1fr !important;
    gap: 50px !important;
    padding: 0 !important;
  }
  .stat-number-large {
    font-size: clamp(70px, 18vw, 120px) !important;
  }
  .stat-number-plus {
    font-size: clamp(40px, 10vw, 70px) !important;
  }
  /* Gallery carousel */
  .gallery-slide {
    min-width: 82vw !important;
  }
  .gallery-carousel-wrapper {
    border-radius: 18px !important;
  }
}

/* ─ 8. PROJECT DETAIL PAGES (domus-prive, east, west) ──────── */
@media (max-width: 768px) {
  /* About info section below hero */
  .property-inner {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .property-left {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .property-right {
    display: none !important;
  }
  .property-title {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
    margin: 1rem 0 0.5rem !important;
  }
  .property-list span {
    font-size: 14px !important;
    min-width: 120px !important;
    padding: 4px 10px !important;
  }
  .property-list strong {
    font-size: 16px !important;
  }

  /* Amenities grid */
  .amenities-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  .amenity-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px !important;
  }
  .amenity-card img {
    width: 50px !important;
    height: 50px !important;
  }
  .amenity-card p {
    font-size: 14px !important;
    margin-top: 6px !important;
  }

  /* Gallery section */
  .gallery-heading {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
  }

  /* Mobile carousel for project pages */
  .mobile-carousel {
    padding: 40px 0 !important;
  }
  .mobile-carousel__header {
    padding: 30px 16px !important;
  }
  .mobile-carousel__heading {
    font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
  }

  /* Footer in project detail */
  .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer-right {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
  .footer-left {
    max-width: 100% !important;
  }
  .footer-logo-wrap {
    justify-content: center !important;
  }
  .domus-footer {
    padding: 50px 16px 30px !important;
  }
  /* New footer from project-detail.css */
  .footer-top-row {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .footer-explore-links {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .footer-middle-row {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 24px 0 !important;
  }
  .footer-bottom-row {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

@media (max-width: 480px) {
  /* Amenities: 2 col stays readable but icons smaller */
  .amenity-card img {
    width: 40px !important;
    height: 40px !important;
  }
  .amenity-card p {
    font-size: 12px !important;
  }
  /* Property list — smaller pills */
  .property-list span {
    font-size: 12px !important;
    min-width: 100px !important;
  }
}

/* ─ 10. FOOTER — ALL PAGES (main site footer from style.css) ── */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    align-items: start !important;
    margin-bottom: 2rem !important;
  }
  .footer-brand {
    grid-column: 1 !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.6rem !important;
    text-align: left !important;
  }
  /* Social icons in footer */
  .footer-socials {
    justify-content: flex-start !important;
  }
  /* Back to top */
  .back-to-top {
    bottom: 1.2rem;
    right: 1.2rem;
    width: 40px;
    height: 40px;
  }
  /* Remove excess height on footer */
  .site-footer {
    min-height: auto !important;
    padding-top: clamp(3rem, 7vw, 4.5rem) !important;
  }
  .site-footer a, .footer-col a {
    color: #AAA39B !important;
  }
  .site-footer a:hover, .footer-col a:hover {
    color: #C8A45D !important;
  }
  .footer-col h5 {
    color: #8D877F !important;
  }
  /* Fix social links in footer */
  .footer-social a {
    padding: 0 !important;
    color: #AAA39B !important;
  }
  .footer-social a:hover {
    color: #C8A45D !important;
  }
}

@media (max-width: 480px) {
  .footer-top {
    grid-template-columns: 1fr !important;
  }
  .footer-brand {
    grid-column: 1 !important;
  }
}

/* ─ 11. CONTAINER PADDING ────────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* ─ 12. SECTION SPACING ──────────────────────────────────────── */
@media (max-width: 768px) {
  section {
    /* Allow sections to naturally size themselves; don't hard-set */
  }
  /* Section heads */
  .section-head {
    max-width: 100% !important;
  }
  .eyebrow, .gold-eyebrow {
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
  }
}

/* ─ 13. FORM INPUTS (Contact page) ──────────────────────────── */
@media (max-width: 768px) {
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
    padding: 12px 0 !important;
  }
  .btn-submit,
  .btn-pill-discover,
  .hero-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ─ 14. 3D Carousel (index page) ─────────────────────────────── */
@media (max-width: 480px) {
  .carousel-3d-stage { height: 260px !important; }
  .carousel-3d-slide { width: 180px !important; height: 230px !important; }
}

/* ─ 15. BACK TO TOP BUTTON ───────────────────────────────────── */
.back-to-top {
  z-index: 9900;
}

/* ─ 16. THE DOMUS INTRO MOBILE OVERRIDES ─────────────────────── */
@media (max-width: 768px) {
  .domus-intro {
    padding-block: 60px 50px !important;
  }
  .domus-intro-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.2rem !important;
  }
  .domus-intro-content {
    order: 2 !important;
    align-items: flex-start !important;
  }
  .domus-intro-media {
    order: 1 !important;
    width: 100% !important;
  }
  .domus-intro-media img {
    aspect-ratio: 16 / 11 !important;
  }
  .domus-intro-headline {
    font-size: clamp(36px, 8vw, 44px) !important;
    margin-top: 25px !important;
    margin-bottom: 25px !important;
    line-height: 1.06 !important;
  }
  .domus-intro-rule {
    margin-bottom: 25px !important;
  }
  .domus-intro-body {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }
  .domus-intro-cta {
    margin-top: 30px !important;
  }
}

/* ─ 17. PROJECTS INTRO & GRID MOBILE OVERRIDES ───────────────── */
@media (max-width: 768px) {
  .projects-section {
    padding-top: 70px !important;
    padding-bottom: 60px !important;
  }
  .projects-intro {
    margin-bottom: 36px !important;
  }
  .projects-intro h2 {
    font-size: clamp(38px, 8vw, 44px) !important;
    margin-top: 16px !important;
    margin-bottom: 12px !important;
    line-height: 1.06 !important;
  }
  .projects-intro-desc {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }
  .project-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .project-card {
    grid-column: 1 / -1 !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .project-card .media {
    width: 100% !important;
    height: auto !important;
  }
  .project-card:nth-child(1) .media,
  .project-card:nth-child(4) .media {
    aspect-ratio: 16 / 10.5 !important;
  }
  .project-card:nth-child(2) .media,
  .project-card:nth-child(3) .media {
    aspect-ratio: 4 / 3 !important;
  }
  .project-details {
    padding-inline: 0 !important;
  }
  .project-num {
    font-size: 9px !important;
    margin-bottom: 2px !important;
  }
  .project-title {
    font-size: 14px !important;
    margin-bottom: 1px !important;
    line-height: 1.25 !important;
  }
  .project-category {
    font-size: 9px !important;
    letter-spacing: 0.12em !important;
  }
  .project-arrow {
    font-size: 9px !important;
    margin-top: 10px !important;
  }
  .projects-footer {
    margin-top: 40px !important;
    text-align: left !important;
  }
}

