/**
 * Mobile-only styles (max-width: 1023px). Desktop unchanged.
 * Footer layout: uses templates/footer.php original @media (900px) — not overridden here.
 */

@media (max-width: 1023px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        overflow-x: hidden;
    }

    /* iOS: prevent zoom on input focus */
    input,
    select,
    textarea,
    .form-control,
    .form-input,
    .bk-sf-inp,
    .form-inp,
    .form-bp {
        font-size: 16px !important;
    }

    /* Touch targets */
    .btn,
    .vip-btn-login,
    .vip-btn-register,
    .btn-login,
    .btn-register,
    .btn-search,
    .bk-search-btn,
    .btn-select-veh,
    .btn-proceed,
    .nav-hamburger,
    .vip-hamburger {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-hamburger,
    .vip-hamburger {
        min-width: 44px;
        align-items: center;
        justify-content: center;
    }

    /* ── App-style mobile menu (all pages + homepage) ── */
    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .vip-nav-links,
    .vip-auth {
        display: none !important;
    }

    .vip-hamburger {
        display: flex !important;
        z-index: 10060;
        position: relative;
    }

    header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .vip-header-outer {
        padding: 0.5rem 0.75rem;
    }

    .vip-navbar {
        min-height: 48px;
        height: auto;
        gap: 0.75rem;
    }

    .vip-logo-icon {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    .vip-logo-brand {
        font-size: clamp(0.72rem, 3.2vw, 0.95rem);
        white-space: nowrap;
        line-height: 1.15;
    }

    .vip-logo-sub {
        font-size: 0.55rem;
        white-space: nowrap;
        letter-spacing: 0.06em;
    }

    .vip-mobile-nav,
    body.page-home .mobile-nav {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 10050 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: rgba(15, 45, 106, 0.55) !important;
        overflow: hidden !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }

    .vip-mobile-nav.open,
    body.page-home .mobile-nav.open {
        display: block !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.page-home .hero-card > .nav-hamburger {
        display: flex !important;
    }

    body.page-home .hero-card > .nav-hamburger {
        z-index: 10060;
    }

    .vip-mobile-nav-sheet,
    body.page-home .mobile-nav-sheet {
        background: #fff;
        border-radius: 0 0 22px 22px;
        margin: 0;
        padding: 0.35rem 1.25rem 1.35rem;
        padding-top: calc(env(safe-area-inset-top, 0px) + 3.5rem);
        max-height: min(90vh, 560px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
        animation: mobileSheetSlide 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    }

    @keyframes mobileSheetSlide {
        from {
            transform: translateY(-18px);
            opacity: 0.85;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .mobile-menu-title {
        margin: 0 0 0.65rem;
        padding: 0 0 0.65rem;
        font-size: 1.05rem;
        font-weight: 700;
        color: #1e3a6b;
        border-bottom: 1px solid #eef2f7;
        font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    }

    .vip-mobile-nav-sheet > a,
    body.page-home .mobile-nav-sheet > a {
        padding: 0.8rem 0;
        font-size: 0.95rem;
        font-weight: 500;
        min-height: 44px;
        display: flex;
        align-items: center;
        color: #1f2937 !important;
        border-bottom: 1px solid #f3f4f6;
        text-decoration: none;
        font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    }

    .vip-mobile-nav-sheet > a:last-of-type,
    body.page-home .mobile-nav-sheet > a:last-of-type {
        border-bottom: none;
    }

    .vip-mobile-auth,
    body.page-home .mobile-auth {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.65rem;
        padding-top: 0.9rem;
        margin-top: 0.25rem;
        border-top: 1px solid #eef2f7;
    }

    .vip-mobile-auth a,
    body.page-home .mobile-auth a {
        flex: 1 1 calc(50% - 0.35rem);
        min-width: 0;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.5rem 1rem !important;
        min-height: 44px;
        border-radius: 10px !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        border-bottom: none !important;
        box-sizing: border-box;
        font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    }

    .vip-mobile-auth .vip-btn-login,
    body.page-home .mobile-auth .btn-login {
        border: 1.5px solid #d1d5db !important;
        color: #374151 !important;
        background: #fff !important;
        font-weight: 600 !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .vip-mobile-auth .vip-btn-register,
    body.page-home .mobile-auth .btn-register {
        background: #1758ca !important;
        color: #fff !important;
        border: none !important;
        font-weight: 700 !important;
        box-shadow: 0 2px 8px rgba(26, 74, 159, 0.2);
    }

    .vip-mobile-auth .vip-btn-login i,
    .vip-mobile-auth .vip-btn-login svg,
    body.page-home .mobile-auth .btn-login i,
    body.page-home .mobile-auth .btn-login svg {
        color: #374151 !important;
        fill: currentColor;
    }

    .vip-mobile-auth .vip-btn-register i,
    .vip-mobile-auth .vip-btn-register svg,
    body.page-home .mobile-auth .btn-register i,
    body.page-home .mobile-auth .btn-register svg {
        color: #fff !important;
        fill: currentColor;
    }

    .vip-navbar {
        min-height: 52px;
        height: auto;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
    }

    .page-hero,
    .page-hero-sm {
        padding: 2rem 0 1.25rem !important;
    }

    .page-hero-sm h1,
    .page-hero-content h1 {
        font-size: 1.6rem !important;
    }

    .py-6 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .table-responsive,
    .tbl-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* FAB — original positions (no bottom bar offset) */
    .fab-float,
    .float-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .fab-phone,
    .ph-float {
        bottom: 1.25rem;
    }

    .fab-whatsapp,
    .wa-float {
        bottom: 5rem;
    }

    /* ── Booking: search + vehicle selection ── */
    .bk-page {
        padding: 1rem 0 2rem;
    }

    .bk-container {
        padding: 0 1rem;
    }

    .bk-search-card {
        padding: 1.15rem;
    }

    .bk-search-title {
        font-size: 1.2rem;
        line-height: 1.3;
    }

    .bk-search-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .bk-sf-grp {
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .bk-search-btn {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1rem;
    }

    .bk-return-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .return-date-group.visible {
        width: 100%;
        flex-wrap: wrap;
    }

    .return-date-group .bk-sf-inp,
    .return-date-group input {
        flex: 1;
        min-width: 0;
    }

    .bk-results-layout {
        flex-direction: column;
        gap: 1.25rem;
    }

    .bk-summary-col {
        width: 100%;
        position: static;
        order: 0;
    }

    .bk-sum-card {
        position: sticky;
        top: 4.5rem;
        z-index: 50;
    }

    .veh-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1rem;
    }

    .veh-card-img {
        width: 100%;
        max-width: none;
        height: 110px;
    }

    .veh-card-price-col {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .vcp-price {
        font-size: 1.35rem;
    }

    .btn-select-veh {
        min-width: 120px;
    }

    .btn-proceed {
        position: sticky;
        bottom: 0.75rem;
        z-index: 60;
        box-shadow: 0 4px 20px rgba(26, 74, 159, 0.35);
    }

    .airport-chips {
        gap: 0.5rem;
    }

    .airport-chip {
        font-size: 0.82rem;
        padding: 0.5rem 0.9rem;
    }

    /* ── Booking confirmation ── */
    .confirmation-hero {
        padding: 2.5rem 0 1.75rem !important;
    }

    .confirmation-hero h1 {
        font-size: 1.65rem !important;
    }

    .confirmation-hero .lead {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    .icon-circle {
        width: 72px;
        height: 72px;
        font-size: 1.75rem;
    }

    .booking-ref-badge {
        font-size: 0.88rem;
        padding: 0.55rem 1rem;
        max-width: 100%;
        word-break: break-word;
    }

    .confirmation-details .row {
        flex-direction: column;
    }

    .detail-card {
        padding: 1.15rem;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .detail-label {
        min-width: 0;
    }

    .detail-value {
        text-align: left;
        width: 100%;
        word-break: break-word;
    }

    .price-summary-card,
    .next-steps-card {
        margin-top: 0;
    }

    .confirmation-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .important-info .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* ── Customer dashboard ── */
    .dash-panel-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 199;
    }

    .dash-panel-sidebar-backdrop.is-visible {
        display: block;
    }

    #menuBtn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }

    .sidebar {
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    }

    .dash-main {
        margin-left: 0 !important;
        width: 100%;
    }

    .topbar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .topbar-user span:not(.user-avatar) {
        display: none;
    }

    .content {
        padding: 1rem !important;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.9rem;
    }

    .stat-val {
        font-size: 1.35rem;
    }

    .tbl-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    /* Profile section: stack forms */
    .dash-profile-row > [class*='col-'] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .dash-profile-row .tbl-card {
        margin-bottom: 1rem;
    }

    .dash-profile-row .form-inp,
    .dash-profile-row button[type='submit'] {
        width: 100%;
    }

    /* Chat widget */
    .dash-chat-fab {
        bottom: 1.25rem !important;
        right: 1rem !important;
    }

    .dash-chat-panel {
        width: calc(100vw - 1.5rem) !important;
        right: 0.75rem !important;
        max-height: 70vh;
    }

    /* Boss panel: detailed rules live in boss-panel.php (mobile-only) */
    .bp-wrap {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .ride-item .btn-bp,
    .ride-item form {
        width: 100%;
    }

    .ride-item .btn-bp {
        justify-content: center;
    }

    .bp-modal-box {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ── Homepage (index.php) ── */
@media (max-width: 1023px) {
    .hero-top-bar {
        padding: 0.5rem 0.75rem 0.65rem;
    }

    .hero-logo-center {
        gap: 0.5rem;
        max-width: 100%;
    }

    .hero-logo-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .hero-logo-name {
        font-size: clamp(0.72rem, 3.2vw, 0.95rem);
        white-space: nowrap;
        line-height: 1.15;
    }

    .hero-logo-sub {
        font-size: 0.55rem;
        white-space: nowrap;
        letter-spacing: 0.06em;
    }

    .hero-bg::before,
    .hero-bg::after {
        height: clamp(280px, 42vh, 400px);
    }

    .hero-card {
        border-radius: 16px;
        margin: 0 0.35rem 0;
    }

    .hero-bg + .section {
        padding-top: 5rem;
    }

    @media (max-width: 640px) {
        .hero-bg + .section {
            padding-top: 3rem;
        }
    }

    .fleet-img-wrap {
        height: 200px;
        padding: 0;
    }

    .fleet-img-wrap img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .hero-trust-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .hero-trust-row {
        padding: 0.85rem 1rem 1.15rem;
    }

    .hero-stats-zone {
        padding: 1rem 1rem 1.25rem;
    }

    .hero-left {
        padding: 1.35rem 1rem;
    }

    .hero-headline {
        font-size: 1.5rem;
    }

    .hero-right {
        min-height: 180px;
        max-height: 240px;
    }

    .booking-tab {
        font-size: 0.78rem;
        padding: 0.75rem 0.35rem;
        gap: 0.35rem;
    }

    .dest-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .fleet-grid {
        grid-template-columns: 1fr;
    }

    .why-item {
        flex: 0 0 calc(50% - 0.5rem);
    }

    /* Index footer uses .footer-grid — keep 2-col from index.php @media, do not force 1 col */
    .site-footer .footer-inner {
        padding: 0 1rem;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    .site-footer .footer-brand {
        grid-column: 1 / -1;
    }

    .site-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .dest-grid {
        grid-template-columns: 1fr;
    }

    .why-item {
        flex: 0 0 100%;
    }

    .hero-headline {
        font-size: 1.35rem;
    }

    .hero-trust-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .vip-logo-brand {
        font-size: 0.85rem;
    }

    .airport-chip {
        width: 100%;
        justify-content: center;
    }

    .booking-tab {
        font-size: 0.72rem;
        padding: 0.7rem 0.25rem;
    }

}

/* Auth pages */
@media (max-width: 1023px) {
    body.auth-page {
        padding: 1rem;
    }

    .auth-container {
        max-width: 100%;
        border-radius: 16px;
    }

    .auth-body {
        padding: 1.35rem 1.15rem 1.5rem;
    }
}
