/* ============================================
   BRIDAL EXPERT - SHARED MOBILE CSS
   Applies to ALL pages
============================================ */

/* --- RESET & BASE --- */
* { box-sizing: border-box; max-width: 100%; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }

/* --- HEADER UNIVERSAL --- */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

/* --- HAMBURGER BTN --- */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer; gap: 5px; padding: 5px;
    z-index: 1100; background: none; border: none;
}
.hamburger span {
    display: block; width: 25px; height: 2px;
    background: #4a0808; transition: all 0.3s ease; border-radius: 2px;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- MOBILE NAV OVERLAY --- */
.mobile-nav-overlay, .mobile-overlay {
    display: none;
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 999;
}
.mobile-nav-overlay.active, .mobile-overlay.active { display: block; }

/* --- DROPDOWN ARROW --- */
.dropdown-arrow {
    display: none;
    margin-left: 5px; font-size: 10px;
    transition: transform 0.3s;
}

/* ============================
   TABLET (max-width: 1024px)
============================ */
@media (max-width: 1024px) {
    .grid-container { grid-template-columns: repeat(3, 1fr) !important; }
    .footer-container { grid-template-columns: 1fr 1fr !important; gap: 30px !important; }
    .cat-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .product-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ============================
   MOBILE (max-width: 768px)
============================ */
@media (max-width: 768px) {

    /* === HEADER === */
    header { padding: 0 !important; }
    .header-container { padding: 12px 16px !important; }
    .logo h1, .logo { font-size: 16px !important; letter-spacing: 3px !important; }

    /* Show hamburger, hide desktop nav */
    .hamburger { display: flex !important; }
    nav.desktop-nav { display: none !important; }
    .menu-toggle { display: none !important; }
    .dropdown-arrow { display: inline-block !important; }

    /* === MOBILE NAV SLIDE-IN === */
    .nav-links {
        position: fixed !important;
        top: 0; right: -100% !important;
        width: 280px !important; height: 100vh !important;
        background: #fff !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 70px 0 30px !important;
        z-index: 1000 !important;
        transition: right 0.3s ease !important;
        overflow-y: auto !important;
        box-shadow: -5px 0 20px rgba(0,0,0,0.15) !important;
    }
    .nav-links.mobile-open { right: 0 !important; }
    .nav-links li {
        margin: 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    .nav-links a {
        display: block !important;
        padding: 14px 25px !important;
        font-size: 13px !important;
        color: #222 !important;
    }
    .nav-links a:hover { color: #4a0808 !important; background: #fdf8f3 !important; }

    /* Mobile dropdown - click based */
    .dropdown-content {
        position: static !important;
        display: none !important;
        background: #fdf0f0 !important;
        box-shadow: none !important;
        border-top: none !important;
        min-width: auto !important;
        padding: 0 !important;
    }
    .dropdown-content.mobile-dropdown-open { display: flex !important; }
    .dropdown-content a {
        padding: 10px 40px !important;
        color: #4a0808 !important;
        font-size: 12px !important;
        border-bottom: 1px solid rgba(74,8,8,0.08) !important;
    }

    /* Nav icons on mobile */
    .nav-icons {
        display: flex !important;
        gap: 12px !important;
        margin-right: 10px !important;
    }
    .nav-icons i { font-size: 15px !important; margin: 0 !important; }

    /* === HERO SLIDER === */
    .hero-slider { height: 55vw !important; min-height: 200px !important; max-height: 300px !important; }
    .slide-flex { flex-direction: column !important; }
    .slide-flex .slide-img:not(:first-child) { display: none !important; }
    .slide-img { flex: none !important; width: 100% !important; height: 100% !important; }

    /* Page hero banner */
    .page-hero { height: 180px !important; min-height: auto !important; }
    .page-hero h1 { font-size: 20px !important; letter-spacing: 3px !important; }

    /* === CATEGORY GRID === */
    .cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important; padding: 0 3% 20px !important;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important; padding: 0 3% 15px !important;
        margin-top: 10px !important;
    }

    /* === TRENDING === */
    .trending-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 0 3% !important;
        margin-top: 15px !important;
    }
    .trend-box { height: 250px !important; }
    .trend-content { bottom: 15px !important; left: 15px !important; }
    .trend-content h3 { font-size: 18px !important; }

    /* === PRODUCT GRID === */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important; padding: 0 3% 20px !important;
    }
    .grid-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important; padding: 10px 3% !important;
    }
    .product-img { height: 200px !important; }
    .img-box { height: 200px !important; }

    /* Slider buttons always visible on mobile */
    .slider-btn { display: block !important; width: 28px !important; height: 28px !important; font-size: 12px !important; opacity: 0.85 !important; }
    .prev-btn { left: 4px !important; }
    .next-btn { right: 4px !important; }

    /* === GALLERY === */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .gallery-item-wrapper { height: 180px !important; }

    /* === SECTION TITLE === */
    .section-title {
        font-size: 14px !important;
        letter-spacing: 2px !important;
        padding: 18px 0 10px !important;
    }

    /* === REVIEWS === */
    .reviews-wrapper {
        animation: none !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    .review-card { min-width: auto !important; width: 100% !important; }
    .reviews-container { padding: 0 15px !important; overflow: hidden !important; }

    /* === MODALS === */
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 15px !important;
    }
    .auth-card { width: 90% !important; max-width: 320px !important; }

    /* === FORMS === */
    .form-grid, .appointment-form { grid-template-columns: 1fr !important; }
    .container { padding: 0 15px !important; margin: 20px auto !important; }

    /* === SIDEBAR === */
    .sidebar { width: 85% !important; max-width: 290px !important; padding: 50px 15px 30px !important; }
    #cartSidebar { width: 88% !important; max-width: 300px !important; }
    .cart-footer { width: 85% !important; }

    /* === SEARCH === */
    .search-section { padding: 10px 4% !important; }
    #searchInput { font-size: 13px !important; padding: 10px 15px !important; }

    /* === FOOTER === */
    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important; padding: 0 18px !important;
    }
    .main-footer { padding: 35px 0 15px !important; }
    .footer-section h3 { font-size: 15px !important; margin-bottom: 12px !important; }
    .subscribe-form { flex-wrap: wrap !important; }
    .subscribe-form input { width: 100% !important; margin-bottom: 8px !important; }
    .subscribe-form button { width: 100% !important; }

    /* === INFO BOXES === */
    .info-box { padding: 10px 8px !important; }
    .name { font-size: 12px !important; }
    .price { font-size: 12px !important; }
    .btn-add { font-size: 10px !important; padding: 8px 4px !important; }

    /* === TABLES === */
    table { display: block !important; overflow-x: auto !important; }

    /* === GENERAL === */
    * { max-width: 100%; }
}

/* ============================
   SMALL MOBILE (max-width: 480px)
============================ */
@media (max-width: 480px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .product-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .category-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .grid-container { grid-template-columns: repeat(2, 1fr) !important; }
    .trend-box { height: 220px !important; }
    .hero-slider { height: 58vw !important; }
    .logo h1, .logo { font-size: 14px !important; letter-spacing: 2px !important; }
    .gallery-item-wrapper { height: 160px !important; }
}

/* ============================
   VERY SMALL (max-width: 360px)
============================ */
@media (max-width: 360px) {
    .product-grid { grid-template-columns: 1fr !important; }
    .grid-container { grid-template-columns: 1fr !important; }
}
