/* 
===============================================
Responsive CSS for Tablet and Mobile Optimization
===============================================
*/

/* --- Global Fixes --- */
body, html {
    overflow-x: hidden !important; /* Prevent horizontal scrolling entirely */
    max-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.floating-whatsapp {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 99999 !important; /* Always on top */
}
html[lang="en"] .floating-whatsapp {
    left: 20px !important;
    right: auto !important;
}

/* =======================================================
   Breakpoints
   ======================================================= */

/* --- 1200px - Small Desktop / Large Tablets --- */
@media (max-width: 1200px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .hero-booking-panel {
        width: 95%;
    }
    .dest-grid, .offers-grid, .hajj-umrah-grid {
        gap: 20px;
    }
}

/* --- 992px - Tablets --- */
@media (max-width: 992px) {
    /* Top Bar */
    .top-bar-info {
        font-size: 12px;
        gap: 15px;
    }
    .top-bar-actions {
        gap: 10px;
    }

    /* Navigation */
    .mobile-menu-btn {
        display: block !important;
    }
    
    .nav-links {
        display: flex !important;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        align-items: center;
        gap: 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        padding: 0;
        transition: max-height 0.4s ease, opacity 0.4s ease;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        z-index: 1000;
    }
    
    .nav-links.active {
        max-height: 500px;
        opacity: 1;
        padding: 20px 0;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: 15px 0;
        color: var(--primary-color) !important;
    }
    
    .navbar.scrolled .nav-links a {
        color: var(--primary-color) !important;
    }

    /* Hero Section */
    .cinematic-title {
        font-size: 3rem;
        line-height: 1.2;
    }
    .cinematic-subtitle {
        font-size: 1.1rem;
    }
    .hero-cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin: 0 auto 30px auto;
    }
    .btn-large {
        width: 100%;
        margin-bottom: 15px;
    }

    /* Search Booking Grid */
    .booking-inputs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* --- 768px - Large Mobile --- */
@media (max-width: 768px) {
    /* 1. Top Bar Mobile Fixes */
    .top-bar-container {
        flex-direction: row !important; /* Keep items in a single row */
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 0 !important;
    }
    .top-bar-info {
        display: none !important; /* Hidden to save space */
    }
    .top-bar-actions {
        width: 100% !important;
        justify-content: space-between !important; /* Social left, Lang right */
    }

    /* 2. Navbar & Logo Fixes */
    .navbar {
        position: relative !important; /* Sits naturally under top-bar, no overlap! */
        top: 0 !important;
        background: #fff !important; /* Solid white background makes logo colors fully visible */
        padding: 15px 0 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    .navbar.scrolled {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
    }
    .nav-container {
        position: relative !important;
        min-height: 85px !important; /* Gives room so a larger logo doesn't touch edges */
    }
    .navbar .logo {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        z-index: 10;
        display: block !important;
    }
    .brand-logo {
        max-height: 85px !important; /* Increased size as requested */
        width: auto !important;
        display: block !important;
    }
    .mobile-menu-btn {
        color: var(--primary-blue) !important; /* Menu icon must be blue against white background */
    }

    /* 3. Hero Section Cut-off & Spacing Fixes */
    .cinematic-hero {
        align-items: flex-start !important;
        padding-top: 40px !important; /* Internal spacing, no longer needs to compensate for fixed header */
        height: auto !important;
        min-height: calc(100vh - 120px) !important;
        padding-bottom: 60px !important;
    }
    .hero-content {
        margin-top: 0 !important; /* Remove desktop margin */
    }
    .cinematic-title {
        font-size: 2.2rem !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }

    /* Booking Grid */
    .booking-inputs-grid {
        grid-template-columns: 1fr;
    }
    .hero-booking-panel {
        flex-direction: column;
        padding: 20px;
    }
    .booking-action {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
    }
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    .search-item {
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        margin-bottom: 15px;
    }
    .search-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    /* Grids to Single Column */
    .dest-grid {
        grid-template-columns: 1fr;
    }
    .hajj-umrah-grid {
        grid-template-columns: 1fr;
    }
    .offers-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .social-links {
        justify-content: center;
    }

    /* Testimonials */
    .reviews-slider {
        display: flex;
        flex-direction: column;
        gap: 20px;
        overflow-x: hidden;
    }
    .review-card {
        width: 100%;
        margin: 0;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* --- 576px / 480px / 390px - Small Mobile --- */
@media (max-width: 576px) {
    .cinematic-title {
        font-size: 1.8rem !important;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .partners-logos-container {
        flex-direction: column;
        gap: 20px;
    }
    .partner-logo {
        height: 50px; /* Make logos fit well vertically */
    }

    .final-cta h2 {
        font-size: 2rem;
    }
    .final-cta .cta-buttons {
        flex-direction: column;
    }
    .final-cta .btn {
        width: 100%;
    }
}

/* Additional fixes for very small devices */
@media (max-width: 375px) {
    .cinematic-title {
        font-size: 1.6rem !important;
    }
    .cinematic-subtitle {
        font-size: 0.95rem !important;
    }
    .btn-large {
        padding: 12px 20px;
    }
}

@media (max-width: 360px) {
    .cinematic-title { font-size: 1.4rem !important; }
    .cinematic-subtitle { font-size: 0.85rem !important; margin-bottom: 15px !important; }
    .section-header h2 { font-size: 1.6rem !important; }
    .btn-large { font-size: 0.9rem !important; padding: 10px 15px !important; }
    .floating-whatsapp { width: 45px !important; height: 45px !important; font-size: 1.8rem !important; }
}
