/* =====================================================================
   GODREJ INDORE — RESPONSIVE LAYER (mobile / tablet / desktop)
   Loaded after /assets/style.css on every page. Only adjusts layout
   per screen size; colours, fonts and design stay the same.
   Breakpoints: 1279 (small laptop) · 1023 (tablet) · 767 (large phone)
                · 575 (phone) · 340 (small phone)
   ===================================================================== */

/* ---------- Global safety ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: clip; }
img, iframe, video, svg { max-width: 100%; }
img { height: auto; }
body { overflow-wrap: break-word; }
button, .btn, a { touch-action: manipulation; }
.skip-to-content { top: -80px; }

/* Section nav sticks just below the fixed header (was hidden behind it) */
.project-sub-header { top: 72px; }
html { scroll-padding-top: 140px; }

/* Breadcrumb wraps instead of overflowing */
.breadcrumb-bar .container { flex-wrap: wrap; row-gap: 4px; }

/* Long headings / numbers never push the page wider */
.highlights-grid, .amenities-grid, .invest-grid, .explore-grid, .payment-plan-grid,
.location-cards, .connectivity-grid, .why-location-grid, .builder-stats, .contact-info-grid {
    grid-template-columns: repeat(var(--cols, auto-fill), minmax(0, 1fr));
}
.highlights-grid { --cols: 5; } .amenities-grid { --cols: 4; } .invest-grid { --cols: 3; }
.explore-grid { --cols: 3; } .payment-plan-grid { --cols: 3; } .location-cards { --cols: 3; }
.connectivity-grid { --cols: 2; } .why-location-grid { --cols: 3; } .builder-stats { --cols: 4; }
.contact-info-grid { --cols: 3; }
.highlight-card .num { font-size: clamp(20px, 2.4vw, 34px); hyphens: auto; }
.highlight-card .num, .highlight-card .label { overflow-wrap: anywhere; }

/* Tables: wide tables scroll inside their box, never the page */
.spec-table-wrap, .price-table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
.spec-table { min-width: 0; }
.spec-table:has(thead th:nth-child(4)) { min-width: 560px; }

/* Desktop mega menu: fits the screen and scrolls if long */
.mega-menu { grid-template-columns: repeat(4, minmax(170px, 210px)); max-width: calc(100vw - 40px); }

/* Mega menu links: left-aligned, evenly spaced (all screens) */
.mega-menu-col ul { align-items: flex-start; }
.mega-menu-col li, nav#main-nav .mega-menu-col li { margin: 0; text-align: left; }
.mega-menu-col a { display: block; }

/* Keyboard users keep the focus ring; mouse/touch taps don't leave a box */
:focus:not(:focus-visible) { outline: none; }

/* ---------- Small laptops (≤1279px) ---------- */
@media (max-width: 1279px) {
    nav li { margin-left: 16px; }
    nav a { font-size: 13px; }
    .highlights-grid { --cols: 4; }
    .mega-menu { grid-template-columns: repeat(3, minmax(170px, 210px)); }
}

/* ---------- Tablets & below (≤1023px): hamburger menu ---------- */
@media (max-width: 1023px) {
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
    nav#main-nav {
        position: fixed; top: 72px; left: 0; width: 100%; background: var(--white); padding: 16px 24px 24px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); transform: translateY(-120%); opacity: 0;
        transition: all 0.35s ease; z-index: 999; visibility: hidden; border-top: 1px solid var(--gray-light);
        max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    nav#main-nav.active { transform: translateY(0); opacity: 1; visibility: visible; }
    nav#main-nav > ul { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
    nav#main-nav li { margin: 0; border-bottom: 1px solid var(--gray-light); }
    nav#main-nav li:last-child { border-bottom: 0; }
    nav#main-nav a { display: block; padding: 13px 0; font-size: 15px; }
    nav#main-nav a:after { display: none; }
    nav#main-nav .nav-dropdown > a.dropdown-toggle { display: flex; justify-content: space-between; width: 100%; }
    .mega-menu {
        position: static; box-shadow: none; opacity: 1; visibility: visible; transform: none; max-width: none;
        display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px;
        padding: 6px 0 14px; background: transparent; max-height: none; overflow-y: visible; border-radius: 0;
    }
    .nav-dropdown.open .mega-menu { display: grid; }
    nav#main-nav .mega-menu-col li { border-bottom: 0; }
    nav#main-nav .mega-menu-col a { padding: 7px 0; font-size: 13.5px; }
    .mega-menu-col h5 { color: var(--secondary); border-bottom-color: rgba(0,0,0,0.08); }

    /* Section nav under hero: horizontal swipe, never hidden */
    nav.project-sub-nav {
        position: static !important; transform: none !important; opacity: 1 !important; visibility: visible !important;
        width: auto !important; padding: 0 !important; box-shadow: none !important; border-top: 0 !important;
        max-height: none !important; overflow-x: auto !important; justify-content: flex-start !important;
    }

    h1 { font-size: 2.4rem; } h2 { font-size: 2rem; }
    section { padding: 64px 0; }
    .banner { padding: 130px 20px 70px; }
    .banner-flex, .overview-content, .builder-content { gap: 36px; }
    .banner-image, .overview-image { width: 100%; max-width: 640px; margin: 0 auto; }
    .highlights-grid { --cols: 3; } .amenities-grid { --cols: 3; } .invest-grid { --cols: 2; }
    .explore-grid { --cols: 2; } .payment-plan-grid { --cols: 2; } .location-cards { --cols: 2; }
    .why-location-grid { --cols: 2; } .builder-stats { --cols: 2; } .contact-info-grid { --cols: 1; }
    footer .footer-content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
    .location-image { min-height: 420px; }
}

/* ---------- Phones (≤767px) ---------- */
@media (max-width: 767px) {
    section, .contact-section, .explore-section { padding: 52px 0; }
    .container { padding: 0 16px; }
    .section-title { font-size: 26px; margin-bottom: 36px; }
    .section-subtitle { font-size: 1rem; margin-bottom: 32px; }
    h3 { font-size: 1.35rem; }
    .banner { padding: 112px 16px 56px; }
    .banner-content h1, .page-hero h1 { font-size: 30px; }
    .page-hero { padding: 48px 16px 52px; }
    .breadcrumb-bar { padding: 12px 0; }

    /* Justified paragraphs read badly on narrow screens */
    [style*="text-align: justify"], [style*="text-align:justify"] { text-align: left !important; }
    ul[style*="columns:2"], ul[style*="columns: 2"] { columns: 1 !important; }

    .highlights-grid, .amenities-grid { --cols: 2; gap: 12px; }
    .invest-grid, .explore-grid, .payment-plan-grid, .location-cards, .connectivity-grid, .why-location-grid { --cols: 1; }
    .explore-grid { gap: 16px; margin-top: 24px; }
    .highlight-card { padding: 20px 12px; }
    .highlight-card .num { font-size: clamp(17px, 5vw, 22px); }
    .highlight-card .icon { font-size: 26px; }
    .invest-card, .explore-item { padding: 24px 20px; }
    .overview-text ul { grid-template-columns: 1fr; }

    /* Buttons: full-width, easy to tap */
    .btn-group { flex-direction: column; align-items: stretch; gap: 12px; }
    .btn-group .btn, .price-cta-box .btn { width: 100%; min-height: 48px; padding: 14px 20px; }

    /* Price table becomes stacked cards */
    .price-table { min-width: 0; }
    .price-table thead { display: none; }
    .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; width: 100%; }
    .price-table tr { padding: 16px 18px; border-bottom: 1px solid var(--gray-light); }
    .price-table tbody tr:last-child { border-bottom: 0; }
    .price-table td { padding: 3px 0; border: 0; }
    .price-table td:nth-child(2) { font-weight: 700; color: var(--secondary); margin: 6px 0 10px; }
    .price-table .config-btn { width: 100%; min-height: 44px; justify-content: center; }

    /* Two-column spec tables fit the screen */
    .spec-table th, .spec-table td { padding: 12px 14px; font-size: 13px; }
    .spec-table td:first-child { width: 38%; }

    .floorplan-content { gap: 24px; }
    .builder-stats .stat .num { font-size: 22px; }
    .faq-question { padding: 16px 18px; font-size: 15px; gap: 12px; text-align: left; }
    .faq-answer, .faq-item.active .faq-answer { padding-left: 18px; padding-right: 18px; }
    .contact-form-wrap { padding: 24px 18px; }
    .form-control, .contact-form-wrap input, .contact-form-wrap select, .contact-form-wrap textarea,
    .modal-body input, .modal-body select, .modal-body textarea { font-size: 16px; } /* no iOS zoom */

    footer { padding: 40px 0 24px; }
    footer .footer-content { grid-template-columns: 1fr; gap: 26px; margin-bottom: 26px; }
    footer .footer-col ul li a { display: inline-block; padding: 3px 0; }

    .location-image { min-height: 340px; }
    .location-map, .location-map-basic iframe { height: 320px; }
    .project-sub-nav a { padding: 0 12px; font-size: 13px; }
}

/* ---------- Small phones (≤575px) ---------- */
@media (max-width: 575px) {
    .contact-form-wrap .country-phone-group select, .modal-body .country-phone-group select { width: 100%; max-width: none; }
    .mega-menu { grid-template-columns: 1fr; gap: 14px; }
    .modal-content { width: 100%; max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; max-height: 92vh; max-height: 92dvh; }
    .modal-overlay { align-items: flex-end; }
    .modal-body { padding: 20px 18px; }
}

/* ---------- Very small phones (≤340px) ---------- */
@media (max-width: 340px) {
    .highlights-grid, .amenities-grid { --cols: 1; }
    .banner-content h1, .page-hero h1 { font-size: 26px; }
    .section-title { font-size: 23px; }
    .logo { font-size: 16px; }
}

/* ---------- Large screens (≥1440px) ---------- */
@media (min-width: 1440px) {
    .container { max-width: 1280px; }
    .header-container { max-width: 1280px; }
}

/* Desktop: keep "More" exactly in line with the other menu items */
@media (min-width: 1024px) {
    nav#main-nav > ul > li { display: flex; align-items: center; height: 32px; }
}
