/* ============================================================
   T-REX Fireworks - Responsive CSS
   ============================================================ */

/* ===== LARGE DESKTOP (1400px+) ===== */
@media (min-width: 1400px) {
    .container-fluid { max-width: 1360px; margin: 0 auto; }
}

/* ===== DESKTOP (1200px - 1399px) ===== */
@media (max-width: 1199px) {
    .hero-slider .slick-slide img { max-height: 440px; }
    .logo-img { width: 100px; height: 100px; }
    .main-nav .nav-link { padding: 8px 10px; font-size: 13px; }
}

/* ===== TABLET (768px - 991px) ===== */
@media (max-width: 991px) {
    /* Header */
    .main-header { padding: 8px 0; }
    .logo-img { width: 75px; height: 75px; }

    /* Category bar hidden on mobile */
    .category-bar { display: none !important; }

    /* Hero */
    .hero-slider .slick-slide img { max-height: 360px; }

    /* Sections */
    .categories-section { padding: 40px 0; }
    .section-title h2 { font-size: 22px; }

    /* Category grid */
    .category-img-wrap { width: 70px; height: 70px; }
    .category-img-wrap img { width: 46px; height: 46px; }
    .category-name { font-size: 11px; }

    /* Services */
    .service-box { padding: 16px; }
    .service-text h5 { font-size: 14px; }

    /* Admin — sidebar becomes slide-in drawer */
    body.admin-page { padding-bottom: 0 !important; }
    .admin-mobile-bar  { display: flex; }
    .admin-sidebar     { transform: translateX(-270px); }
    .admin-sidebar.open{ transform: translateX(0); }
    .admin-main        { margin-left: 0; padding: 16px; padding-top: 66px; overflow-x: hidden; }
    .admin-desktop-topbar { display: none !important; }

    /* Admin page-action headers wrap on tablet */
    .admin-page .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Admin tables — compact + horizontal scroll */
    .admin-table th, .admin-table td { font-size: 12px; padding: 8px 10px; white-space: nowrap; }

    /* Stat cards 2-per-row on tablet */
    .stat-card h3 { font-size: 22px; }
    .stat-card    { padding: 16px; }

    /* Footer */
    .footer-main { padding: 30px 0 20px; }
}

/* ===== MOBILE (< 768px) ===== */
@media (max-width: 767px) {
    /* Fix AOS fade-right/left causing page-width jump on mobile — use vertical only */
    [data-aos="fade-right"],
    [data-aos="fade-left"] { transform: translateY(30px) !important; }
    [data-aos="fade-right"].aos-animate,
    [data-aos="fade-left"].aos-animate { transform: translateY(0) !important; }

    /* Body: pad bottom for fixed bottom nav (62px) */
    body { padding-bottom: 62px; }

    /* Top bar */
    .top-bar { font-size: 11px; padding: 4px 0; }

    /* ── HEADER MOBILE LAYOUT ──────────────────────────
       [≡ Burger]  [LOGO]  [🔍  🛒]
    ───────────────────────────────────────────────── */
    .main-header { padding: 8px 0; }

    /* Show hamburger */
    .main-header .col-auto.d-lg-none { display: flex !important; align-items: center; }

    /* Logo column: left-aligned, takes remaining space */
    .main-header .col-6.text-center {
        flex: 1 1 auto !important;
        max-width: 100% !important;
        text-align: left !important;
        padding-left: 4px;
    }

    /* Icons column: auto width, stays right */
    .main-header .col-lg-3.col-6 {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    /* Logo size — bigger on mobile */
    .logo-img { width: 75px !important; height: 75px !important; }
    .sticky-header.stuck .logo-img { width: 60px !important; height: 60px !important; }
    .header-phone { display: none !important; }

    /* Icon buttons tighter on mobile */
    .header-icon-btn { width: 36px; height: 36px; font-size: 16px; }

    /* Remove right-arrow chevrons from footer quick links */
    .footer-links .fa-chevron-right { display: none; }

    /* Show bottom nav on mobile */
    .btm-nav { display: flex; width: 100%; }

    /* Floating buttons above bottom nav — scroll-to-top RIGHT, WhatsApp LEFT */
    .scroll-top-btn { bottom: 74px; right: 10px; width: 36px; height: 36px; font-size: 13px; }

    /* Quick purchase float — right side, well above scroll-to-top */
    /* Quick purchase float — right side, well above scroll-to-top */
    .quick-purchase-float {
        display: block !important;
        position: fixed !important;
        top: auto !important;
        bottom: 120px !important;
        right: 6px !important;
        transform: none !important;
        z-index: 9995 !important;
    }
    .quick-purchase-float img {
        width: 90px;
        height: auto;
        animation: bounce 2s infinite;
    }
    .quick-purchase-float img {
        width: 90px;
        height: auto;
        animation: bounce 2s infinite;
    }

    /* WhatsApp — LEFT side just above bottom nav so it never blocks content */
    .whatsapp-float {
        width: 48px; height: 48px; font-size: 24px;
        bottom: 72px;
        left: 12px;
        right: auto;
    }

    /* Hero */
    .hero-slider .slick-slide img { max-height: 220px; }
    .hero-slider .slick-prev { left: 8px; }
    .hero-slider .slick-next { right: 8px; }
    .hero-slider .slick-prev, .hero-slider .slick-next { width: 34px; height: 34px; }

    /* Promo banners stacked on mobile */
    .promo-banner-img { height: 200px; }
    .promo-banner-title { font-size: 17px; }
    .promo-banner-overlay { padding: 20px 22px; }

    /* Category section */
    .categories-section { padding: 30px 0; }
    .section-title h2 { font-size: 18px; }
    .category-img-wrap { width: 60px; height: 60px; }
    .category-img-wrap img { width: 40px; height: 40px; }
    .category-name { font-size: 10px; }

    /* Service boxes stacked */
    .services-strip .row .col-md-6 { margin-bottom: 12px; }
    .service-box { padding: 14px; }
    .service-icon { width: 44px; height: 44px; font-size: 20px; }

    /* SEO content */
    .seo-content-section { padding: 30px 0; }
    .seo-content-section h1 { font-size: 16px; }

    /* Testimonials */
    .testimonials-section { padding: 30px 0; }
    .testimonial-card { margin: 8px; padding: 20px 16px; }

    /* Products */
    .product-single-section { padding: 20px 0; }
    .product-single-title { font-size: 18px; }
    .price-offer { font-size: 22px; }

    /* Cart — card view on mobile */
    .cart-page { padding: 20px 0; }
    .cart-product-thumb { width: 50px; height: 50px; }
    .cart-table thead { display: none; }
    .cart-table tbody tr {
        display: block;
        border: 1px solid #eee;
        border-radius: 10px;
        margin-bottom: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        background: #fff;
    }
    .cart-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        border: none;
        border-bottom: 1px solid #f5f5f5;
        font-size: 13px;
    }
    .cart-table tbody td:last-child { border-bottom: none; justify-content: flex-end; }
    .cart-table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 8px;
    }
    .cart-table tbody td:first-child { display: block; border-bottom: 2px solid #f0f0f0; padding: 12px; }
    .cart-table tbody td:first-child::before,
    .cart-table tbody td:last-child::before { display: none; }

    /* Quick purchase — hide non-essential columns, compact sizing */
    .qp-col-hide { display: none !important; }
    .qp-table th, .qp-table td { font-size: 11px; padding: 6px 5px; }
    .qp-product-thumb { width: 36px !important; height: 36px !important; }
    .qp-table .form-control-sm { font-size: 12px; padding: 3px 5px; width: 52px; }

    /* Checkout */
    .checkout-section { padding: 20px 0; }
    .checkout-card { padding: 16px; }

    /* Auth */
    .auth-card { padding: 24px 20px; }

    /* Admin mobile extra tightening */
    body.admin-page { padding-bottom: 0 !important; }
    .admin-main { padding: 12px; padding-top: 62px; overflow-x: hidden; }
    .admin-mobile-bar { padding: 8px 14px; }
    .admin-mobile-title { font-size: 14px; }
    .admin-mobile-user span { display: none; }
    .stat-card { padding: 14px; }
    .stat-card h3 { font-size: 20px; }
    .admin-nav-link { padding: 14px 20px; min-height: 48px; }

    /* Admin page-action headers wrap on mobile */
    .admin-page .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-wrap: wrap;
        gap: 8px;
    }
    .admin-page .d-flex.justify-content-between.align-items-center.mb-4 > a,
    .admin-page .d-flex.justify-content-between.align-items-center.mb-4 > button {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }

    /* Card header wrap */
    .admin-page .card-header.d-flex { flex-wrap: wrap; gap: 6px; }

    /* Mini cart */
    .mini-cart-panel { width: 300px; }

    /* Quick purchase table */
    .qp-table th, .qp-table td { padding: 8px; font-size: 12px; }
    .qp-product-thumb { width: 38px; height: 38px; }

    /* Rockets smaller on mobile */
    .rocket-animation { width: 24px !important; }
}

/* ===== SMALL MOBILE (< 480px) ===== */
@media (max-width: 479px) {
    .hero-slider .slick-slide img { max-height: 180px; }
    .category-img-wrap { width: 52px; height: 52px; }
    .category-img-wrap img { width: 34px; height: 34px; }
    .section-title h2 { font-size: 16px; }
    .product-offer-price { font-size: 15px; }
    .product-name { font-size: 12px; }
    .btn-add-cart { font-size: 11px; padding: 6px 8px; }

    /* Hide rockets on very small screens for performance */
    .rocket-container { display: none; }

    /* Top bar: ticker only, hide links */
    .top-bar-link { display: none; }
    .top-bar-link:first-child { display: inline; }

    /* Smaller logo on very small screens */
    .logo-img { width: 62px !important; height: 62px !important; }

    /* Admin very small phones */
    .admin-main { padding: 10px; padding-top: 60px; }
    .admin-mobile-title { font-size: 12px; max-width: 140px; }
    .admin-burger { font-size: 18px; padding: 4px 6px; }
    .stat-card h3 { font-size: 18px; }
    .stat-card p { font-size: 11px; }

    /* Bottom nav label smaller on very small phones */
    .btm-nav-item span { font-size: 9px; }
    .btm-nav-item i { font-size: 17px; }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) {
    .category-card:hover { transform: none; }
    .product-card:hover { transform: none; }
    .product-card:hover .product-image img { transform: none; }
}

/* ===== PRINT ===== */
@media print {
    .top-bar, .main-header, .category-bar, .site-footer,
    .whatsapp-float, .quick-purchase-float, .scroll-top-btn,
    .rocket-container, .mini-cart-panel, .mobile-sidebar { display: none !important; }
    body { font-size: 12pt; }
}
