/* Mobile ONLY App-like Redesign */

/* Ensure Bottom Nav is completely hidden on desktop */
@media (min-width: 992px) {
    .vk-mobile-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 991px) {

    /* Base Mobile Setup */
    html,
    body {
        overflow-x: hidden !important;
    }

    body {
        padding-bottom: 70px !important;
        /* Space for bottom nav */
        -webkit-tap-highlight-color: transparent;
        scroll-behavior: smooth;
        width: 100vw;
        max-width: 100vw;
    }

    /* Sticky Mobile Header with Frosted Glass */
    .upper-head {
        display: none !important;
        /* Hide topbar on mobile */
    }

    header,
    .navigation {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background: transparent !important;
        transition: all 0.3s ease;
    }

    .navigation::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.42);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: -1;
        transition: all 0.3s ease;
    }

    .navigation.scrolled::before {
        background: rgba(0, 0, 0, 0.55);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .vk-dark .navigation::before {
        background: rgba(10, 10, 10, 0.55);
    }

    .vk-dark .navigation.scrolled::before {
        background: rgba(10, 10, 10, 0.75);
    }

    .navbar {
        min-height: 65px;
        border: none !important;
        margin-bottom: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 18px !important;
    }

    .navbar .logo {
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    .navbar .logo img {
        max-height: 42px !important;
        width: auto !important;
        filter: brightness(0) invert(1) !important;
        /* Make white logo */
        transition: transform 0.2s ease;
    }

    .vk-hamburger {
        float: none !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px !important;
        height: 44px !important;
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 50% !important;
        gap: 5px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
        transition: all 0.3s ease !important;
    }

    .vk-hamburger span {
        display: block !important;
        width: 20px !important;
        height: 2px !important;
        background: #ffffff !important;
        /* White icon */
        border-radius: 2px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        margin: 0 !important;
    }

    .vk-hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg) !important;
    }

    .vk-hamburger.active span:nth-child(2) {
        opacity: 0 !important;
    }

    .vk-hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg) !important;
    }

    /* Mobile Drawer Styling */
    #navbar.navbar-nav-wrapper {
        background: rgba(13, 27, 42, 0.8) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5) !important;
        border-top-left-radius: 24px !important;
        border-bottom-left-radius: 24px !important;
    }

    .nav.navbar-nav>li>a {
        color: #ffffff !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
    }

    .nav.navbar-nav li ul li a {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    /* Dark Mode overrides */
    .vk-dark .navbar .logo img {
        filter: brightness(0) invert(1) !important;
    }

    .vk-dark .vk-hamburger {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .vk-dark .vk-hamburger span {
        background: #ffffff !important;
    }

    /* Sticky Bottom Nav Bar */
    .vk-mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.06);
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }

    .vk-dark .vk-mobile-bottom-nav {
        background: rgba(28, 28, 30, 0.92);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    }

    /* Hide bottom nav on pages that have their own booking bar */
    body:has(.vk-cd-mob-bar) .vk-mobile-bottom-nav,
    body:has(.vk-bd-mob-bar) .vk-mobile-bottom-nav,
    body:has(.pb-mob-bar) .vk-mobile-bottom-nav,
    body:has(.vkbs-mob-bar) .vk-mobile-bottom-nav,
    body:has(.vk-inc-mob-bar) .vk-mobile-bottom-nav {
        display: none !important;
    }

    /* Remove extra bottom padding on pages with booking bar (no bottom nav present) */
    body:has(.vk-cd-mob-bar),
    body:has(.vk-bd-mob-bar),
    body:has(.pb-mob-bar),
    body:has(.vkbs-mob-bar),
    body:has(.vk-inc-mob-bar) {
        padding-bottom: 0 !important;
    }

    .vk-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #990000;
        text-decoration: none !important;
        font-size: 10px;
        font-weight: 600;
        flex: 1;
        height: 100%;
        transition: all 0.3s ease;
        font-family: 'Plus Jakarta Sans', sans-serif;
    }

    .vk-dark .vk-mobile-nav-item {
        color: #98989d;
    }

    .vk-mobile-nav-item i {
        font-size: 22px;
        margin-bottom: 4px;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .vk-mobile-nav-item.active {
        color: #d11243;
        /* App Brand color */
    }

    .vk-dark .vk-mobile-nav-item.active {
        color: #ff3b30;
    }

    .vk-mobile-nav-item.active i {
        transform: translateY(-2px) scale(1.15);
    }

    /* App-like Hero Section */
    #vk-hero {
        padding-top: 85px !important;
    }

    .vk-hero-overlay {
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%) !important;
    }

    .vk-hero-title {
        font-size: 2.4rem !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
    }

    .vk-hero-cta-group {
        flex-direction: column;
        gap: 14px;
        width: 100%;
    }

    .vk-hero-cta-gold,
    .vk-hero-cta-outline {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 16px 20px !important;
        border-radius: 14px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
    }

    .vk-hero-trust-row {
        flex-wrap: wrap;
        gap: 8px !important;
        justify-content: center;
    }

    .vk-hero-trust-pill {
        font-size: 11px !important;
        padding: 6px 12px !important;
    }

    .vk-exp-scroll-wrap {
        width: calc(100% + 30px) !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        border-radius: 15px !important;
        overflow: hidden !important;
    }

    /* Horizontal Scrolling for Card Tracks (Thumb Friendly) */
    .vk-explore-track,
    .vk-pkg-track,
    .vk-exp-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px !important;
        padding: 10px 20px 24px 20px !important;
        scrollbar-width: none;
        width: 100% !important;
    }

    .vk-explore-track::-webkit-scrollbar,
    .vk-pkg-track::-webkit-scrollbar,
    .vk-exp-track::-webkit-scrollbar {
        display: none;
    }

    .vk-explore-card,
    .vk-pkg-card,
    .vk-exp-card {
        scroll-snap-align: center;
        flex: 0 0 82% !important;
        max-width: 85vw !important;
    }

    /* Destination Circles: 4 items per row (2 lines) */
    .vk-dest-track {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px 10px !important;
        padding: 10px 5px !important;
    }

    .vk-dest-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100% !important;
    }

    /* Card Refinements */
    .vk-explore-card,
    .vk-pkg-card,
    .vk-exp-card {
        border-radius: 18px !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden;
        border: 1px solid rgba(0, 0, 0, 0.03);
    }

    .vk-dark .vk-explore-card,
    .vk-dark .vk-pkg-card,
    .vk-dark .vk-exp-card {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
        background-color: #242426;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Hide arrows on mobile since we have swipe */
    .vk-explore-arrows,
    .vk-exp-nav {
        display: none !important;
    }

    .vk-explore-header,
    .vk-pkg-header,
    .vk-exp-header,
    .vk-attr-header {
        padding: 0 5px;
    }

    .vk-pkg-title-main,
    .vk-exp-title {
        font-size: 1.4rem !important;
    }

    /* Section padding */
    section {
        padding: 35px 15px !important;
    }

    #vk-dest-section {
        padding: 20px 15px 10px 15px !important;
    }

    /* Top Attractions Grid for Mobile */
    .vk-attr-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .vk-attr-card {
        border-radius: 16px !important;
    }

    .vk-attr-featured {
        grid-column: 1 / -1;
    }

    /* Improve modal/drawer overlay */
    .vk-nav-overlay {
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    /* Offer section tweaks */
    .vk-offer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .vk-offer-card {
        border-radius: 16px !important;
    }

    /* Footer tweaks */
    .vk-footer {
        padding-bottom: 0px !important;
        /* ensure footer doesn't get hidden */
    }

    .vk-footer-col {
        margin-bottom: 30px;
    }

    /* Make footer links 2-column grid on mobile */
    .vk-footer .row .vk-footer-col:not(:first-child) {
        width: 50% !important;
        float: left !important;
        clear: none !important;
        padding-right: 5px !important;
    }
    /* Ensure clear left for the next row of 2 columns */
    .vk-footer .row .vk-footer-col:nth-child(4) {
        clear: left !important;
    }

    /* Footer policy single line on mobile */
    .vk-footer-policy {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        padding-bottom: 5px;
    }
    .vk-footer-policy::-webkit-scrollbar {
        display: none; /* Safari/Chrome */
    }
    .vk-footer-policy a {
        font-size: 10px !important;
        padding: 0 3px !important;
        white-space: nowrap !important;
        border-right: none !important;
    }
    .vk-footer-policy a:not(:last-child)::after {
        content: "·";
        color: #ffffff;
        margin-left: 6px;
        font-weight: bold;
        font-size: 12px;
    }

    .hide-on-mobile {
        display: none !important;
    }
    .show-on-mobile {
        display: inline !important;
    }

    /* Make vk-cab-section full width with border radius */
    #vk-cab-section {
        border-radius: 15px !important;
        background: #f8f9fa !important;
        overflow: hidden;
    }

    .vk-dark #vk-cab-section {
        background: #1c1c1e !important;
    }

    /* Show Cab images full size (uncropped) on mobile */
    #vk-cab-section .vk-pkg-img-wrap {
        background: transparent !important;
        aspect-ratio: auto !important;
        padding-top: 66%;
        /* ~16:9 ratio */
        border-radius: 15px 15px 0 0 !important;
    }

    #vk-cab-section .vk-pkg-img-wrap img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain !important;
    }

    /* Make Cab cards full width inside track */
    #vk-cab-section .vk-pkg-card {
        flex: 0 0 92% !important;
        max-width: 92% !important;
        border-radius: 15px !important;
    }

    /* Hide duration and description on mobile for Cab section */
    #vk-cab-section .vk-pkg-duration,
    #vk-cab-section .vk-pkg-desc {
        display: none !important;
    }
}