/* ==========================================================================
   DIVINE SIGN — PRODUCTS CATALOG ENGINE (ISOLATED SCOPED STYLES)
   ========================================================================== */

:root {
    --p-bg-main: #0E0E14;
    --p-bg-card: #161622;
    --p-bg-card-hover: #1F1F2E;
    --p-border: rgba(255, 255, 255, 0.12);
    --p-border-gold: rgba(212, 175, 55, 0.35);
    --p-gold: #D4AF37;
    --p-gold-bright: #FFC200;
    --p-gold-gradient: linear-gradient(135deg, #FFD700 0%, #D4AF37 100%);
    --p-text-primary: #FFFFFF;
    --p-text-muted: #CBD5E1;
    --p-text-dark: #94A3B8;
    --p-green: #10B981;
    --p-red: #EF4444;
    --p-radius-sm: 8px;
    --p-radius-md: 14px;
    --p-radius-lg: 20px;
}

/* ── Scope Wrapper ── */
.products-page-wrapper {
    background-color: var(--p-bg-main);
    color: var(--p-text-primary);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
}

/* ── Hero Section ── */
.products-hero-section {
    padding: 120px 0 40px;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.24) 0%, transparent 75%);
    border-bottom: 1px solid var(--p-border);
}

.products-hero-title {
    font-family: 'Inter Tight', 'Cinzel', serif;
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--p-text-primary);
    margin: 0 0 12px 0;
}

.products-hero-title span {
    color: var(--p-gold);
}

.products-hero-subtitle {
    font-size: clamp(14px, 2vw, 17px);
    color: var(--p-text-muted);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Main Catalog Container & Layout ── */
.products-catalog-section {
    padding: 32px 0 80px;
}

.products-main-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 36px;
    align-items: start;
}

/* ── Desktop Controls Header Bar (Search & Sort) ── */
.products-top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--p-bg-card);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-md);
    padding: 12px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.products-search-box {
    position: relative;
    flex: 1;
    max-width: 440px;
}

.products-search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--p-text-muted);
    pointer-events: none;
}

.products-search-input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    color: var(--p-text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
}

.products-search-input:focus {
    border-color: var(--p-gold);
    background: rgba(212, 175, 55, 0.04);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.products-controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.products-count-badge {
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text-muted);
    white-space: nowrap;
}

.products-sort-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.products-sort-label {
    font-size: 13px;
    color: var(--p-text-muted);
    font-weight: 500;
}

.products-sort-select {
    height: 40px;
    padding: 0 32px 0 12px;
    background: rgba(255, 255, 255, 0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23D4AF37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    color: var(--p-text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

.products-sort-select:focus,
.products-sort-select:hover {
    border-color: var(--p-gold);
}

.products-sort-select option {
    background: #141414;
    color: #FFFFFF;
}

/* ── Sidebar Filters (Desktop Fixed 300px) ── */
.products-sidebar-filter {
    background: var(--p-bg-card);
    border: 1px solid var(--p-border-gold);
    border-radius: var(--p-radius-md);
    padding: 24px;
    position: sticky;
    top: 90px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--p-border);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--p-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-reset-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--p-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
}

.sidebar-reset-btn:hover {
    color: var(--p-red);
}

.filter-group-box {
    margin-bottom: 24px;
}

.filter-group-box:last-child {
    margin-bottom: 0;
}

.filter-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--p-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px 0;
}

.filter-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--p-text-muted);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.filter-checkbox-label:hover {
    color: var(--p-text-primary);
}

.filter-checkbox-label input[type="checkbox"],
.filter-checkbox-label input[type="radio"] {
    accent-color: var(--p-gold);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Products Grid ── */
.products-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (min-width: 1280px) {
    .products-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Product Card Component ── */
.products-card {
    background: var(--p-bg-card);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.products-card:hover {
    border-color: var(--p-gold);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.18);
    background: var(--p-bg-card-hover);
}

.card-img-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: radial-gradient(circle at center, #1C1C1C 0%, #0D0D0D 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.card-img-box img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.products-card:hover .card-img-box img {
    transform: scale(1.08);
}

/* Badges on image */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10;
}

.card-badge.bestseller {
    background: #22C55E;
    color: #FFFFFF;
}

.card-badge.new {
    background: var(--p-gold-gradient);
    color: #000000;
}

/* Wishlist Heart Button (Hidden) */
.card-wishlist-btn {
    display: none !important;
}

/* Card Image Zoom Hover Effect */
.card-img-box img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.products-card:hover .card-img-box img {
    transform: scale(1.06);
}

/* Card Info Body */
.card-info-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.card-category-tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--p-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-rating-pill {
    font-size: 11px;
    font-weight: 700;
    color: #FFD700;
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--p-text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.card-title a:hover {
    color: var(--p-gold);
}

.card-fabric-subtitle {
    font-size: 12px;
    color: var(--p-text-muted);
    margin-bottom: 12px;
}

/* Price Row */
.card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    margin-top: auto;
}

.card-price-main {
    font-size: 18px;
    font-weight: 800;
    color: var(--p-text-primary);
}

.card-mrp-strike {
    font-size: 13px;
    color: var(--p-text-dark);
    text-decoration: line-through;
}

.card-discount-badge {
    font-size: 11px;
    font-weight: 800;
    color: var(--p-green);
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

/* Footer / Specs Row */
.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--p-border);
    gap: 8px;
}

.card-color-swatches {
    display: none !important;
}

.swatch-dot {
    display: none !important;
}

.card-add-cart-btn {
    width: 100%;
    height: 38px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    color: var(--p-text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s ease;
}

.card-add-cart-btn:hover {
    background: var(--p-gold-gradient);
    color: #000000;
    border-color: var(--p-gold);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

/* ── Empty State ── */
.products-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--p-bg-card);
    border: 1px dashed var(--p-border);
    border-radius: var(--p-radius-md);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--p-text-primary);
    margin: 0 0 8px 0;
}

.empty-desc {
    font-size: 14px;
    color: var(--p-text-muted);
    margin: 0 0 20px 0;
}

.empty-reset-btn {
    padding: 10px 24px;
    background: var(--p-gold-gradient);
    color: #000000;
    border: none;
    border-radius: var(--p-radius-sm);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* ── Mobile Sticky Toolbar & Filter Drawer ── */
.mobile-sticky-toolbar {
    display: none;
}

.mobile-filter-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-drawer-backdrop.active {
    display: block;
    opacity: 1;
}

.mobile-filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 360px;
    background: #101010;
    border-right: 1px solid var(--p-border-gold);
    z-index: 1101;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
}

.mobile-filter-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--p-border);
}

.drawer-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--p-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.drawer-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--p-text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--p-border);
    display: flex;
    gap: 12px;
    background: #0B0B0B;
}

.drawer-reset-btn {
    flex: 1;
    height: 44px;
    background: transparent;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-sm);
    color: var(--p-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.drawer-apply-btn {
    flex: 2;
    height: 44px;
    background: var(--p-gold-gradient);
    border: none;
    border-radius: var(--p-radius-sm);
    color: #000000;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* ── Quick View Modal ── */
.products-quickview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.products-quickview-modal.active {
    display: flex;
}

.quickview-content {
    background: #141414;
    border: 1px solid var(--p-border-gold);
    border-radius: var(--p-radius-lg);
    width: 100%;
    max-width: 800px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.quickview-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--p-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quickview-img-box {
    aspect-ratio: 1;
    background: #0A0A0A;
    border-radius: var(--p-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quickview-img-box img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.quickview-info-box {
    display: flex;
    flex-direction: column;
}

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 1024px) {
    .products-main-layout {
        grid-template-columns: 260px 1fr;
        gap: 24px;
    }
    
    .products-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 899px) {
    .products-main-layout {
        grid-template-columns: 1fr;
    }

    .products-sidebar-filter {
        display: none; /* Hidden on mobile! Drawer used instead. */
    }

    .products-top-controls {
        display: none;
    }

    /* Mobile Sticky Toolbar */
    .mobile-sticky-toolbar {
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: sticky;
        top: 60px;
        z-index: 90;
        background: #0B0B0B;
        padding: 12px 16px;
        border-bottom: 1px solid var(--p-border);
    }

    .mobile-search-row {
        width: 100%;
        position: relative;
    }

    .mobile-search-row input {
        width: 100%;
        height: 40px;
        padding: 0 16px 0 38px;
        background: #141414;
        border: 1px solid var(--p-border);
        border-radius: 8px;
        color: #FFFFFF;
        font-size: 13px;
        outline: none;
    }

    .mobile-search-row svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--p-text-muted);
    }

    .mobile-action-chips {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-chip-btn {
        height: 36px;
        padding: 0 14px;
        background: #141414;
        border: 1px solid var(--p-border);
        border-radius: 20px;
        color: var(--p-text-primary);
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        white-space: nowrap;
    }

    .mobile-chip-btn.active {
        border-color: var(--p-gold);
        background: rgba(212, 175, 55, 0.12);
        color: var(--p-gold);
    }

    .mobile-count-text {
        font-size: 12px;
        color: var(--p-text-muted);
        margin-left: auto;
        font-weight: 600;
    }

    .products-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 12px !important;
    }

    .products-card {
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    .card-info-body {
        padding: 12px !important;
    }

    .card-title {
        font-size: 14px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
    }

    .card-price-main {
        font-size: 16px !important;
        font-weight: 800 !important;
    }

    .mobile-chip-btn {
        min-height: 44px !important;
        padding: 0 16px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
    }

    .quickview-content {
        grid-template-columns: 1fr !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 20px !important;
    }
}
