﻿/* ==========================================================================
   1. GLOBAL DESIGN VARIABLES & RESET
   ========================================================================== */
:root {
    --color-bg-canvas: #eaf0f0;
    --color-bg-card: #ffffff;
    --color-bg-panel: #f5efe2;
    --color-bg-summary: #fafafa;
    --color-text-primary: #111111;
    --color-text-secondary: #555555;
    --color-text-muted: #76726c;
    --color-text-light: #999999;
    --color-brand-gold: #bf9b62;
    --color-border-premium: #e8e5e0;
    --color-border-light: #f0f0f0;
    --color-star-rating: #ffb400;
    --font-sans-premium: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --page-padding-desktop: 0 4%;
    --page-padding-mobile: 0 15px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg-canvas);
    color: var(--color-text-primary);
    font-family: var(--font-sans-premium);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   2. PAGE SETUP & TITLES
   ========================================================================== */
.shop-page, .category-section-wrapper, .wishlist-container, .reviews-section {
    margin-top: 0px;
    padding: var(--page-padding-desktop);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.section-title-main, .category-main-heading, .wishlist-header h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
    text-align: center;
}

.section-title-sub {
    font-family: var(--font-sans-premium);
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 0px;
    margin-bottom: 30px;
    text-align: center;
}

/* ==========================================================================
   3. NAVIGATION / TOP FILTER BAR
   ========================================================================== */
.shop-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border-premium);
    border-bottom: 1px solid var(--color-border-premium);
    padding: 16px 0;
    margin: 20px 0 40px 0;
    flex-wrap: wrap; /* Allows wrapping on small mobile screens */
    gap: 12px;
}

.filter-btn {
    border: 1px solid var(--color-text-primary);
    background: transparent;
    color: var(--color-text-primary);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
}

/* ==========================================================================
   4. SHOP LAYOUT & GRID (Consolidated)
   ========================================================================== */
.main-shop-content {
    display: flex !important; /* Force side-by-side */
    flex-direction: row;
    gap: 30px;
    padding: 20px 4%;
    align-items: flex-start;
    width: 100%;
}

/* Sidebar Drawer: Full screen on mobile */
.static-sidebar {
    position: fixed;
    top: 0;
    left: -100%; /* Fully off-screen */
    width: 100%; /* Full screen width for mobile */
    height: 100vh;
    z-index: 6000; /* Highest layer */
    background: #fff;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.product-grid {
    flex: 1; /* Takes all available space next to sidebar */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
}

/* ==========================================================================
   5. RESPONSIVE OVERRIDES (Final Cleanup)
   ========================================================================== */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .main-shop-content {
        padding: 15px;
        gap: 15px;
    }

    .shop-page {
        padding: 0 10px;
    }

    .shop-topbar {
        padding: 12px 10px;
        margin: 10px 0 20px 0;
    }

    .static-sidebar {
        position: fixed;
        top: 0;
        left: -320px; /* Hidden by default */
        width: 300px !important;
        height: 100vh;
        z-index: 5999;
        padding: 20px;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-y: auto;
    }

        .static-sidebar.active {
            left: 0; /* Slides into full view */
        }

    /* Overlay: Behind sidebar, but above everything else */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 5999; /* Just below the sidebar */
        display: none;
    }

        .sidebar-overlay.active {
            display: block;
        }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* Maintains 2 clean columns on mobile */
        gap: 12px;
    }
}

@media (max-width: 480px) {
    /* Keep 2 columns even on very narrow phones so product cards don't look giant */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .section-title-main, .category-main-heading, .wishlist-header h2 {
        font-size: 24px;
        letter-spacing: 2px;
    }
}

/* Shared Icon Base Class */
.icon-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Specific Icon Adjustments */
.filter-icon {
    margin-right: 8px;
}

.search-icon {
    cursor: pointer;
    color: var(--color-text-primary);
}

.checkout-icon {
    position: relative;
    font-size: 20px;
}

/* Dynamic Filter Toggle Icons (Used for your Accordion) */
.filter-toggle::after {
    content: '+';
    font-size: 18px;
    color: var(--color-text-muted);
}

.filter-toggle.active::after {
    content: '-';
}

/* Responsive Icon Scaling */
@media (max-width: 576px) {
    .icon-base {
        width: 18px;
        height: 18px;
    }
}

.cart-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #111; /* Dark background */
    color: #fff; /* White text */
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none; /* HIDDEN BY DEFAULT */
    font-size: 14px;
    letter-spacing: 0.5px;
}

    .cart-toast.show {
        display: block;
    }

/* DESKTOP */
@media (min-width: 993px) {
    .static-sidebar {
        position: sticky;
        top: 100px;
        width: 260px;
        flex-shrink: 0;
        height: auto;
        max-height: none;
        overflow: visible;
        display: block !important;
        transform: none !important;
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

#closeFilterBtn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    color: #222;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

.filter-title {
    font-weight: 600;
    padding-top: 10px;
    padding-bottom: 5px;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #ececec;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

#closeFilterBtn:hover {
    background: #e9e9e9;
}

#closeFilterBtn:focus {
    outline: none;
}

/* Container for the rows */
#star-bars-container {
    display: flex;
    flex-direction: column;
}

/* Force the progress bar visual */
.progress {
    display: flex;
    height: 6px;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 3px;
}

.progress-bar {
    background-color: #ffc107 !important;
    height: 100%;
}

/* Ensure alignment */
.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}
