/* ============================================================
   RAJSHREE JEWELLERS — FULLY RESPONSIVE CSS
   Mobile-first approach. Breakpoints: 992 | 768 | 480 | 375
   ============================================================ */

/* ===== TABLET & MOBILE NAVIGATION (≤992px) ===== */
@media (max-width: 992px) {

    /* Mobile dropdown accordion styling */
    .nav-dropdown {
        display: none;
        position: static !important;
        transform: none !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: none !important;
        border-left: 2px solid var(--text-gold) !important;
        border-radius: 0 !important;
        padding: 5px 0 5px 15px !important;
        min-width: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        box-shadow: none !important;
        width: 100% !important;
        transition: none !important;
    }
    .nav-dropdown::before { display: none !important; }
    .nav-dropdown a {
        padding: 8px 0 !important;
        font-size: 0.8rem !important;
        border: none !important;
        background: none !important;
        color: var(--text-cream) !important;
    }
    .nav-dropdown a:hover {
        padding-left: 5px !important;
        color: var(--text-gold) !important;
    }
    .nav-chevron {
        display: inline-block !important;
        transition: transform 0.3s ease;
    }

    .navbar .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 75%;
        max-width: 320px;
        background: rgba(3, 12, 8, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 3rem 2rem;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 99;
        box-shadow: -4px 0 30px rgba(0,0,0,0.6);
        border-left: 1px solid rgba(212, 175, 55, 0.15);
    }

    /* Mobile nav overlay backdrop */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 98;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .navbar .nav-links.nav-active {
        right: 0;
    }

    .nav-links ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links ul li {
        width: 100%;
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    }

    .nav-links ul li a {
        display: block;
        padding: 1rem 0;
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    /* Mobile Collections accordion */
    .mobile-dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding: 1rem 0;
        font-size: 0.9rem;
        letter-spacing: 2px;
        color: var(--text-cream);
        text-transform: uppercase;
        width: 100%;
        border: none;
        background: none;
    }
    .mobile-dropdown-toggle .nav-chevron {
        display: inline-block !important;
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }
    .mobile-dropdown-toggle.open .nav-chevron {
        transform: rotate(180deg);
    }
    .mobile-sub-menu {
        display: none;
        flex-direction: column;
        padding: 0.5rem 0 1rem 1rem;
        gap: 0;
        border-left: 1px solid rgba(212, 175, 55, 0.2);
        margin-left: 0.5rem;
    }
    .mobile-sub-menu.open {
        display: flex;
    }
    .mobile-sub-menu a {
        padding: 0.6rem 0;
        font-size: 0.75rem;
        letter-spacing: 1.5px;
        color: var(--text-cream) !important;
        display: flex;
        align-items: center;
        gap: 8px;
        border: none !important;
    }
    .mobile-sub-menu a:hover {
        color: var(--text-gold) !important;
    }

    .hamburger {
        display: block;
        z-index: 100;
    }

    .hamburger .line {
        width: 25px;
        height: 2px;
        background-color: var(--text-gold);
        margin: 6px 0;
        transition: 0.3s;
        border-radius: 2px;
    }

    .hamburger.active .line:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
    .hamburger.active .line:nth-child(2) { opacity: 0; }
    .hamburger.active .line:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

    .hero-content .main-title { font-size: 3.2rem; }
    .nav-icons { gap: 1rem; }
    .profile-icon { margin-left: 0; }

    /* Gold ticker shorter on tablet */
    .gold-ticker { height: 30px; font-size: 0.75rem; }
    .navbar { top: 30px; }

    /* Product Grid — 2 columns on tablet landscape/portrait */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* ===== TABLET & MOBILE COMMON (≤768px) ===== */
@media (max-width: 768px) {

    /* Typography */
    .main-title { font-size: 2.6rem !important; line-height: 1.2; }
    .section-title { font-size: 1.8rem; }
    .section-padding { padding: 3.5rem 0; }

    /* Grids */
    .new-category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .footer-brand { align-items: center; display: flex; flex-direction: column; }
    .social-icons { justify-content: center; }

    /* Collection Layout — stack sidebar above grid */
    .collection-layout { grid-template-columns: 1fr; }
    .sidebar {
        margin-bottom: 0;
        position: static;
        /* Hide on mobile by default — shown via filter button */
        display: none;
    }
    .sidebar.mobile-open {
        display: block;
        position: fixed;
        inset: auto 0 0 0;
        z-index: 500;
        background: rgba(3, 12, 8, 0.99);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(212, 175, 55, 0.3);
        border-radius: 20px 20px 0 0;
        padding: 1.5rem 1.5rem 2rem;
        max-height: 85vh;
        overflow-y: auto;
        animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 499;
    }

    /* Floating Filter Button */
    .mobile-filter-fab {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 450;
        background: linear-gradient(135deg, #d4af37, #a8841a);
        color: #0a1f14;
        border: none;
        padding: 14px 28px;
        border-radius: 50px;
        font-family: var(--font-body);
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 2px;
        text-transform: uppercase;
        cursor: pointer;
        box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }
    .mobile-filter-fab:active { transform: translateX(-50%) scale(0.95); }

    /* Sidebar close button */
    .sidebar-close-btn {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    }
    .sidebar-close-btn h3 {
        font-family: var(--font-heading);
        color: var(--text-gold);
        font-size: 1.3rem;
    }
    .sidebar-close-btn button {
        background: none;
        border: 1px solid rgba(212,175,55,0.3);
        color: var(--text-gold);
        width: 32px; height: 32px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1rem;
        display: flex; align-items: center; justify-content: center;
    }

    /* Product Grid — 2 columns on tablet */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .product-card .img-wrapper { height: 200px; }
    .details { padding: 0.9rem 1rem 1.1rem; }
    .details h4 { font-size: 0.9rem; }
    .details .price { font-size: 1rem; }
    .details .add-to-cart { font-size: 0.65rem; padding: 10px 12px; letter-spacing: 1px; }

    /* Product slider (homepage) */
    .product-slider {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .product-card.reveal-card .img-wrapper { height: 220px; }

    /* Product Detail */
    .product-detail-wrapper { grid-template-columns: 1fr; gap: 2rem; }
    .detail-img-container { height: 320px; }
    .gallery-container { position: static !important; }
    #detail-main-img.zoomed { transform: none !important; }
    .detail-img-container { pointer-events: none; }
    .detail-thumbnails { gap: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .detail-thumb { width: 64px; height: 64px; flex-shrink: 0; }

    /* Sticky buy bar on mobile product detail */
    .sticky-buy-bar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: rgba(3, 12, 8, 0.97);
        backdrop-filter: blur(12px);
        border-top: 1px solid rgba(212,175,55,0.25);
        padding: 14px 20px;
        z-index: 400;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .sticky-buy-bar .sticky-price {
        font-family: var(--font-heading);
        color: var(--text-gold);
        font-size: 1.3rem;
    }
    .sticky-buy-bar .btn-gold {
        flex: 1;
        max-width: 200px;
        text-align: center;
    }

    /* Cart & Checkout */
    .cart-layout { grid-template-columns: 1fr; }
    .checkout-grid { grid-template-columns: 1fr; }

    /* Timeline fix */
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item:nth-child(even) { left: 0; text-align: left; }
    .timeline-item:nth-child(odd) { text-align: left; }
    .timeline-dot { left: 22px; right: auto; }
    .timeline-item:nth-child(odd) .timeline-dot { left: 22px; right: auto; }

    /* Contact */
    .split-layout { grid-template-columns: 1fr; }

    /* Modals */
    .cart-modal { width: 95%; padding: 1.5rem; }

    /* FAQ */
    .faq-grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer { padding-bottom: 80px; } /* space for FAB */

    /* Hero adjustments */
    .hero-content { padding-top: 60px; padding-left: 1rem; padding-right: 1rem; }
    .description { font-size: 0.95rem; max-width: 90%; margin: 0 auto; }
    .btn-luxury { font-size: 0.7rem; padding: 14px 28px; }
}

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

    /* Typography */
    .main-title { font-size: 2rem !important; }
    .section-title { font-size: 1.5rem; }

    /* Category grid: 1 column */
    .new-category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Product grid: 2 columns (tight) */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-card .img-wrapper { height: 160px; }
    .details { padding: 0.7rem 0.7rem 0.9rem; }
    .details h4 { font-size: 0.8rem; line-height: 1.3; }
    .details .price { font-size: 0.85rem; }
    .details .add-to-cart { font-size: 0.6rem; padding: 8px 10px; letter-spacing: 0.8px; }
    .weight-badge { font-size: 0.6rem; }
    .product-badge { font-size: 0.55rem; padding: 3px 7px; }

    /* Homepage slider: 1 column */
    .product-slider {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .product-card.reveal-card .img-wrapper { height: 260px; }

    /* Wishlist button smaller */
    .wishlist-btn { width: 32px; height: 32px; font-size: 0.75rem; }

    /* Gold ticker — hide on very small screens */
    .gold-ticker { display: none; }
    .navbar { top: 0; }

    /* Nav icons spacing */
    .nav-icons { gap: 12px; }
    .brand-logo a { font-size: 1.4rem; }

    /* Hero */
    .hero-content { padding-top: 40px; }
    .description { font-size: 0.9rem; }
    .scroll-indicator { bottom: 80px; }

    /* Cart table responsive */
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr {
        margin-bottom: 1rem;
        border: 1px solid rgba(212, 175, 55, 0.2);
        padding: 1rem;
        background: rgba(255,255,255,0.02);
        border-radius: 8px;
    }
    .cart-table td {
        text-align: right;
        padding: 0.5rem 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .cart-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: var(--text-gold);
        text-transform: uppercase;
        font-size: 0.75rem;
    }
    .cart-table td[data-label="Product"] { justify-content: flex-start; gap: 1rem; }

    /* Sidebar filter on mobile — full width */
    .sidebar.mobile-open { padding: 1.2rem 1rem 2rem; }
    .filter-btn { font-size: 0.8rem; padding: 8px 14px; }

    /* Checkout form */
    .checkout-grid { gap: 1.5rem; }
    .form-group input, .form-group textarea, .form-group select {
        font-size: 0.9rem;
    }
}

/* ===== EXTRA SMALL (≤375px) ===== */
@media (max-width: 375px) {
    .main-title { font-size: 1.7rem !important; }
    .brand-logo a { font-size: 1.2rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card .img-wrapper { height: 140px; }
    .details h4 { font-size: 0.72rem; }
    .details .price { font-size: 0.78rem; }
    .details .add-to-cart { display: none; } /* Too tight — shown on hover/tap via other means */
    .nav-icons { gap: 8px; }
}

/* ===== DESKTOP DROPDOWN HOVER FIX ===== */
@media (min-width: 993px) {
    /* Ensure desktop dropdown works correctly */
    .nav-links ul li { position: relative; }
    .nav-dropdown { position: absolute; }
    .mobile-filter-fab { display: none; }
    .sidebar { display: block !important; }
}