html,
body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box !important;
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Base Toggle Logic */
/* Hide Toggle on Desktop */
@media (min-width: 1025px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* ==========================================
   MOBILE MENU & RESPONSIVENESS (<= 1024px)
   ========================================== */

/* TABLET LANDSCAPE / SMALL DESKTOP (<= 1024px) */
@media (max-width: 1024px) {
    :root {
        --fs-5xl: 2.5rem;
        /* Scale down big headings */
        --fs-3xl: 2rem;
        --space-4xl: 4rem;
        /* Reduce huge spacing */
    }

    .container {
        padding: 0 var(--space-lg);
    }

    /* Collapse 4-column grids to 3 */
    .domestic-tours-grid,
    .destinations-grid,
    .taxi-services-pills {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-md);
    }

    /* Collapse 3-column grids to 2 */
    .intl-tours-grid,
    .features-grid,
    .day-tours-slider {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    /* Adjust specific layouts */

    .taxi-card {
        padding: var(--space-xl);
    }
}

/* TABLET & MOBILE (<= 1024px) */
@media (max-width: 1024px) {

    /* Header & Top Bar Adjustments */
    .top-bar {
        padding: 5px 0;
        width: 100%;
        overflow: hidden;
        position: relative;
        z-index: 1210;
        /* Ensure it stays above everything */
    }

    .top-bar .container {
        padding: 0 15px !important;
        width: 100% !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        overflow: visible !important;
        /* Allow icons to breathe */
    }

    .top-bar-left {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
    }

    .top-bar-right {
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
        gap: 12px !important;
        flex-shrink: 0;
    }

    .top-social-icon {
        width: 32px !important;
        height: 32px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #fff !important;
        font-size: 0.9rem !important;
        opacity: 1 !important;
        visibility: visible !important;
        text-decoration: none !important;
        line-height: 0 !important;
        /* Prevents text-based vertical shifts */
    }

    .top-social-icon i {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    .header .container {
        padding: 0 15px;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        min-height: 70px;
    }

    /* Logo Scaling */
    .logo-wrapper {
        gap: 8px;
    }

    .logo-img-header {
        height: 50px !important;
        width: auto !important;
        /* Professional size for tablets */
    }

    /* Hero Section Mobile Optimization */
    .hero-slider {
        min-height: 350px !important;
        height: 60vh !important;
        max-height: 700px;
        width: 100% !important;
        margin-top: 0 !important;
        overflow: hidden;
    }

    .slider-container,
    .slide {
        width: 100% !important;
        height: 100% !important;
    }

    .slide {
        background-position: left center !important;
        /* Prioritize the side with text (e.g., DUBAI) */
        background-size: cover !important;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
    }

    .logo-icon i {
        font-size: 1.1rem;
    }

    .logo-title {
        font-size: 1.1rem !important;
    }

    .logo-subtitle {
        font-size: 0.55rem !important;
        letter-spacing: 1px;
    }

    /* Mobile Toggle Button Visibility */
    .mobile-menu-toggle {
        display: flex !important;
        /* Force visibility */
        z-index: 1205;
        /* Above Side Drawer (1200) */
        position: relative;
        flex-direction: column;
        justify-content: space-around;
        /* Better spacing for bars */
        width: 28px;
        height: 20px;
        cursor: pointer;
        padding: 0;
        margin: 0 0 0 auto;
        /* Push to far right */
    }

    .mobile-menu-toggle span {
        display: block;
        background-color: #3b82f6 !important;
        /* Matches the blue in the logo/screenshot */
        height: 2px;
        width: 100%;
        border-radius: 1px;
        transition: all 0.3s ease-in-out;
    }

    /* IMPORTANT: Turn WHITE when active (against Dark Drawer) */
    .mobile-menu-toggle.active span {
        background-color: #ffffff !important;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Navigation Menu (Side Drawer) */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden by default */
        width: 280px;
        height: 100vh;
        background: #1a252f;
        /* Dark Background for white text */
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 30px;
        transition: right 0.3s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 1200;
        /* Above overlay */
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        gap: 0;
        margin-left: 0;
        pointer-events: auto;
        /* Ensure clickable */
    }

    .main-nav.active {
        right: 0;
        /* Slide in */
    }

    /* Use Overlay (handled by JS, but ensure z-index is correct) */
    .menu-overlay {
        z-index: 900;
        /* Lower than header */
        cursor: pointer;
    }

    /* Header Container Stacking Context */
    .header {
        z-index: 1000;
        position: sticky;
        top: 0;
    }

    /* Navigation Items */
    .nav-item {
        width: 100%;
        margin: 0;
        opacity: 0;
        transform: translateX(20px);
        transition: 0.3s ease;
    }

    /* Staggered Animation for items */
    .main-nav.active .nav-item {
        opacity: 1;
        transform: translateX(0);
    }

    .main-nav.active .nav-item:nth-child(1) {
        transition-delay: 0.1s;
    }

    .main-nav.active .nav-item:nth-child(2) {
        transition-delay: 0.2s;
    }

    .main-nav.active .nav-item:nth-child(3) {
        transition-delay: 0.3s;
    }

    .main-nav.active .nav-item:nth-child(4) {
        transition-delay: 0.4s;
    }

    .main-nav.active .nav-item:nth-child(5) {
        transition-delay: 0.5s;
    }

    .main-nav.active .nav-item:nth-child(6) {
        transition-delay: 0.6s;
    }

    .main-nav.active .nav-item:nth-child(7) {
        transition-delay: 0.7s;
    }

    .main-nav.active .nav-item:nth-child(8) {
        transition-delay: 0.8s;
    }

    /* Links Styling */
    .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        display: flex;
        /* Ensure flex for space-between */
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-family: var(--font-primary);
        /* Keep consistent */
        font-size: 1rem;
        font-weight: 500;
        width: 100%;
        pointer-events: auto;
        /* Force clickability */
        position: relative;
        z-index: 5;
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--primary-color) !important;
        padding-left: 5px;
        /* Slight movement */
    }

    .nav-link::after {
        display: none;
        /* remove desktop underline */
    }

    .nav-link i {
        font-size: 0.8rem;
        transition: transform 0.3s ease;
    }

    /* CTA Button in Menu */
    .nav-btn {
        margin-top: 25px;
        width: 100%;
        display: flex;
        justify-content: center;
        background: var(--primary-color) !important;
        border: none;
        color: #fff !important;
        border-radius: 4px;
        padding: 12px !important;
    }

    /* Active Submenu Indicator */
    .nav-item.active>.nav-link {
        color: var(--primary-color) !important;
        border-bottom-color: rgba(240, 124, 0, 0.3);
    }

    /* Toggle Icon Animation */
    .nav-item.active>.nav-link i {
        transform: rotate(45deg);
        /* Rotate + to x */
    }

    /* Dropdown Menus (Accordion Style) */
    .dropdown-menu {
        position: static !important;
        /* Force static for accordion flow */
        width: 100% !important;
        background: transparent !important;
        /* Seamless blend with sidebar */
        box-shadow: none !important;
        padding: 0 !important;
        border: none !important;
        display: none;
        /* Hidden by default */
        float: none !important;
        margin-top: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    /* Force display block when active */
    .nav-item.has-dropdown.active .dropdown-menu {
        display: block !important;
    }

    .dropdown-menu li {
        width: 100%;
        background: transparent !important;
    }

    .dropdown-menu li a {
        padding: 12px 20px 12px 40px !important;
        /* Indented */
        color: rgba(255, 255, 255, 0.8) !important;
        background: transparent !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        font-family: 'Poppins', sans-serif !important;
        font-size: 0.95rem !important;
        display: block !important;
        text-decoration: none !important;
        text-transform: capitalize !important;
        pointer-events: auto !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .dropdown-menu li a:hover {
        background: rgba(255, 255, 255, 0.05) !important;
        color: var(--primary-color) !important;
        padding-left: 45px !important;
    }
}


/* Ensure Floating Buttons are visible on mobile */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }
}

/* Remove conflicting old mobile sidebar block */

/* TABLET & MOBILE GRID SYSTEMS */

/* TABLET (<= 1024px) - Additional Grid Fixes */
@media (max-width: 1024px) {

    /* Grids to 2 Columns at this breakpoint if not already */
    .domestic-tours-grid,
    .destinations-grid,
    .taxi-services-pills {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stack complex sections */
    .taxi-card,
    .booking-content-grid,
    .container-with-sidebar {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .taxi-image {
        height: 250px;
        /* Limit height when stacked */
    }

    /* Scrollable Tabs for Taxi Section */
    .taxi-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .taxi-tab {
        flex: 0 0 auto;
    }
}

/* MOBILE LARGE (<= 768px) */
@media (max-width: 768px) {
    :root {
        --fs-5xl: 2rem;
        --space-3xl: 2rem;
    }

    .top-bar {
        display: none !important;
    }

    .header {
        padding: 0 !important;
    }

    .header .container {
        min-height: 95px !important;
        height: 95px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        position: relative !important;
        padding: 0 15px !important;
        overflow: visible !important;
    }

    .logo-img-header {
        height: 115px !important;
        width: auto !important;
        /* Maximized logo size for bold mobile presence */
    }

    .mobile-menu-toggle {
        position: absolute !important;
        right: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        z-index: 1100 !important;
    }


    .section-title {
        font-size: 2rem;
    }

    /* Prevent any horizontal overflow from grids */
    .intl-tours-grid,
    .features-grid,
    .day-tours-slider,
    .services-grid,
    .domestic-tours-grid,
    .destinations-grid,
    .taxi-services-pills {
        grid-template-columns: 1fr;
        width: 100% !important;
        overflow: hidden;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Fixed Hero Viewport Height for Mobile */
    .hero-slider {
        height: 50vh !important;
        min-height: 250px !important;
        max-height: 450px !important;
        width: 100% !important;
        overflow: hidden;
    }

    .slide {
        background-size: cover !important;
        background-position: center center !important;
    }

    .hero-slider .slide-content {
        padding: 10px !important;
    }

    /* Agency Intro Refinements */
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .intro-content {
        align-items: center;
        text-align: center;
        padding-top: 10px;
    }

    .intro-heading {
        font-size: 1.8rem !important;
        margin-bottom: 10px !important;
    }

    .intro-brand {
        font-size: 1.5rem !important;
    }
}

/* MOBILE SMALL (<= 576px) */
@media (max-width: 576px) {
    .hero-slider {
        height: 45vh !important;
    }

    .travel-banner {
        height: 250px;
    }

    .tour-rect-card {
        max-width: 100%;
    }

    .domestic-title {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 2.4rem !important;
        color: #F07C00 !important;
        margin-bottom: 25px !important;
        text-transform: none !important;
        font-weight: 400 !important;
    }
}

/* EXTRA SMALL MOBILE (<= 480px) */
@media (max-width: 480px) {
    /* Header already handled in 768px block */

    /* Hero Section Fixes for Banners with Text */
    .hero-slider {
        height: auto !important;
        aspect-ratio: 16/9 !important;
        min-height: 200px !important;
        width: 100% !important;
    }

    .slide {
        background-position: center left !important;
        background-size: 100% 100% !important;
        /* Force fit for banners if cover crops text */
    }

    /* Slider Controls */
    .slider-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
        background: rgba(0, 0, 0, 0.3) !important;
    }

    .prev-btn {
        left: 4px !important;
    }

    .next-btn {
        right: 4px !important;
    }

    .slider-dots {
        bottom: 8px !important;
        gap: 6px !important;
    }

    .dot {
        width: 7px !important;
        height: 7px !important;
    }

    /* Agency Intro Typography Fixes */
    .intro-heading {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 2.5rem !important;
        color: #2c3e50 !important;
        margin-bottom: 0 !important;
        text-transform: none !important;
        font-weight: 400 !important;
        text-align: center !important;
    }

    .intro-subheading {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 1.8rem !important;
        color: #F07C00 !important;
        margin-bottom: 0 !important;
        text-transform: none !important;
        text-align: center !important;
    }

    .intro-brand {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 2.2rem !important;
        color: #F07C00 !important;
        margin-bottom: 15px !important;
        text-transform: none !important;
        font-weight: 400 !important;
        text-align: center !important;
    }

    /* Agency Intro - Perfect Symmetrical Overlap */
    .intro-grid {
        padding: 0 !important;
    }

    .intro-images-container {
        height: 360px !important;
        width: 100% !important;
        max-width: 310px !important;
        margin: 0 auto 35px !important;
        display: block !important;
        position: relative !important;
    }

    .intro-img-wrapper {
        width: 175px !important;
        height: 240px !important;
        position: absolute !important;
        border-radius: 4px !important;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
    }

    .intro-img-1 {
        top: 0 !important;
        left: 0 !important;
        z-index: 5 !important;
    }

    .intro-img-2 {
        bottom: 0 !important;
        right: 0 !important;
        z-index: 20 !important;
    }

    .intro-outline-box {
        width: 175px !important;
        height: 240px !important;
        top: 50px !important;
        left: 60px !important;
        z-index: 10 !important;
        display: block !important;
        border: 2px solid #F07C00 !important;
        position: absolute !important;
    }

    .intro-heading {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 2.4rem !important;
        color: #2c3e50 !important;
        margin-bottom: 10px !important;
        text-transform: none !important;
        font-weight: 400 !important;
        text-align: center !important;
    }

    .intro-subheading {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 1.8rem !important;
        color: #F07C00 !important;
        margin-bottom: 0 !important;
        text-transform: none !important;
        text-align: center !important;
    }

    .intro-brand {
        font-family: 'Kaushan Script', cursive !important;
        font-size: 2.2rem !important;
        color: #F07C00 !important;
        margin-bottom: 20px !important;
        text-transform: none !important;
        font-weight: 400 !important;
        text-align: center !important;
    }
}

@media (max-width: 375px) {
    .intro-images-container {
        height: 320px !important;
        max-width: 280px !important;
    }

    .intro-img-wrapper,
    .intro-outline-box {
        width: 155px !important;
        height: 210px !important;
    }

    .intro-outline-box {
        top: 45px !important;
        left: 55px !important;
    }
}