/* Product Listing Page Styles */
.listing-page {
    padding: 40px 0 60px;
    background: var(--color-stone, #FAF8F5);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.listing-header {
    margin-bottom: 40px;
    text-align: center;
}

.listing-title {
    font-family: var(--font-serif, "Cormorant Garamond", serif);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-charcoal, #121111);
    margin-bottom: 12px;
}

.listing-breadcrumb {
    font-size: 0.85rem;
    color: var(--color-muted, #85827D);
}

.listing-breadcrumb a {
    color: var(--color-gold, #C5A880);
    text-decoration: none;
    transition: color 0.2s;
}

.listing-breadcrumb a:hover {
    color: var(--color-gold-dark, #A3845B);
}

.listing-breadcrumb .separator {
    margin: 0 8px;
}

.listing-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Sidebar Styles */
.listing-sidebar {
    height: fit-content;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid rgba(197, 168, 128, 0.22);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(197, 168, 128, 0.22);
    padding: 0px 10px;
    min-height: 40px;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-charcoal, #121111);
}

.clear-all-filters {
    background: none;
    border: none;
    color: var(--color-gold, #C5A880);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.clear-all-filters:hover {
    color: var(--color-gold-dark, #A3845B);
}

.filter-section {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(197, 168, 128, 0.22);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-charcoal, #121111);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-categories {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.category-link {
    color: var(--color-muted, #85827D);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    padding: 4px 0;
    border: none;
    background-color: transparent;
    text-align: start;
}

.category-link:hover,
.category-link.active {
    color: var(--color-gold, #C5A880);
    padding-left: 8px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
    font-size: 0.85rem;
    color: var(--color-muted, #85827D);
    transition: color 0.2s;
}

.filter-checkbox:hover {
    color: var(--color-charcoal, #121111);
}

.filter-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #ffffff;
    border: 1px solid rgba(197, 168, 128, 0.3);
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-checkbox:hover input~.checkmark {
    border-color: var(--color-gold, #C5A880);
}

.filter-checkbox input:checked~.checkmark {
    background-color: var(--color-gold, #C5A880);
    border-color: var(--color-gold, #C5A880);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.filter-checkbox input:checked~.checkmark:after {
    display: block;
}

.filter-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--color-muted, #85827D);
}

/* Main Content Area */
.listing-main {
    min-width: 0;
}

.listing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(197, 168, 128, 0.22);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-stone, #FAF8F5);
    border: 1px solid rgba(197, 168, 128, 0.22);
    border-radius: 8px;
    color: var(--color-charcoal, #121111);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-filter-btn:hover {
    border-color: var(--color-gold, #C5A880);
    color: var(--color-gold, #C5A880);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--color-gold, #C5A880);
    color: var(--color-charcoal, #121111);
    font-size: 0.75rem;
    border-radius: 20px;
}

.filter-tag button {
    background: none;
    border: none;
    color: var(--color-charcoal, #121111);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    width: 100%;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted, #85827D);
}

.search-input {
    padding: 10px 12px 10px 40px;
    background: var(--color-stone, #FAF8F5);
    border: 1px solid rgba(197, 168, 128, 0.22);
    border-radius: 8px;
    color: var(--color-charcoal, #121111);
    font-size: 0.85rem;
    width: 240px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-gold, #C5A880);
}

.sort-select {
    padding: 10px 12px;
    background: var(--color-stone, #FAF8F5);
    border: 1px solid rgba(197, 168, 128, 0.22);
    border-radius: 8px;
    color: var(--color-charcoal, #121111);
    font-size: 0.85rem;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-gold, #C5A880);
}

/* Products Grid - FIXED */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Product Card */

@media(max-width: 540px) {

    .products-grid>.product-card {
        min-width: unset;
    }


}

.product-card {
    background: #ffffff;
    border: 1px solid rgba(197, 168, 128, 0.22);
    border-radius: 0;
    overflow: hidden;
    transition: all 0.35s ease;
    text-decoration: none;
    color: unset;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 168, 128, 0.45);
}

.product-card__image-wrapper {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--color-stone, #FAF8F5);
}

.product-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.65s ease;
}

.product-card:hover .product-card__image {
    transform: scale(1.04);
}

.product-card__actions {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 2;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.35s ease;
}

.product-card:hover .product-card__actions {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 600px) {
    .product-card .product-card__actions {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-card__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: #ffffff;
    border: 1px solid rgba(197, 168, 128, 0.22);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-charcoal, #121111);
}

.product-card__action-btn--cart {
    background: var(--color-charcoal, #121111);
    color: #ffffff;
    border: none;
}

.product-card__action-btn--cart:hover {
    background: var(--color-gold, #C5A880);
    color: var(--color-charcoal, #121111);
}

.product-card__action-btn--wishlist:hover {
    background: var(--color-gold, #C5A880);
    border-color: var(--color-gold, #C5A880);
    color: #ffffff;
}

.product-card__info {
    padding: 1rem;
    text-align: center;
}

.product-card__category {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-muted, #85827D);
    margin-bottom: 0.5rem;
}

.product-card__category a {
    color: inherit;
    text-decoration: none;
}

.product-card__title {
    font-family: var(--font-serif, "Cormorant Garamond", serif);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-card__title a {
    color: var(--color-charcoal, #121111);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card:hover .product-card__title a {
    color: var(--color-gold, #C5A880);
}

.product-card__price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.product-card__price-current {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gold-dark, #A3845B);
}

.product-card__price-compare {
    font-size: 0.75rem;
    color: var(--color-muted, #85827D);
    text-decoration: line-through;
}

/* List View */
.products-grid--list {
    display: flex;
    flex-direction: column;
}

.products-grid--list .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

.products-grid--list .product-card__image-wrapper {
    aspect-ratio: 1;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 40px;
    color: var(--color-muted, #85827D);
}

.loading-indicator:empty {
    display: none;
}

/* Mobile Filter Drawer */
.close-filter-drawer {
    background: none;
    border: none;
    color: var(--color-muted, #85827D);
    cursor: pointer;
    padding: 8px;
    display: none;
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(197, 168, 128, 0.22);
    color: var(--color-charcoal, #121111);
}

.btn-primary {
    background: var(--color-gold, #C5A880);
    border: none;
    color: #fff;
}

/* Overlay for mobile filter */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.filter-section-price-range {
    padding: 40px 30px 0px 30px;
}

.sidebar-footer {
    border-top: 1px solid #ddd;
    justify-content: space-between;
    padding: 10px;
    display: none;
}

.sidebar-footer>button {
    padding: 5px 15px;
    border-radius: 30px;
}

.listing-sidebar.open {
    left: 0%;
    visibility: visible;
    opacity: 100;
    pointer-events: all;
}

/* Responsive */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .listing-layout {
        grid-template-columns: 1fr;
    }

    .listing-sidebar {
        position: fixed;
        top: 0px;
        left: -100%;
        width: 100%;
        max-width: 300px;
        background-color: #fff;
        z-index: 999999;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100%;
        border: none;
        border-radius: 0px;
        box-shadow: 6px 0px 9px 4px rgb(121 93 55 / 22%);
        transition: all 0.3s ease;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .search-input {
        width: 180px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

.mobile-filter {
    display: none;
}

.sidebar-body {
    padding: 10px;
    overflow-y: auto;
}

.sidebar-overlay.open {
    pointer-events: all;
    opacity: 100;
    visibility: visible;
}

@media (max-width: 640px) {
    .sidebar-overlay {
        position: fixed;
        width: 100%;
        height: 100%;
        background-color: #0000004d;
        top: 0px;
        z-index: 9999;
        pointer-events: none;
        opacity: 0;
        transition: 0.3s all ease;
        visibility: hidden;
    }

    .listing-page {
        padding: 20px 0 40px;
    }

    .listing-title {
        font-size: 1.8rem;
    }

    .listing-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        flex-direction: column;
    }

    .search-wrapper {
        flex: 1;
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mobile-filter {
        position: fixed;
        width: 50%;
        bottom: 0px;
        z-index: 99;
        left: 0px;
        height: 50px;
        border-top: 1px solid #ddd;
        border-right: 1px solid #ddd;
        display: flex;
    }

    .mobile-filter>button {
        border: none;
        width: 100%;
        background-color: #fff;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        height: 100%;
        gap: 5px;
    }

    .mobile-filter>button>svg {
        width: 15px;
        height: 15px;
        color: #e0bc71;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
        margin-left: -20px;
        transform: translate(10px, 0px);
    }
}

@media (max-width: 600px) {
    .close-filter-drawer {
        display: inline-block;
    }

    .sidebar-footer {
        display: flex;
    }

    .sort-wrapper {
        position: fixed;
        bottom: 0px;
        z-index: 99;
        width: 50%;
        right: 0px;
        background-color: #fff;
        border-top: 1px solid #ddd;
        height: 50px;
    }

    .sort-select {
        width: 100%;
        border: none;
        background-color: transparent;
        height: 100%;
    }
}