/* ===== Responsive Styles ===== */

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 3.5rem; }
    .hero h1 span { font-size: 4rem; }
    .package-detail-grid { grid-template-columns: 1fr; }
    .planner-container { grid-template-columns: 1fr; }
    .planner-sidebar { position: static; }
    .about-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    
    /* Nav adjustments */
    .nav-icon { display: none; }
    .nav-links > li > a { padding: 10px 12px; font-size: 0.85rem; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 35px; }
    .footer-brand { grid-column: 1 / -1; padding-right: 0; }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    .section { padding: 50px 0; }

    /* Top bar: hide on mobile */
    .top-bar { display: none; }
    .navbar { top: 0; }
    .nav-spacer { height: 60px; }

    /* ===== Mobile Navbar ===== */
    .nav-container {
        height: 60px;
        position: relative;
    }

    /* Logo: smaller on mobile */
    .nav-logo { gap: 8px; flex-shrink: 1; min-width: 0; }
    .logo-icon { width: 34px; height: 34px; font-size: 0.85rem; flex-shrink: 0; }
    .logo-name { font-size: 1rem; white-space: nowrap; }
    .logo-tagline { display: none; }

    /* Hide CTA button on mobile */
    .nav-cta { display: none; }

    /* Hamburger toggle */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        z-index: 1051;
        position: relative;
    }
    .nav-toggle span {
        width: 22px;
        height: 2px;
        display: block;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    .nav-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Search icon: keep visible in navbar */
    .nav-right {
        margin-left: auto;
        gap: 4px;
        flex-shrink: 0;
    }
    .nav-search { position: static; }
    .search-toggle {
        width: 36px; height: 36px;
        font-size: 0.85rem;
    }
    .search-expanded {
        position: fixed;
        top: 0; left: 0; right: 0;
        width: 100vw;
        max-width: 100vw;
        padding: 10px 12px;
        background: var(--white);
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
        z-index: 1100;
        border-radius: 0;
        transform: none !important;
        box-sizing: border-box;
    }
    .search-expanded .search-form {
        max-width: 100%;
        width: 100%;
        border-width: 1.5px;
        border-radius: 10px;
    }
    .search-expanded .search-form input {
        font-size: 16px; /* prevents iOS zoom on focus */
        padding: 12px 8px;
    }
    .search-results-dropdown {
        position: fixed;
        top: 54px; left: 0; right: 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 55vh;
        border-radius: 0;
        z-index: 1100;
        box-sizing: border-box;
    }

    /* ===== Dark Overlay (inside navbar for correct stacking context) ===== */
    .nav-overlay {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.45);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* ===== Mobile Slide-in Menu ===== */
    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        box-shadow: -4px 0 25px rgba(0,0,0,0.12);
        list-style: none;
        margin: 0;
    }
    .nav-links.active {
        transform: translateX(0);
    }

    /* Menu header spacing — push items below safe area */
    .nav-links::before {
        content: 'MENU';
        display: block;
        padding: 24px 24px 12px;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 2px;
        color: var(--gray-400);
        border-bottom: 1px solid var(--gray-100);
    }

    /* Mobile nav items */
    .nav-links > li {
        border-bottom: 1px solid var(--gray-100);
        list-style: none;
    }
    .nav-links > li > a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 24px;
        font-size: 0.92rem;
        font-weight: 500;
        color: var(--primary-dark);
        border-radius: 0;
        transition: background 0.15s ease;
    }
    .nav-links > li > a:hover,
    .nav-links > li > a:active {
        background: var(--sand-light);
    }
    .nav-icon { display: inline-flex; opacity: 0.6; font-size: 0.85rem; width: 20px; justify-content: center; }
    .nav-links > li > a.active::after { display: none; }
    .nav-links > li > a.active {
        background: var(--sand);
        color: var(--accent-dark);
        border-left: 3px solid var(--accent);
        font-weight: 600;
    }

    /* Mobile dropdown: hidden by default, toggle on tap */
    .nav-dropdown > .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        background: var(--gray-100);
        min-width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
    }
    .nav-dropdown > .dropdown-menu::before { display: none; }
    /* Disable desktop hover — only accordion .open class works on mobile */
    .nav-dropdown:hover > .dropdown-menu,
    .nav-dropdown:focus-within > .dropdown-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        max-height: 0 !important;
    }

    /* When dropdown is open via JS .open class */
    .nav-dropdown.open > .dropdown-menu {
        max-height: 300px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Chevron rotation on open */
    .nav-dropdown > a .fa-chevron-down {
        transition: transform 0.3s ease;
        margin-left: auto;
    }
    .nav-dropdown.open > a .fa-chevron-down {
        transform: rotate(180deg);
    }

    .dropdown-menu a {
        padding: 12px 24px 12px 56px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        font-size: 0.85rem;
        color: var(--gray-600);
        display: flex;
        align-items: center;
    }
    .dropdown-menu a:last-child { border-bottom: none; }
    .dropdown-menu a:hover {
        background: var(--sand-light);
        color: var(--accent-dark);
    }
    .dropdown-menu a i {
        width: 18px; text-align: center; margin-right: 10px;
        color: var(--accent); opacity: 0.7;
    }

    /* Mobile Book Now button */
    .nav-mobile-cta {
        display: block !important;
        list-style: none;
        border: none !important;
        padding: 20px 24px 24px;
    }
    .mobile-book-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px 24px;
        background: var(--accent) !important;
        color: var(--white) !important;
        text-align: center;
        border-radius: var(--radius-md);
        font-weight: 600;
        font-size: 0.95rem;
        transition: background 0.2s ease;
        box-shadow: 0 4px 15px rgba(201,123,75,0.25);
    }
    .mobile-book-btn:hover { background: var(--accent-dark) !important; }

    /* Hero */
    .hero { min-height: 85vh; padding-bottom: 70px; }
    .hero h1 { font-size: 2.8rem; }
    .hero h1 span { font-size: 3.2rem; }
    .hero p { font-size: 0.95rem; }
    .hero-btns { flex-direction: column; }
    .hero-btns .btn { width: 100%; justify-content: center; }
    .hero-btn-book { padding: 14px 30px; font-size: 1rem; }
    .hero-stats { gap: 20px; flex-wrap: wrap; }
    .hero-tags { gap: 8px; }
    .hero-tag { padding: 6px 12px; font-size: 0.78rem; }
    .hero-float { opacity: 0.2; }
    .hero-illustrations { height: 55px; }
    .hero-illust-strip i { font-size: 1.4rem; gap: 30px; }

    /* Grids */
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }

    /* Forms */
    .form-row { grid-template-columns: 1fr; }

    /* Filter */
    .filter-bar { flex-direction: column; align-items: flex-start; }

    /* Stats */
    .stats-row { flex-wrap: wrap; gap: 20px; }

    /* Page header */
    .page-header h1 { font-size: 2rem; }

    /* Package Carousel */
    .package-carousel .swiper-slide img { height: 250px; }

    /* Chatbot */
    .chatbot-modal {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        height: 480px;
    }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-main { padding: 40px 0 30px; }
    .footer-cta-inner { flex-direction: column; text-align: center; }
    .footer-cta-actions { justify-content: center; }
    .footer-bottom-inner { flex-direction: column; text-align: center; }
    .footer-bottom-links { justify-content: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .hero { min-height: 75vh; }
    .hero h1 { font-size: 2.2rem; }
    .hero h1 span { font-size: 2.5rem; }
    .hero-sparkle { display: none; }
    .hero-float { display: none; }
    .hero-flight-path { display: none; }
    .section { padding: 40px 0; }
    .gallery-grid { grid-template-columns: 1fr; }
    .card-img { height: 180px; }
    .booking-section { padding: 25px 15px; }
    .itinerary-item { flex-direction: column; gap: 15px; }
    .footer-social { justify-content: center; }

    /* Even smaller mobile nav */
    .nav-links { width: 260px; }
    .nav-links > li > a { padding: 14px 20px; font-size: 0.9rem; }
    .dropdown-menu a { padding: 12px 20px 12px 48px; }

    /* Chatbot fullscreen on small phones */
    .chatbot-modal {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
}
