/* ==========================================================================
   DHAKA HOLIDAY UK - MASTER MOBILE & TABLET RESPONSIVE STYLESHEET
   Comprehensive Layout Optimization across All Pages & Devices
   Theme: Crimson / Ruby Red & Obsidian Luxury Slate
   ========================================================================== */

/* Universal Responsive Foundation */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative;
}

img, video, iframe, svg {
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   1. Large Tablets & Small Laptops (max-width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 1.5rem;
    }

    .site-header .navbar {
        height: 94px;
    }

    .header-main-logo {
        height: 48px !important;
        max-height: 48px !important;
    }

    .site-header.scrolled .header-main-logo {
        height: 42px !important;
        max-height: 42px !important;
    }

    .header-brand-text {
        font-size: 1.65rem;
    }

    .hero-title {
        font-size: 3.2rem;
    }

    .search-cards-row.flight-row {
        grid-template-columns: 1.25fr auto 1.25fr 1fr 1.2fr;
        gap: 1rem;
    }

    .search-cards-row.flight-row.roundtrip-active {
        grid-template-columns: 1.15fr auto 1.15fr 1fr 1fr 1.15fr;
        gap: 0.85rem;
    }

    .search-cards-row.tours-row,
    .search-cards-row.hotels-row,
    .search-cards-row.visa-row,
    .search-cards-row.cruise-row,
    .search-cards-row.umrah-row {
        gap: 0.85rem;
    }

    .footer-top {
        grid-template-columns: 1.5fr 1fr 1fr 1.2fr 1.1fr;
        gap: 2rem;
    }

    .footer-main-logo {
        height: 60px !important;
    }

    .footer-logo-badge {
        padding: 10px 20px !important;
    }
}

/* --------------------------------------------------------------------------
   2. Tablets & iPad Portrait (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    }

    .site-header .navbar {
        height: 78px !important;
    }

    .site-header.scrolled .navbar {
        height: 70px !important;
    }

    .header-brand-wrap {
        max-width: calc(100% - 62px) !important;
    }

    .header-main-logo {
        height: 42px !important;
        max-height: 42px !important;
    }

    .site-header.scrolled .header-main-logo {
        height: 36px !important;
        max-height: 36px !important;
    }

    .header-brand-text {
        font-size: 1.45rem !important;
    }

    .site-header.scrolled .header-brand-text {
        font-size: 1.32rem !important;
    }

    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: #F8FAFC;
        color: #0F172A;
        border: 1.5px solid #E2E8F0;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-toggle:hover {
        background: #FEE2E2;
        color: #DC2626;
        border-color: rgba(220, 38, 38, 0.35);
    }

    .nav-menu {
        position: fixed;
        top: 78px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 78px);
        background: #FFFFFF;
        flex-direction: column;
        align-items: stretch;
        padding: 2rem 1.75rem;
        gap: 0.5rem;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.open {
        left: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        font-weight: 700;
        width: 100%;
        padding: 0.85rem 1.15rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #1E293B;
        transition: all 0.2s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        background: #FEF2F2;
        color: #DC2626;
        padding-left: 1.4rem;
    }

    .nav-actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    /* Footer Logo on Tablet */
    .footer-logo-badge {
        padding: 9px 18px !important;
        border-radius: 16px !important;
        max-width: 100% !important;
    }

    .footer-main-logo {
        height: 52px !important;
        max-width: 100% !important;
    }

    .hero-title {
        font-size: 2.6rem;
    }

    .search-tabs-nav {
        justify-content: flex-start !important;
    }

    /* 2-Column Search Layout on Tablet */
    .search-cards-row,
    .search-cards-row.flight-row,
    .search-cards-row.flight-row.roundtrip-active,
    .search-cards-row.tours-row,
    .search-cards-row.hotels-row,
    .search-cards-row.visa-row,
    .search-cards-row.cruise-row,
    .search-cards-row.umrah-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .btn-swap-airports {
        grid-column: 1 / -1;
        margin: 0.25rem auto;
        transform: rotate(90deg);
    }

    .custom-tour-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    .flash-deals-banner {
        flex-direction: column;
        text-align: center;
    }

    .flash-countdown {
        justify-content: center;
    }

    /* Package Detail Page 2-Column Layout Collapse */
    .package-gallery-grid {
        grid-template-columns: 1fr 1fr !important;
        height: 320px !important;
        margin-bottom: 2rem !important;
    }

    .package-detail-layout {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    .package-sidebar-col {
        position: static !important;
        width: 100% !important;
    }

    /* Visa Detail Page 2-Column Layout Collapse */
    .visa-detail-layout {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    /* Contact Page Layout Grid */
    .contact-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    /* Legal Pages Layout Grid */
    .legal-page-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .legal-sidebar {
        position: static !important;
        top: auto !important;
        padding: 1.25rem !important;
    }

    /* Custom Trip Page */
    .custom-tour-banner {
        padding: 2.2rem 1.8rem !important;
    }

    .custom-trip-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* --------------------------------------------------------------------------
   3. Mobile Devices & Phablets (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .site-header .navbar {
        height: 72px !important;
    }

    .site-header.scrolled .navbar {
        height: 66px !important;
    }

    .header-brand-wrap {
        max-width: calc(100% - 58px) !important;
    }

    .header-main-logo {
        height: 38px !important;
        max-height: 38px !important;
    }

    .site-header.scrolled .header-main-logo {
        height: 33px !important;
        max-height: 33px !important;
    }

    .header-brand-text {
        font-size: 1.25rem !important;
        gap: 0.32rem !important;
        letter-spacing: -0.4px !important;
    }

    .site-header.scrolled .header-brand-text {
        font-size: 1.15rem !important;
    }

    .nav-menu {
        top: 72px !important;
        height: calc(100vh - 72px) !important;
        padding: 1.75rem 1.5rem !important;
    }

    /* Footer Logo on Mobile */
    .footer-logo-badge {
        padding: 8px 16px !important;
        border-radius: 14px !important;
        max-width: 100% !important;
    }

    .footer-main-logo {
        height: 46px !important;
        max-width: 100% !important;
    }

    /* Hero Section */
    .hero-section {
        padding: 3.25rem 0 2.75rem !important;
        min-height: auto !important;
    }

    .hero-title {
        font-size: clamp(2rem, 6.5vw, 2.6rem) !important;
        line-height: 1.2 !important;
        letter-spacing: -0.5px !important;
        margin-bottom: 0.65rem !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
        margin-bottom: 1.75rem !important;
    }

    .hero-search-container {
        padding: 0;
        background: #FFFFFF !important;
        border-radius: 20px !important;
        box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35) !important;
        border: 1px solid rgba(255, 255, 255, 0.9) !important;
    }

    /* Scrollable Tab Bar with Smooth Touch */
    .search-tabs-nav {
        justify-content: flex-start !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        width: 100% !important;
        padding: 0.4rem 0.65rem 0 !important;
        gap: 0.35rem !important;
        border-bottom: 1px solid #F1F5F9 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
        scroll-padding-left: 0.65rem;
    }

    .search-tabs-nav::-webkit-scrollbar {
        display: none !important;
    }

    .search-tab-btn {
        padding: 0.75rem 0.95rem !important;
        font-size: 0.88rem !important;
        gap: 0.4rem !important;
        flex-shrink: 0 !important;
        border-radius: 8px 8px 0 0 !important;
    }

    .search-tab-btn i,
    .search-tab-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .search-tab-btn.active::after {
        bottom: -1px !important;
        left: 8px !important;
        right: 8px !important;
        height: 3px !important;
    }

    .hero-search-box {
        padding: 1.25rem 1rem 1.6rem !important;
        border-radius: 0 0 20px 20px !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* 1-Column Search on Phones */
    .search-cards-row,
    .search-cards-row.flight-row,
    .search-cards-row.flight-row.roundtrip-active,
    .search-cards-row.tours-row,
    .search-cards-row.hotels-row,
    .search-cards-row.visa-row,
    .search-cards-row.cruise-row,
    .search-cards-row.umrah-row {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    /* Dropdown Menus on Mobile: Full-width matching card */
    .custom-dropdown-menu {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        max-height: 380px;
        border-radius: 14px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    }

    .search-cards-row > div:last-child .custom-dropdown-menu,
    .search-cards-row > div:nth-last-child(2) .custom-dropdown-menu {
        left: 0 !important;
        right: 0 !important;
    }

    .dropdown-option-item {
        padding: 0.65rem 0.75rem;
        gap: 0.6rem;
    }

    .dropdown-option-item .option-main-title {
        font-size: 0.92rem;
    }

    .dropdown-option-item .option-sub-desc {
        font-size: 0.74rem;
    }

    .dropdown-option-item .option-pill-badge {
        font-size: 0.72rem;
        padding: 0.2rem 0.5rem;
    }

    .btn-hero-search {
        width: 100% !important;
        padding: 0.95rem 1.5rem !important;
        font-size: 1.05rem !important;
        height: 52px !important;
        margin-top: 0.5rem !important;
    }

    /* Universal Trust Stats Row (Homepage, Visa, Packages, About, etc.) */
    .hero-stats-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
        margin-top: 2rem !important;
        padding-top: 1.5rem !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .hero-stat-item {
        text-align: center !important;
    }

    .hero-stat-item .stat-number,
    .hero-stat-num {
        font-size: 1.8rem !important;
        line-height: 1.1 !important;
        justify-content: center !important;
    }

    .hero-stat-item .stat-label {
        font-size: 0.78rem !important;
    }

    /* All Card Grids Across Site */
    .packages-grid,
    .destinations-grid,
    .reviews-grid,
    .visa-cards-grid,
    .holiday-packages-grid,
    .holiday-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* All inline minmax grids collapsed for mobile */
    div[style*="minmax(340px"],
    div[style*="minmax(360px"],
    div[style*="minmax(320px"],
    div[style*="minmax(280px"],
    div[style*="minmax(260px"],
    div[style*="minmax(240px"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Card Padding & Radii on Mobile */
    .visa-service-card,
    .holiday-card {
        padding: 1.6rem 1.35rem !important;
        border-radius: 18px !important;
    }

    .section-title {
        font-size: 2rem !important;
        line-height: 1.25;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    /* Package Detail Page Components */
    .package-gallery-grid {
        grid-template-columns: 1fr !important;
        height: auto !important;
        margin-bottom: 1.75rem !important;
    }

    .gallery-main-col {
        height: 250px !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    .gallery-sub-col {
        display: none !important;
    }

    .package-inclusions-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .package-content-card {
        padding: 1.6rem 1.25rem !important;
        border-radius: 16px !important;
        margin-bottom: 1.75rem !important;
    }

    .package-sidebar-card {
        padding: 1.6rem 1.25rem !important;
        border-radius: 16px !important;
    }

    /* Visa Detail Page */
    .visa-detail-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Trip Type Container on air-ticket.php */
    #tripTypeContainer {
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    .trip-type-label {
        padding: 0.75rem 1rem !important;
    }

    /* Air Ticket Form Card & Submit Button */
    .air-ticket-card {
        padding: 1.6rem 1.2rem !important;
        border-radius: 18px !important;
    }

    .air-submit-btn {
        padding: 1.05rem 1.3rem !important;
        font-size: 1.05rem !important;
    }

    /* Contact Page Components */
    .contact-form-card {
        padding: 1.6rem 1.25rem !important;
        border-radius: 18px !important;
    }

    .contact-info-card {
        padding: 1.25rem 1.25rem !important;
        border-radius: 16px !important;
    }

    .contact-map-card {
        padding: 1.25rem !important;
        border-radius: 18px !important;
    }

    .contact-map-iframe-wrap {
        height: 300px !important;
    }

    /* Custom Trip Page */
    .custom-tour-banner {
        padding: 1.6rem 1.2rem !important;
        border-radius: 18px !important;
    }

    .custom-trip-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .hotel-tier-select {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.65rem !important;
    }

    .estimated-price-box {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: left !important;
        padding: 1.25rem !important;
    }

    /* About Us Page */
    .about-hero-wrap {
        padding: 3.5rem 1rem 2.5rem !important;
    }

    .about-main-section {
        padding: 3.5rem 1rem 4.5rem !important;
    }

    .founder-card-box {
        padding: 2rem 1.25rem !important;
        border-radius: 20px !important;
    }

    .heads-grid, .concerns-grid, .offices-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .head-card, .concern-card, .office-card {
        padding: 1.8rem 1.35rem !important;
        border-radius: 18px !important;
    }

    /* Filter Tabs in packages.php */
    .category-filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
        justify-content: flex-start !important;
    }

    .category-filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .filter-tab-btn {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.88rem;
    }

    /* Modals & Booking Wizard on Mobile */
    .modal-backdrop {
        padding: 0.75rem;
    }

    .modal-container {
        width: 100% !important;
        max-width: 520px !important;
        border-radius: 18px;
        max-height: 92vh;
    }

    .wizard-steps-header {
        padding: 0.75rem 0.85rem;
        overflow-x: auto;
    }

    .step-label {
        display: none;
    }

    .form-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 0.85rem;
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr !important;
        gap: 2.25rem;
    }

    .footer-brand {
        text-align: left;
    }

    .footer-socials {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-badges {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-sister-concern {
        align-items: center !important;
        text-align: center;
    }

    .sister-logos-row {
        justify-content: center !important;
    }

    /* Floating Concierge Buttons (WhatsApp & Messenger Stack) */
    .floating-chat-container {
        bottom: 16px;
        right: 16px;
        gap: 10px;
    }

    .floating-chat-btn {
        width: 48px;
        height: 48px;
    }

    .floating-chat-btn svg {
        width: 25px;
        height: 25px;
    }

    .back-to-top {
        bottom: 135px;
        right: 19px;
        width: 42px;
        height: 42px;
    }
}

/* --------------------------------------------------------------------------
   4. Small Mobile Phones (max-width: 480px, down to 320px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .container {
        padding: 0 0.95rem !important;
    }

    .site-header .navbar {
        height: 66px !important;
    }

    .site-header.scrolled .navbar {
        height: 58px !important;
    }

    .header-brand-wrap {
        max-width: calc(100% - 50px) !important;
    }

    .header-main-logo {
        height: 33px !important;
        max-height: 33px !important;
    }

    .site-header.scrolled .header-main-logo {
        height: 28px !important;
        max-height: 28px !important;
    }

    .header-brand-text {
        font-size: 1.05rem !important;
        gap: 0.25rem !important;
        letter-spacing: -0.3px !important;
    }

    .site-header.scrolled .header-brand-text {
        font-size: 0.98rem !important;
    }

    .mobile-toggle {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
    }

    .nav-menu {
        top: 64px !important;
        height: calc(100vh - 64px) !important;
        padding: 1.5rem 1.15rem !important;
    }

    /* Footer Logo on Small Phones */
    .footer-logo-badge {
        padding: 6px 14px !important;
        border-radius: 12px !important;
        max-width: 100% !important;
    }

    .footer-main-logo {
        height: 38px !important;
        max-width: 100% !important;
    }

    .hero-title {
        font-size: 1.8rem !important;
    }

    .hero-subtitle {
        font-size: 0.88rem !important;
    }

    .hero-search-container {
        border-radius: 18px !important;
    }

    .search-tabs-nav {
        justify-content: flex-start !important;
        border-radius: 18px 18px 0 0 !important;
        padding: 0.35rem 0.45rem 0 !important;
        gap: 0.25rem !important;
        scroll-padding-left: 0.45rem;
    }

    .search-tab-btn {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.82rem !important;
        gap: 0.3rem !important;
    }

    .hero-search-box {
        padding: 1rem 0.85rem 1.4rem !important;
        border-radius: 0 0 18px 18px !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    .search-pill-types {
        gap: 0.4rem;
    }

    .pill-type-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .search-input-card {
        padding: 0.85rem 0.95rem !important;
    }

    .trigger-text {
        font-size: 0.92rem;
    }

    .date-trigger-display .date-display-val {
        font-size: 0.92rem;
    }

    /* Stats Row on Small Phones: 2x2 Grid with Compact Font */
    .hero-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.85rem !important;
    }

    .hero-stat-item .stat-number,
    .hero-stat-num {
        font-size: 1.55rem !important;
    }

    .hero-stat-item .stat-label {
        font-size: 0.72rem !important;
    }

    /* Action Buttons inside Cards on Small Screens */
    .visa-service-card div[style*="grid-template-columns: 1fr 1fr"],
    .holiday-card div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .visa-service-card .btn,
    .holiday-card .btn {
        font-size: 0.84rem !important;
        padding: 0.75rem 0.35rem !important;
        gap: 0.3rem !important;
    }

    .modal-container {
        border-radius: 14px;
        max-height: 94vh;
    }

    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }

    .wizard-body {
        padding: 1rem 0.85rem;
    }

    .booking-voucher-card {
        padding: 1.15rem 0.85rem;
    }

    .voucher-code-badge {
        font-size: 0.92rem;
        padding: 0.35rem 0.75rem;
    }

    /* Air Ticket Page on Small Phones */
    .air-ticket-card {
        padding: 1.25rem 0.95rem !important;
    }

    .trip-type-label {
        padding: 0.65rem 0.85rem !important;
        font-size: 0.88rem !important;
    }

    .air-submit-btn {
        font-size: 0.95rem !important;
        padding: 0.95rem 0.85rem !important;
        gap: 0.5rem !important;
    }

    /* Floating Buttons */
    .floating-chat-container {
        bottom: 12px;
        right: 12px;
        gap: 8px;
    }

    .floating-chat-btn {
        width: 44px;
        height: 44px;
    }

    .floating-chat-btn svg {
        width: 23px;
        height: 23px;
    }

    .back-to-top {
        bottom: 118px;
        right: 14px;
        width: 38px;
        height: 38px;
    }
}

/* --------------------------------------------------------------------------
   5. Ultra Small Mobile Screens (max-width: 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
    .header-brand-text {
        font-size: 0.95rem !important;
        gap: 0.2rem !important;
    }

    .site-header .navbar {
        height: 60px !important;
    }

    .site-header.scrolled .navbar {
        height: 54px !important;
    }

    .header-brand-wrap {
        max-width: calc(100% - 46px) !important;
    }

    .header-main-logo {
        height: 28px !important;
        max-height: 28px !important;
    }

    .site-header.scrolled .header-main-logo {
        height: 25px !important;
        max-height: 25px !important;
    }

    .footer-logo-badge {
        padding: 5px 12px !important;
        border-radius: 10px !important;
    }

    .footer-main-logo {
        height: 32px !important;
    }
}
