/* ==========================================================================
   Mysore Travel Taxi — Responsive Stylesheet (All Viewports)
   Tested: 1440px, 1200px, 992px, 768px, 480px, 390px, 360px
   ========================================================================== */

/* Universal Overflow & Layout Safety */
html {
    scroll-behavior: smooth;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

body.menu-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   1200px Breakpoint (Laptops & Small Desktops)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .site-nav { gap: .65rem; }
    .brand img { width: 185px; }
    .route-grid { grid-template-columns: repeat(3, 1fr); }
    .fleet-grid, .rate-card-grid, .outstation-rate-grid { grid-template-columns: repeat(3, 1fr); }
    .package-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------------------------------
   Desktop-only Helper (>= 993px)
   -------------------------------------------------------------------------- */
@media (min-width: 993px) {
    .booking-form-compact .form-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .65rem; }
    .booking-form-compact .form-grid label { font-size: .7rem; }
    .booking-form-compact .form-grid input,
    .booking-form-compact .form-grid select { min-width: 0; padding-inline: .55rem; }
    .booking-form-compact .field-error:empty { display: none; }
    .booking-form-compact .consent { margin-block: .7rem .4rem; }
    .booking-form-compact .form-note { margin-top: .35rem; }
    .mobile-actions { display: none; }
}

/* --------------------------------------------------------------------------
   992px Breakpoint (Tablets & Landscape Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    :root { --section: 3.5rem; }
    .container { width: min(100% - 2rem, var(--container)); }
    .nav-inner { min-height: 68px; }
    .brand img { width: 175px; height: 56px; }
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        background: #ffffff;
        border: 1.5px solid #dedacf;
        border-radius: 8px;
        cursor: pointer;
        transition: border-color 0.2s ease, background-color 0.2s ease;
        z-index: 1001;
    }
    
    .menu-toggle:hover {
        border-color: #f5bb18;
        background: #fffdf5;
    }
    
    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2.5px;
        background: #111111;
        border-radius: 2px;
        margin: 0;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, background-color 0.2s ease;
    }
    
    .menu-toggle[aria-expanded="true"] {
        position: fixed;
        z-index: 1300;
        top: 1.15rem;
        right: 1.25rem;
        background: #111111;
        border-color: #111111;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    }
    
    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
        background: #ffffff;
    }
    
    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    
    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
        background: #ffffff;
    }
    
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .nav-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }
    
    .site-nav {
        position: fixed;
        visibility: hidden;
        z-index: 1200;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(340px, 86vw);
        max-width: 360px;
        height: 100vh;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        background: #ffffff !important;
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.3);
        transform: translateX(105%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
        overflow: hidden;
    }
    
    .site-nav.open {
        visibility: visible;
        transform: translateX(0);
        transition-delay: 0s;
    }
    
    .site-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.15rem 1.4rem;
        background: #faf8f2;
        border-bottom: 1px solid #edeae1;
    }
    
    .site-nav-title {
        font-size: 0.95rem;
        font-weight: 800;
        color: #111111;
        letter-spacing: -0.01em;
    }
    
    .site-nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        background: #ffffff;
        border: 1px solid #dedacf;
        border-radius: 7px;
        font-size: 1rem;
        color: #111111;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .site-nav-close:hover {
        background: #111111;
        color: #ffffff;
        border-color: #111111;
    }
    
    .site-nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .site-nav-links > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.95rem 1.4rem;
        font-size: 0.95rem;
        font-weight: 750;
        color: #1a1a1a;
        text-decoration: none;
        border-bottom: 1px solid #f2eee6;
        transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
    }
    
    .site-nav-links > a:hover {
        background: #fffdf5;
        color: #b97900;
        padding-left: 1.65rem;
    }
    
    .site-nav-links > a.active {
        color: #b97900;
        font-weight: 800;
        background: #fff9e6;
        border-left: 4px solid #f5bb18;
    }
    
    .site-nav-links > a::after {
        display: none;
    }
    
    .nav-link-arrow {
        display: inline-block;
        color: #cccccc;
        font-size: 0.75rem;
        transition: transform 0.2s ease, color 0.2s ease;
    }
    
    .site-nav-links > a:hover .nav-link-arrow {
        color: #b97900;
        transform: translateX(3px);
    }
    
    .site-nav-footer {
        padding: 1.2rem 1.4rem;
        background: #faf8f2;
        border-top: 1px solid #edeae1;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        margin-top: auto;
    }
    
    .site-nav-footer .nav-cta {
        margin: 0;
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.8rem;
        font-size: 0.92rem;
        font-weight: 800;
        border-radius: 8px;
    }
    
    .site-nav-contact {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.82rem;
        font-weight: 750;
    }
    
    .site-nav-contact a {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #444444;
        text-decoration: none;
    }
    
    .site-nav-contact a i {
        color: #f5bb18;
    }

    .home-hero { min-height: 540px; background-position: 65% center; }
    .home-hero-content { position: relative; z-index: 3; width: 80%; }
    .inner-hero { min-height: 440px; }
    .inner-hero-content { width: 80%; }
    
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .fleet-grid { grid-template-columns: repeat(2, 1fr); }
    .route-grid { grid-template-columns: repeat(2, 1fr); }
    .package-grid { grid-template-columns: repeat(2, 1fr); }
    .trust-grid, .popular-question-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .booking-form-compact .form-grid { grid-template-columns: repeat(2, 1fr); }
    
    .split-feature { grid-template-columns: 1fr; }
    .split-feature-media { min-height: 320px; }
    .landing-overview { grid-template-columns: 1fr; }
    .about-intro { grid-template-columns: 1fr; }
    .image-stack { max-width: 480px; margin-inline: auto; }
    .service-area-panel { grid-template-columns: 1fr; }
    .charges-grid { grid-template-columns: 1fr; }
    .faq-layout { grid-template-columns: 1fr; }
    .faq-sidebar { position: static; }
    .topic-list { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-brand { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   768px Breakpoint (Mobile Phones in Portrait & Small Tablets)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        font-size: .95rem;
    }
    
    .utility-inner { justify-content: space-between; gap: .6rem; font-size: .72rem; }
    .home-hero { min-height: auto; background-position: 70% center; }
    .home-hero-content { width: 100%; padding-block: 3.5rem 4.5rem; }
    .inner-hero { min-height: auto; }
    .inner-hero-content { width: 100%; padding-block: 3rem 3.5rem; }
    
    .hero-trust { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .booking-shell { width: 100%; margin-top: -24px; padding: 1.15rem 1rem; border-radius: 10px; }
    
    /* Horizontal Scrolling Carousels with Snap */
    .route-grid,
    .fleet-grid,
    .rate-card-grid,
    .outstation-rate-grid,
    .page-packages .package-grid {
        display: flex;
        width: 100%;
        margin-inline: 0;
        padding-inline: 0;
        padding-bottom: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 0.85rem;
    }
    
    .route-card {
        min-width: min(78vw, 300px);
        flex: 0 0 min(78vw, 300px);
        scroll-snap-align: start;
    }
    
    .vehicle-card {
        min-width: min(78vw, 300px);
        flex: 0 0 min(78vw, 300px);
        scroll-snap-align: start;
    }
    
    .package-card {
        min-width: min(80vw, 310px);
        flex: 0 0 min(80vw, 310px);
        scroll-snap-align: start;
    }
    
    .rate-card, .outstation-card {
        min-width: min(78vw, 290px);
        flex: 0 0 min(78vw, 290px);
        scroll-snap-align: start;
    }

    .services-grid { grid-template-columns: 1fr; }
    .trust-grid, .popular-question-grid { grid-template-columns: 1fr; }
    .value-cards, .faq-preview { grid-template-columns: 1fr; }
    .detail-grid, .related-grid { grid-template-columns: 1fr; }
    .contact-side { grid-template-columns: 1fr; }
    
    .contact-strip { grid-template-columns: 1fr; margin-top: -28px; }
    .contact-method + .contact-method { border-top: 1px solid var(--line); border-left: 0; }
    
    .steps { grid-template-columns: 1fr; }
    .steps li:not(:last-child)::after { display: none; }
    .steps li + li { border-top: 1px solid var(--line); }
    
    .sightseeing-card { grid-template-columns: 1fr; }
    .sightseeing-card img { min-height: 240px; }
    .sightseeing-card-content { padding: 1.5rem 1.25rem; }
    
    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        border: 1px solid var(--line);
    }
    
    .table-wrap table {
        min-width: 540px;
    }

    .final-cta-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; padding-block: 2rem; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
    .footer-bottom { flex-direction: column; gap: .4rem; text-align: left; }
    
    /* Fixed Mobile Action Bar */
    .mobile-actions {
        position: fixed;
        z-index: 999;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: 1fr 1fr 1.2fr;
        min-height: 60px;
        padding: .35rem .6rem calc(.35rem + env(safe-area-inset-bottom, 0px));
        color: var(--white);
        background: #0d0d0d;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
    }
    
    .mobile-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .15rem;
        border-right: 1px solid rgba(255, 255, 255, 0.12);
        font-size: .72rem;
        font-weight: 700;
        color: #ffffff;
        text-decoration: none;
    }
    
    .mobile-action i { color: var(--yellow); font-size: 1.15rem; }
    
    .mobile-action-primary {
        color: #111111;
        background: var(--yellow);
        border: 0;
        border-radius: var(--radius-sm);
        font-weight: 800;
        font-size: 0.78rem;
    }
    
    .mobile-action-primary i { color: #111111; }
}

/* --------------------------------------------------------------------------
   480px Breakpoint (Standard Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .container { width: calc(100% - 1.5rem); }
    .utility-inner span:first-child { display: none; }
    .utility-inner { justify-content: flex-end; }
    .brand img { width: 155px; }
    
    .home-hero h1, .inner-hero h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
    .section-heading h2 { font-size: clamp(1.4rem, 6vw, 1.85rem); }
    
    .button-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.65rem;
    }
    
    .button-group .button {
        width: 100%;
        min-height: 48px;
        height: auto;
        flex: 0 0 auto;
        padding: 0.75rem 1.25rem;
        font-size: 0.92rem;
        font-weight: 800;
        text-align: center;
        justify-content: center;
        border-radius: 8px;
    }
    
    .hero-trust { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .segmented-control { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
    .segmented-control label { padding: 0.55rem 0.35rem; font-size: 0.76rem; min-height: 40px; }
    
    .form-grid, .booking-form-compact .form-grid { grid-template-columns: 1fr; gap: 0.65rem; }
    .form-grid input, .form-grid select, .form-grid textarea { min-height: 46px; font-size: 16px; }
    
    .attraction-grid { grid-template-columns: 1fr; }
    .mini-feature-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
    .contact-method { padding: 1rem; }
    
    .image-stack { padding-right: 12px; padding-bottom: 14px; }
    .image-stack .inset-image { width: 44%; max-width: 150px; border-width: 4px; }
    
    .faq-ready-items { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   390px & 360px Breakpoint (Compact Mobile)
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
    .nav-inner { min-height: 62px; }
    .brand img { width: 140px; height: 46px; }
    .menu-toggle { width: 40px; height: 40px; }
    .hero-trust { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .segmented-control label { font-size: 0.72rem; }
    .stops-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Landscape Mobile Keyboard Safe Area
   -------------------------------------------------------------------------- */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 992px) {
    .site-nav { padding-top: 4rem; }
    .site-nav > a:not(.button) { min-height: 40px; }
    .menu-toggle[aria-expanded="true"] { top: .75rem; }
}
