/* =========================================================
   PAGE HEAD
========================================================= */
.page-head {
    padding: 1.5rem 0 1.25rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-head h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 .25rem;
    color: var(--primary);
}

.page-head p {
    color: var(--muted);
    margin: 0;
    font-size: .85rem;
}

.page-head .count-badge {
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: .75rem;
    font-weight: 700;
    padding: .35rem .75rem;
    border-radius: var(--radius-pill);
}

/* =========================================================
   LAYOUT
========================================================= */
.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
    padding-bottom: 3rem;
}

@media(max-width:991.98px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   SIDEBAR FILTERS
========================================================= */
.filters {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: sticky;
    top: 200px;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

@media(max-width:991.98px) {
    .filters {
        position: static;
        max-height: none;
        display: none;
    }
}

.filters-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.filters-head h6 {
    margin: 0;
    font-size: .95rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -.01em;
}

.filters-head .clear-all {
    font-size: .72rem;
    font-weight: 700;
    color: var(--secondary);
    cursor: pointer;
    border: 0;
    background: transparent;
    transition: color var(--t-fast);
}

.filters-head .clear-all:hover {
    color: var(--secondary-hover);
}

.filter-group {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.filter-group:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.filter-group h6 {
    font-size: .78rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-group h6 i {
    transition: transform var(--t-fast);
    font-size: .8rem;
    color: var(--muted);
}

.filter-group.collapsed h6 i {
    transform: rotate(-90deg);
}

.filter-group.collapsed .filter-body {
    display: none;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .4rem .35rem;
    border-radius: 6px;
    font-size: .82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--t-fast);
    user-select: none;
}

.filter-option:hover {
    background: var(--surface-muted);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    accent-color: var(--secondary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.filter-option .count {
    margin-left: auto;
    font-size: .72rem;
    color: var(--muted);
}

.filter-option.checked {
    color: var(--primary);
    font-weight: 600;
}

/* Price range */
.price-range {
    padding: .25rem 0;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}

.price-inputs input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem .65rem;
    font-size: .8rem;
    outline: 0;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    width: 0;
}

.price-inputs input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(63, 118, 80, .1);
}

.price-inputs span {
    color: var(--muted);
    font-size: .8rem;
}

.price-slider {
    width: 100%;
    accent-color: var(--secondary);
    margin-top: .35rem;
}

.range-label {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--muted);
    margin-top: .25rem;
}

/* Rating filter */
.rating-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .35rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--t-fast);
    font-size: .82rem;
}

.rating-option:hover {
    background: var(--surface-muted);
}

.rating-option .stars {
    color: var(--rating);
    letter-spacing: 1px;
    font-size: .85rem;
}

/* Mobile filter trigger */
.filter-trigger {
    display: none;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .8rem 1rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--t-fast);
}

.filter-trigger:hover {
    border-color: var(--primary);
}

@media(max-width:991.98px) {
    .filter-trigger {
        display: flex;
    }
}

/* Mobile filter drawer */
.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 19, 13, .5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t), visibility var(--t);
    backdrop-filter: blur(2px);
}

.filter-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: #fff;
    z-index: 1060;
    transform: translateX(-100%);
    transition: transform var(--t-slow) cubic-bezier(.2, .7, .3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.filter-drawer.open {
    transform: translateX(0);
}

.filter-drawer .drawer-head {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-drawer .drawer-head h5 {
    margin: 0;
    font-weight: 800;
    font-size: 1rem;
}

.filter-drawer .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.filter-drawer .drawer-body .filters {
    display: block;
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0;
    max-height: none;
}

.filter-drawer .drawer-foot {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
    display: flex;
    gap: .5rem;
}

/* =========================================================
   TOOLBAR
========================================================= */
.toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .85rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.toolbar .left {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.toolbar .right {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.toolbar label {
    font-size: .78rem;
    color: var(--muted);
    margin: 0;
}

.toolbar select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: .82rem;
    color: var(--text);
    background: #fff;
    outline: 0;
    cursor: pointer;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.toolbar select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(63, 118, 80, .1);
}

.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.view-toggle button {
    border: 0;
    background: transparent;
    padding: .5rem .7rem;
    color: var(--muted);
    cursor: pointer;
    font-size: .95rem;
    transition: all var(--t-fast);
}

.view-toggle button:hover {
    color: var(--primary);
}

.view-toggle button.active {
    background: var(--primary);
    color: #fff;
}

.result-count {
    font-size: .82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.result-count b {
    color: var(--primary);
}

/* =========================================================
   ACTIVE FILTER CHIPS
========================================================= */
.active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
    padding: .35rem .7rem;
    border-radius: var(--radius-pill);
    transition: all var(--t-fast);
}

.chip .close {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--muted);
    border: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: .65rem;
    padding: 0;
    transition: all var(--t-fast);
}

.chip .close:hover {
    background: var(--danger);
    color: #fff;
}

.chip-clear-all {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--secondary);
    font-size: .75rem;
    font-weight: 700;
    padding: .35rem .75rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--t-fast);
}

.chip-clear-all:hover {
    border-color: var(--secondary);
    background: var(--secondary-50);
}

/* =========================================================
   PRODUCT GRID
========================================================= */
.product-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, 1fr);
}

@media(max-width:1199.98px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width:767.98px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .75rem;
    }
}

@media(max-width:400px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* List view */
.product-grid.list-view {
    grid-template-columns: 1fr;
    gap: .75rem;
}

.product-grid.list-view .product-card {
    flex-direction: row;
}

.product-grid.list-view .product-media {
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: 1/1;
}

.product-grid.list-view .product-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem 1.5rem;
}

.product-grid.list-view .product-title {
    font-size: 1rem;
    min-height: auto;
    margin-bottom: .5rem;
    -webkit-line-clamp: 3;
}

.product-grid.list-view .product-desc {
    display: block;
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: .75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-grid.list-view .product-foot {
    padding-top: 0;
    justify-content: flex-start;
    gap: 1.5rem;
}

.product-grid.list-view .cart-btn {
    width: auto;
    padding: 0 1rem;
    height: 36px;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 700;
}

.product-grid.list-view .cart-btn::after {
    content: 'Add to Cart';
}

@media(max-width:575.98px) {
    .product-grid.list-view .product-media {
        width: 120px;
    }

    .product-grid.list-view .product-body {
        padding: .75rem;
    }

    .product-grid.list-view .product-desc {
        display: none;
    }

    .product-grid.list-view .cart-btn::after {
        content: '';
    }

    .product-grid.list-view .cart-btn {
        width: 36px;
        padding: 0;
    }
}

/* Product card (shared) */
.product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: cardIn .35s ease both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.product-media {
    position: relative;
    background: #f2eee9;
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.2, .7, .3, 1);
}

.product-card:hover .product-media img {
    transform: scale(1.07);
}

.discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    border-radius: 6px;
    padding: .3rem .5rem;
    z-index: 2;
}

.wishlist {
    position: absolute;
    top: 9px;
    right: 9px;
    background: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--muted);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border: 0;
    transition: all var(--t-fast);
    z-index: 2;
}

.wishlist:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.wishlist.active {
    color: var(--danger);
}

.product-body {
    padding: .9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-cat {
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: .35rem;
}

.product-title {
    font-size: .85rem;
    font-weight: 700;
    min-height: 40px;
    line-height: 1.35;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    display: none;
}

.stars {
    color: var(--rating);
    font-size: .72rem;
}

.product-foot {
    margin-top: auto;
    padding-top: .6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

.price {
    color: var(--primary);
    font-weight: 800;
    font-size: 1rem;
}

.old-price {
    color: #999;
    text-decoration: line-through;
    font-size: .72rem;
    margin-left: .25rem;
}

.cart-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--t-fast);
    flex-shrink: 0;
}

.cart-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* Skeleton */
.skeleton-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    height: 100%;
}

.skeleton {
    background: linear-gradient(90deg, #f0edea 0%, #e6e0da 50%, #f0edea 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-media {
    aspect-ratio: 1/1;
}

.skeleton-line {
    height: 12px;
    margin: .5rem 1rem;
}

.skeleton-line.short {
    width: 50%;
}

/* =========================================================
   NO RESULTS
========================================================= */
.no-products {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.no-products i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

.no-products h5 {
    color: var(--text);
    font-weight: 700;
    margin-bottom: .35rem;
}

.no-products .btn {
    margin-top: 1rem;
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: .7rem 1.5rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t);
}

.no-products .btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* =========================================================
   PAGINATION
========================================================= */
.pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0 0;
}

.pagination {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination button {
    min-width: 40px;
    height: 40px;
    padding: 0 .75rem;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
}

.pagination button:hover:not(:disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.pagination .ellipsis {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 700;
}

.pagination-info {
    font-size: .78rem;
    color: var(--muted);
}