:root {
    --bg: #f6f6f6;
    --white: #ffffff;
    --black: #111111;
    --text: #222222;
    --muted: #7d7d7d;
    --line: #dddddd;
    --soft-line: #e9e9e9;
    --accent: #fb5d5d;
    --sidebar-width: 250px;
    --radius: 2px;
    --transition: 0.25s ease;
    --shadow-sm: 0 6px 24px rgba(0, 0, 0, 0.04);
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
ul {
    margin: 0;
    padding: 0;
}

.shop-page {
    padding: 48px 0 70px;
}

.shop-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 42px;
    align-items: start;
}

.search-page .shop-layout{
    grid-template-columns: 1fr;
}

/* Sidebar */
.shop-sidebar {
    position: sticky;
    top: 200px;
}

.sidebar-top {
    margin-bottom: 18px;
}

.product-count {
    font-size: 18px;
    font-weight: 600;
    color: #fb5d5d;
}

.filter-group {
    border-top: 1px solid var(--line);
    padding: 18px 0;
}

.filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #fb5d5d;
    font-size: 16px;
    font-weight: 500;
    padding: 0;
}

.filter-icon {
    font-size: 18px;
    transition: transform var(--transition);
}

.filter-group:not(.is-open) .filter-icon {
    transform: rotate(180deg);
}

.filter-content {
    padding-top: 16px;
}

.filter-group:not(.is-open) .filter-content {
    display: none;
}

.category-tree {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.category-item {
    border-bottom: 1px solid #efefef;
    padding-bottom: 14px;
}

.category-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.category-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.category-check {
    flex: 1;
    margin-bottom: 0;
    font-weight: 500;
    color: #2f2f2f;
}

.category-expand {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s ease;
}

.category-expand span {
    font-size: 16px;
    transition: transform 0.25s ease;
}

.category-item.is-open .category-expand span {
    transform: rotate(0deg);
}

.category-item:not(.is-open) .category-expand span {
    transform: rotate(180deg);
}

.category-children {
    padding-top: 12px;
    padding-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item:not(.is-open) .category-children {
    display: none;
}

.child-check {
    margin-bottom: 0;
    font-size: 14px;
    color: #666;
}

.child-check input {
    width: 16px;
    height: 16px;
}

.category-check input:indeterminate {
    background: #111;
    border-color: #111;
    position: relative;
}

.category-check input:indeterminate::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    top: 7px;
    height: 2px;
    background: #fff;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 11px;
    cursor: pointer;
    font-size: 15px;
    color: #444;
}

.check-item input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #bcbcbc;
    background: var(--white);
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
}

.check-item input:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--black);
}

.filter-more {
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    margin-top: 6px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 10px;
}

.color-filter {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #222222;
    font-size: 14px;
}

.color-filter.active span:last-child {
    font-weight: 600;
    color: var(--black);
}

.swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d2d2d2;
    display: inline-block;
}

.swatch.is-active {
    outline: 2px solid #222;
    outline-offset: 2px;
}

.size-block+.size-block {
    margin-top: 20px;
}

.size-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #222222;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.size-grid button {
    height: 42px;
    border: 1px solid var(--soft-line);
    background: #f1f1f1;
    color: #555;
    cursor: pointer;
    transition: var(--transition);
}

.size-grid button:hover,
.size-grid button:focus-visible {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.size-grid button.active{
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.size-grid--small button {
    font-weight: 600;
}

/* Main */
.shop-header {
    margin-bottom: 28px;
}

.shop-header h1 {
    font-size: clamp(28px, 3vw, 52px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #202020;
    margin-bottom: 6px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 22px;
}

.search-page .product-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product--card {
    display: flex;
    flex-direction: column;
}

.product--card a:hover {
    color: #fb5d5d;
}

.product-media {
    position: relative;
    background: var(--white);
    overflow: hidden;
    aspect-ratio: 0.86 / 1;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-media--gray {
    background: #ececec;
}

.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: var(--white);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 8px;
    line-height: 1;
}

.product-media .wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 42px;
    height: 42px;
    border: 1px solid #d9d9d9;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.product-media .wishlist-btn svg {
    width: 20px;
    height: 20px;
    fill: transparent;
    stroke: #222;
    stroke-width: 1.8;
    transition: 0.25s ease;
}

.product-media .wishlist-btn:hover {
    transform: translateY(-1px);
    border-color: #fb5d5d;
    background: #fff1f1;
}

.product-media .wishlist-btn.active {
    border-color: #fb5d5d;
    background: #fff1f1;
}

.product-media .wishlist-btn:hover svg {
    fill: #ffffff;
    stroke: #fb5d5d;
}

.product-media .wishlist-btn.active svg {
    fill: #ffffff;
    stroke: #fb5d5d;
}

.product--info {
    width: 100%;
    padding-top: 12px;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.product-title a {
    font-family: "Cinzel", serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    color: #222222;
    flex: 1;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding-top: 2px;
}

.old-price {
    color: #9b9b9b;
    text-decoration: line-through;
    font-size: 15px;
}

.new-price {
    color: #686868;
    font-size: 15px;
    font-weight: 600;
}

.product-variant {
    font-size: 15px;
    color: #7d7d7d;
    margin: 8px 0 10px;
}

.product-swatches {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #bdbdbd;
    background: transparent;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition);
}

.dot:hover,
.dot.active {
    transform: scale(1.08);
    border-color: var(--black);
}

.dot.olive {
    background: #6b6553;
}

.dot.charcoal {
    background: #4b4b4b;
}

.dot.taupe {
    background: #8e775e;
}

.dot.black {
    background: #2f2f2f;
}

.dot.sage {
    background: #737a69;
}

.dot.moss {
    background: #666b4f;
}

.btn-cart {
    width: 100%;
    min-height: 42px;
    border: 1px solid #5d5d5d;
    background: transparent;
    color: #4b4b4b;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cart:hover {
    border-color: #fb5d5d;
    background: #fff1f1;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-load-more {
    min-width: 210px;
    height: 46px;
    border: 1px solid #fb5d5d;
    background: #fb5d5d;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-load-more:hover {
    background: transparent;
    color: var(--black);
}

/* Responsive */
@media (max-width: 1200px) {
    .shop-layout {
        grid-template-columns: 220px 1fr;
        gap: 24px;
    }

    .product-grid {
        gap: 24px 18px;
    }

    .product-title {
        font-size: 18px;
    }

    .btn-cart {
        min-width: 180px;
        height: 50px;
        font-size: 24px;
    }
}

@media (max-width: 991px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow-sm);
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-header h1 {
        max-width: 100%;
    }
}

@media (max-width: 768px) {

    .shop-page {
        padding: 28px 0 50px;
    }

    .color-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-grid {
        /* grid-template-columns: 1fr; */
        gap: 24px;
    }

    .product-media .wishlist-btn {
        width: 38px;
        height: 38px;
        top: 10px;
        right: 10px;
    }

    .product-media .wishlist-btn svg {
        width: 18px;
        height: 18px;
    }

    .product-meta-row {
        flex-direction: column;
        gap: 6px;
    }

    .product-title {
        font-size: 17px;
    }

    .product-price {
        padding-top: 0;
    }

    .btn-cart {
        width: 100%;
        min-width: 100%;
        font-size: 20px;
        height: 48px;
    }

    .btn-load-more {
        width: 100%;
        min-width: 100%;
    }
}