/* ============================================================================
   REYA THEME — Mobile Responsive (Comprehensive Fix)
   Breakpoints: ≤1200px  |  ≤1024px  |  ≤900px  |  ≤768px  |  ≤640px  |  ≤480px  |  ≤400px
   ============================================================================ */

/* ────────────────────────────────────────
   TABLET-LARGE  (≤ 1200px)
──────────────────────────────────────── */
@media (max-width: 1200px) {

    /* Hero */
    .hero-overlay { padding: 0 64px; }
    .hero-content h1 { font-size: 44px; }
    .hero-btn { font-size: 28px; min-width: 280px; height: 68px; padding: 16px 32px; }

    /* Section headings */
    .sec-head h2 { font-size: 48px; }
    .editorial-text h2 { font-size: 48px; }

    /* Footer */
    .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }

    /* Jewellery listing sidebar collapses */
    .listing-main-layout { grid-template-columns: 240px 1fr; }

    /* Product details */
    .pd-container { gap: 32px; }

    /* Style row: 6-col → 4-col */
    .style-row { grid-template-columns: repeat(4, 1fr); }

    /* Editorial images: remove fixed width */
    .editorial-images { width: 420px; }

    /* Promise grid */
    .promise-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }

    /* Reviews section: normalise overlap */
    .reviews-right-content { margin-left: -60px; }

    /* Footer logo */
    .footer-logo-area .logo-img { width: 280px; height: auto; }

    /* Footer col font size */
    .footer-col ul li a { font-size: 17px; }
    .footer-col h4 { font-size: 24px; }
    .footer-contact .c-item span { font-size: 17px; }
}

/* ────────────────────────────────────────
   TABLET  (≤ 1024px)
──────────────────────────────────────── */
@media (max-width: 1024px) {

    /* Header: hide desktop nav, show hamburger */
    .header-main {
        padding: 10px 16px;
    }

    .main-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .search-bar {
        max-width: 280px;
    }

    /* Hero */
    .hero-slider { height: 400px; }
    .hero-content h1 { font-size: 38px; }
    .hero-btn { font-size: 22px; min-width: 220px; height: 58px; }

    /* Grids */
    .product-grid-new { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .collection-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-grid { grid-template-columns: 1fr; }
    .tryon-wrapper { grid-template-columns: 1fr; }
    .investment-pane.active { grid-template-columns: 1fr; }
    .savings-v3-visual { display: none; }

    /* Footer */
    .footer-grid { grid-template-columns: repeat(2, 1fr); }

    /* Video */
    .video-content-wrapper { padding: 0 40px; }

    /* Featured showcase */
    .featured-showcase {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 200px 200px 200px;
    }
    .featured-item.large {
        grid-row: span 1;
        grid-column: span 2;
    }

    /* Gifting */
    .gifting-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .gift-card.main { grid-row: span 1; }

    /* Style row: 6-col → 3-col */
    .style-row { grid-template-columns: repeat(3, 1fr); }

    /* Editorial */
    .editorial-images { width: 360px; }
    .editorial-text h2 { font-size: 40px; }

    /* Reviews */
    .reviews-right-content { margin-left: -40px; }
    .review-card { flex: 0 0 340px; }

    /* Forhim grid: 3 cols stay, reduce padding */
    .forhim-section { padding: 40px 40px; }
    .occasion-section { padding: 40px 40px; }
    .trending-section { padding: 40px 40px; }
    .forever-section { padding: 40px 40px; }
    .gifts-section { padding: 40px 40px; }
    .blog-section { padding: 40px 40px; }
    .promise-section { padding: 60px 40px; }

    /* Bento grid */
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 180px 180px 180px;
        gap: 10px;
    }

    /* Blog */
    .blog-grid { flex-direction: column; }
    .blog-card { height: auto; }
}

/* ────────────────────────────────────────
   MOBILE NAV OVERLAY (Global)
──────────────────────────────────────── */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 20, 38, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
}

.mobile-nav.active,
.mobile-nav.open {
    display: block;
}

.mobile-nav-panel {
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: var(--white, #fff);
    padding: 20px;
    box-shadow: var(--shadow-xl, 0 16px 50px rgba(0,0,0,0.12));
    overflow-y: auto;
}

.mobile-nav-close {
    text-align: right;
    margin-bottom: 20px;
}

.mobile-nav-close button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cream, #F8F5F0);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-links a {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #1A1A2E);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mobile-nav-links a:hover {
    background: var(--cream, #F8F5F0);
    color: var(--coral, #E07A5F);
}

/* ────────────────────────────────────────
   SMALL TABLET / LARGE PHONE  (≤ 768px)
──────────────────────────────────────── */
@media (max-width: 768px) {

    /* General sections */
    .section { padding: 48px 0; }
    .section-title { font-size: 1.5rem; }
    .section-header { margin-bottom: 28px; }

    /* Hero */
    .hero-slider { height: 340px; }
    .hero-content { padding: 30px 24px 36px !important; }
    .hero-content h2 { font-size: 1.6rem; }
    .hero-content p { font-size: 0.85rem; max-width: none; }
    .hero-btn { font-size: 18px; min-width: 180px; height: 52px; padding: 14px 24px; }

    /* Style row: 6-col → 2-col */
    .style-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .style-card .label { font-size: 20px; }

    /* Section headings */
    .sec-head h2 { font-size: 32px; }
    .sec-head p { font-size: 16px; }
    .editorial-text h2 { font-size: 32px; }
    .editorial-text .desc { font-size: 16px; }

    /* Editorial: stack on mobile */
    .editorial { padding: 40px 24px; }
    .editorial-inner { flex-direction: column; gap: 30px; }
    .editorial-images {
        width: 100% !important;
        flex-shrink: 1;
        align-self: auto;
    }
    .editorial-images .img-grid { min-height: 320px; }
    .editorial-images .img-back-wrap { height: 260px; }
    .editorial-images .img-front-wrap { height: 220px; margin-top: -80px; }
    .editorial-text { padding-top: 0; }
    .editorial-text .read-more { font-size: 20px; }

    /* Product grid */
    .product-grid-new { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Mobile Filter Sidebar */
    .mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: var(--primary-color, #1e1e1e);
        color: #fff;
        border: none;
        padding: 8px 16px;
        border-radius: 9999px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        margin-right: auto;
    }

    .premium-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        transition: left 0.3s ease !important;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1) !important;
        padding: 20px !important;
    }

    .premium-sidebar.active { left: 0 !important; }

    .premium-sidebar .sidebar-close {
        display: block !important;
        position: absolute;
        top: 15px; right: 15px;
        background: transparent;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
        color: #1e1e1e;
    }

    .sidebar-ad-space { display: none !important; }

    /* Utility bar */
    .listing-utility-bar .utility-inner { flex-wrap: wrap; gap: 10px; }
    .listing-count-results { display: none; }

    /* Grid helpers */
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }

    /* Trend */
    .trend-grid { grid-template-columns: 1fr; }
    .trend-card { height: 280px; }

    /* Wedding */
    .wedding-grid { grid-template-columns: 1fr; }
    .wedding-edit-card { height: 280px; }
    .wedding-edit-card.featured { height: 300px; }

    /* Instagram */
    .insta-grid { grid-template-columns: repeat(3, 1fr); }

    /* Featured showcase */
    .featured-showcase { grid-template-columns: 1fr; grid-template-rows: auto; }
    .featured-item.large { grid-column: span 1; height: 280px; }
    .featured-item { height: 200px; }

    /* Gifting */
    .gifting-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
    .gift-card { height: 200px; }
    .gift-card.main { height: 260px; }

    /* Video */
    .video-container { height: 360px; }
    .video-content-wrapper {
        flex-direction: column;
        padding: 30px 24px;
        text-align: center;
        justify-content: center;
    }
    .video-title { font-size: 1.5rem; }
    .video-play-box { margin-top: 24px; }
    .play-btn-large { width: 60px; height: 60px; font-size: 1.2rem; margin: 0 auto; }

    /* Collection */
    .collection-grid { grid-template-columns: repeat(2, 1fr); }
    .collection-card { height: 220px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .reya-footer { padding: 28px 16px 0 !important; }
    .footer-top {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .footer-col, .footer-newsletter { width: 100% !important; max-width: 100% !important; }
    .footer-col ul li a { font-size: 15px; }
    .footer-col h4 { font-size: 20px; }
    .footer-contact .c-item span { font-size: 15px; }
    .footer-logo-area .logo-img { width: 200px; height: auto; }
    .nl-form { flex-direction: column; }
    .nl-form input { width: 100%; border-radius: 6px; }
    .nl-form button { width: 100%; border-radius: 6px; }
    .footer-brand .brand-name { font-size: 32px; }

    /* Savings */
    .savings-v3-section { padding: 48px 0; }
    .investment-tabs { flex-wrap: wrap; justify-content: center; }
    .savings-v3-steps { flex-direction: column; gap: 12px; }

    /* Header topbar: hide on mobile */
    .header-topbar { display: none; }

    /* Search: hide on mobile */
    .search-bar { display: none; }

    /* Hero offset */
    .hero { margin-top: 66px; }

    /* Page banner */
    .page-banner { margin-top: 66px; padding: 40px 0 30px; }
    .page-banner h1 { font-size: 1.5rem; }

    /* Cart/Orders */
    .cart-container, .orders-container { margin-top: 80px; }

    /* Auth */
    .auth-container { margin-top: 90px; }
    .auth-card { padding: 28px 20px; }

    /* Forhim / occasion / sections: reduce padding */
    .forhim-section { padding: 40px 16px; }
    .forhim-grid { grid-template-columns: 1fr; gap: 16px; }
    .forhim-card { height: 380px; }

    .occasion-section { padding: 40px 16px; }
    .occasion-grid { grid-template-columns: 1fr; gap: 20px; }

    .trending-section { padding: 40px 16px; }
    .forever-section { padding: 40px 16px; }
    .gifts-section { padding: 40px 16px; }
    .blog-section { padding: 40px 16px; }
    .promise-section { padding: 40px 16px; }

    /* Shop by style padding */
    .shop-style { padding: 40px 16px; }

    /* Reviews: stack */
    .reviews-section {
        flex-direction: column;
        gap: 24px;
        padding: 40px 16px;
    }
    .reviews-left-img {
        flex: none;
        width: 100%;
        height: 280px;
        margin: 0;
    }
    .reviews-right-content {
        margin-left: 0;
        width: 100%;
    }
    .review-card { flex: 0 0 280px; padding: 24px; }
    .review-card .review-text { font-size: 18px; }

    /* Bento grid */
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 150px 150px 150px;
        gap: 8px;
    }
    .bento-1 { grid-column: 1/2; grid-row: 1/3; }
    .bento-2 { grid-column: 2/3; grid-row: 1/2; }
    .bento-3 { grid-column: 2/3; grid-row: 2/3; }
    .bento-4 { grid-column: 1/2; grid-row: 3/4; }
    .bento-5 { grid-column: 2/3; grid-row: 3/4; }

    /* Promise: 2-col */
    .promise-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 12px; }
    .promise-item { padding: 40px 16px 24px; }

    /* Contact */
    .contact-grid { grid-template-columns: 1fr; gap: 24px; }
    .contact-form { padding: 20px 16px; }
}

/* ────────────────────────────────────────
   MOBILE  (≤ 640px)
──────────────────────────────────────── */
@media (max-width: 640px) {

    /* Containers */
    .container { padding: 0 16px; }
    .container-wide { padding: 0 12px; }
    .reya-page { padding-bottom: 70px; } /* space for mobile bottom bar */

    /* Section headings */
    .sec-head h2 { font-size: 26px; letter-spacing: 0; }
    .sec-head p { font-size: 14px; }
    .page-header h1 { font-size: 26px; }
    .page-header { padding: 40px 0; }
    .editorial-text h2 { font-size: 26px; }
    .editorial-text .desc { font-size: 15px; }
    .editorial-text .read-more { font-size: 18px; }

    /* Hero */
    .hero-slider { height: 400px; }
    .hero-overlay { padding: 0 18px; }
    .hero-content h1 { font-size: 24px; margin-bottom: 12px; }
    .hero-content p { font-size: 14px; }
    .hero-btn {
        font-size: 14px;
        min-width: 150px;
        height: 46px;
        padding: 10px 18px;
    }

    /* Sections padding */
    .products-section, .trending-section, .blog-section,
    .forever-section, .gifts-section, .forhim-section,
    .occasion-section, .promise-section, .reviews-section,
    .editorial, .shop-style { padding-left: 12px; padding-right: 12px; }

    /* Product grids */
    .reya-grid, .products-grid, .bs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Product card tweaks */
    .prod-card .prod-name { font-size: 13px; }
    .prod-card .price { font-size: 15px; }
    .prod-card .card-body { padding: 8px 8px 12px; }
    .prod-card .metal-row { display: none; }

    /* Style row: 2-col stays */
    .style-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .style-card .label { font-size: 16px; }

    /* Forever slider */
    .forever-card { min-width: 200px; }
    .forever-card .fc-img { width: 200px; height: 260px; }
    .gift-card { width: 210px; height: 290px; }

    /* Product details */
    .pd-container { grid-template-columns: 1fr !important; gap: 16px !important; }
    .pd-main-image { height: 300px; }
    .pd-thumbnails { flex-direction: row; overflow-x: auto; }
    .pd-title { font-size: 1.3rem; }
    .pd-price { font-size: 1.3rem; }
    .pd-actions { flex-direction: column; gap: 10px; }
    .pd-actions .btn, .pd-actions button { width: 100%; }
    .trust-price-row { grid-template-columns: 1fr !important; }
    .rec-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

    /* Cart */
    .cart-content { grid-template-columns: 1fr; gap: 16px; }
    .cart-header h1 { font-size: 24px; }
    .cart-items { padding: 16px; }
    .cart-item { flex-wrap: wrap; gap: 12px; padding: 14px 0; }
    .item-image { width: 70px; height: 70px; min-width: 70px; }
    .item-details { flex: 1; min-width: calc(100% - 90px); }
    .item-quantity { min-width: auto; margin-left: 82px; }
    .item-total { min-width: auto; margin-left: auto; }
    .cart-summary { padding: 16px; }

    /* Checkout */
    .checkout-grid, .checkout-layout { grid-template-columns: 1fr !important; gap: 20px; }
    .checkout-form-section, .checkout-summary-section { width: 100% !important; }

    /* Wishlist */
    .wishlist-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
    .wishlist-card .product-img-wrap { height: 180px; }

    /* Reviews */
    .reviews-section { flex-direction: column; gap: 16px; padding: 20px 12px; }
    .reviews-left-img { width: 100%; height: 220px; flex: none; }
    .reviews-right-content { margin-left: 0; width: 100%; }
    .review-card { flex: 0 0 250px; padding: 20px; }

    /* Blog */
    .blog-grid { flex-direction: column; }
    .blog-card { height: auto; }
    .blog-card .blog-img { height: 170px; }
    .blog-card .blog-title { font-size: 17px; }

    /* Occasions */
    .occasion-grid { grid-template-columns: 1fr; gap: 20px; }
    .occasion-card .occ-img { height: 270px; }
    .occasion-card .occ-info { width: 90%; padding: 14px; margin-top: -36px; }

    /* Promise: 2-col stays, just smaller */
    .promise-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 12px; }
    .promise-item { padding: 32px 10px 16px; }

    /* Forhim: stack */
    .forhim-grid { grid-template-columns: 1fr; gap: 16px; }
    .forhim-card { height: 320px; }

    /* Footer */
    .reya-footer { padding: 28px 16px 0 !important; }
    .footer-top {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .footer-col, .footer-newsletter { width: 100% !important; max-width: 100% !important; }
    .nl-form { flex-direction: column; }
    .nl-form input { width: 100%; border-radius: 6px; }
    .nl-form button { width: 100%; border-radius: 6px; }
    .footer-brand .brand-name { font-size: 32px; }
    .footer-col ul li a { font-size: 14px; }
    .footer-col h4 { font-size: 18px; margin-bottom: 12px; }

    /* About page editorial */
    .editorial-inner { flex-direction: column; gap: 20px; }
    .editorial-images { width: 100% !important; }
    .editorial-text h2 { font-size: 26px; }

    /* Login / Register / Profile / OTP */
    .auth-card, .login-card, .register-card, .otp-card, .profile-card {
        padding: 24px 18px !important;
        margin: 20px 16px !important;
    }

    /* Orders */
    .orders-container, .orders-layout {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .order-card { flex-wrap: wrap; }

    /* FAQ */
    .faq-layout { grid-template-columns: 1fr !important; }
    .faq-item { padding: 16px; }
    .faq-question { font-size: 15px; }
    .faq-answer { font-size: 14px; }

    /* Jewellery listing */
    .listing-main-layout { grid-template-columns: 1fr; }
    .listing-utility-bar { padding: 12px 16px; }
    .listing-utility-bar .utility-inner { flex-wrap: wrap; gap: 10px; }
    .sort-control, .count-control { font-size: 13px; }

    /* Store / Map page */
    .store-grid { grid-template-columns: 1fr !important; }
    .store-map-wrap { height: 280px; }

    /* Images overflow prevention */
    .reya-page img, .reya-page video { max-width: 100%; height: auto; }
}

/* ────────────────────────────────────────
   PHONE  (≤ 480px)
──────────────────────────────────────── */
@media (max-width: 480px) {

    /* Hero */
    .hero-slider { height: 280px; }
    .hero-content h2 { font-size: 1.3rem; }
    .hero-btn { font-size: 13px; min-width: 130px; height: 42px; padding: 10px 16px; }
    .hero-dot { width: 8px; height: 8px; }
    .hero-dot.active { width: 22px; }

    /* Category icons */
    .category-icon-circle { width: 60px; height: 60px; }
    .category-icon-circle img { width: 40px; height: 40px; }
    .category-icon-item h4 { font-size: 0.65rem; }

    /* Product cards */
    .product-card-new { border-radius: 12px; }
    .product-content { padding: 10px; }
    .product-content h3 { font-size: 0.8rem; }
    .current-price { font-size: 0.85rem; }
    .old-price { font-size: 0.7rem; }
    .add-to-cart-btn { width: 30px; height: 30px; font-size: 0.7rem; }

    /* Buttons */
    .btn { padding: 10px 20px; font-size: 0.8rem; }
    .btn-outline { padding: 10px 20px; font-size: 0.8rem; }

    /* Instagram */
    .insta-grid { grid-template-columns: repeat(2, 1fr); }

    /* Collection */
    .collection-grid { grid-template-columns: 1fr; }
    .collection-card { height: 200px; }

    /* Savings */
    .savings-v3-title { font-size: 1.5rem; }

    /* Featured banner */
    .featured-banner-card { height: 220px; }

    /* Try-on */
    .tryon-title { font-size: 1.5rem; }

    /* Logo */
    .logo-text .brand-name { font-size: 1.1rem; }

    /* Container */
    .container { padding: 0 16px; }

    /* Cart item */
    .cart-item { flex-wrap: wrap; }
    .cart-item-image { width: 80px; height: 80px; }

    /* Promise: single col on very small */
    .promise-grid { grid-template-columns: 1fr; }

    /* Forhim card height */
    .forhim-card { height: 260px; }
    .forhim-card .card-info h3 { font-size: 22px; }
}

/* ────────────────────────────────────────
   SMALL PHONES  (≤ 400px)
──────────────────────────────────────── */
@media (max-width: 400px) {

    /* Hero */
    .hero-slider { height: 340px; }
    .hero-content h1 { font-size: 20px; }

    /* Products: keep 2-col but tighter */
    .reya-grid, .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .prod-card .prod-name { font-size: 12px; }

    /* Promise: 1 col on tiny screens */
    .promise-grid { grid-template-columns: 1fr; }

    /* Cart */
    .item-image { width: 60px; height: 60px; min-width: 60px; }
    .qty-btn { width: 28px; height: 28px; }
    .qty-input { width: 34px; height: 28px; }

    /* Footer brand */
    .footer-brand .brand-name { font-size: 26px; }

    /* Typography */
    .sec-head h2 { font-size: 22px; }
    .page-header h1 { font-size: 22px; }
    .editorial-text h2 { font-size: 22px; }
}

/* ────────────────────────────────────────
   SIDEBAR OVERLAY BACKDROP
──────────────────────────────────────── */
.sidebar-overlay-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
}
.sidebar-overlay-backdrop.active { display: block; }

/* ────────────────────────────────────────
   MOBILE FILTER BUTTON: hidden on desktop
──────────────────────────────────────── */
@media (min-width: 769px) {
    .mobile-filter-btn { display: none !important; }
    .sidebar-close { display: none !important; }
}