.collection-header {
    --collection-min-height: 340px;
    width: 100%;
    overflow: hidden;
    background: #f2e9dd;
    color: var(--color-black);
}

.collection-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
    min-height: var(--collection-min-height);
}

.collection-header__content {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: clamp(48px, 6vw, 84px) clamp(36px, 7vw, 112px);
}

.collection-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 22px;
    color: #625b54;
    font-size: 12px;
    line-height: 1.5;
}

.collection-breadcrumbs a {
    transition: color .25s ease;
}

.collection-breadcrumbs a:hover,
.collection-breadcrumbs a:focus-visible {
    color: var(--color-primary-text);
}

.collection-breadcrumbs__separator {
    color: #9a9188;
}

.collection-header__title {
    max-width: 720px;
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(3.25rem, 5vw, 5.25rem);
    font-weight: 500;
    line-height: .98;
    letter-spacing: -.025em;
}

.collection-header__description {
    max-width: 620px;
    margin-top: 22px;
    color: #4f4943;
    font-size: 15px;
    line-height: 1.75;
}

.collection-header__description p {
    margin: 0;
}

.collection-header__media {
    position: relative;
    min-height: var(--collection-min-height);
    overflow: hidden;
    background: #ded5ca;
    background-position: center;
    background-size: cover;
}

.woocommerce .collection-header__image,
.woocommerce-page .collection-header__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.collection-header__image--fallback {
    filter: saturate(.68) sepia(.08);
}

.collection-header--women {
    --collection-min-height: 390px;
    background: linear-gradient(110deg, #efe2d2 0%, #f7f1e9 100%);
}

.collection-header--women .collection-header__title {
    font-size: clamp(3.75rem, 5.6vw, 6rem);
}

.collection-header--women .collection-header__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(239, 226, 210, .2), transparent 34%);
    pointer-events: none;
}

.collection-header--men {
    --collection-min-height: 310px;
    background: #f5f1eb;
}

.collection-header--men .collection-header__title {
    font-size: clamp(3.25rem, 4.6vw, 4.75rem);
}

.collection-header--men .collection-header__image {
    filter: saturate(.75);
}

@media (max-width: 1024px) {
    .collection-header__inner {
        grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr);
    }

    .collection-header__content {
        padding-inline: clamp(32px, 6vw, 64px);
    }
}

@media (max-width: 760px) {
    .collection-header__inner {
        grid-template-columns: 1fr;
    }

    .collection-header__content {
        min-height: 300px;
        padding: 42px 24px 46px;
    }

    .collection-header__title,
    .collection-header--women .collection-header__title,
    .collection-header--men .collection-header__title {
        font-size: clamp(3rem, 13vw, 4.25rem);
    }

    .collection-header__description {
        margin-top: 18px;
        font-size: 14px;
        line-height: 1.7;
    }

    .collection-header__media,
    .collection-header--women .collection-header__media,
    .collection-header--men .collection-header__media {
        min-height: 260px;
        max-height: 320px;
    }
}

/* Product grid */
.collection-catalog {
    display: grid;
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(38px, 4vw, 58px);
    padding-top: clamp(40px, 5vw, 72px);
    padding-bottom: clamp(48px, 6vw, 88px);
}

.collection-products {
    min-width: 0;
}

.collection-products ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    column-gap: clamp(18px, 2.2vw, 32px);
    row-gap: clamp(52px, 5vw, 76px);
}

/* Neutralize WooCommerce's float-loop remnants inside the CSS grid. */
.woocommerce .collection-products ul.products::before,
.woocommerce .collection-products ul.products::after {
    display: none;
}

.woocommerce .collection-products ul.products li.product.product-card {
    align-self: start;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    transition: transform .28s ease;
}

.woocommerce .collection-products ul.products li.product.product-card:hover,
.woocommerce .collection-products ul.products li.product.product-card:focus-within {
    transform: translateY(-3px);
    box-shadow: none;
}

.collection-products .product-card__media {
    aspect-ratio: 4 / 5;
    background: #eee8e0;
    box-shadow: 0 0 0 rgba(25, 20, 15, 0);
    transition: box-shadow .28s ease;
}

.collection-products .product-card:hover .product-card__media,
.collection-products .product-card:focus-within .product-card__media {
    box-shadow: 0 15px 34px rgba(25, 20, 15, .1);
}

.woocommerce .collection-products ul.products li.product .product-card__media img.product-card__image {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transition: transform .28s ease;
}

.woocommerce .collection-products ul.products li.product .product-card__content {
    padding: 14px 0 0;
}

.collection-products .product-card__label {
    margin: 0 0 4px;
    color: var(--color-primary-text);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.woocommerce .collection-products ul.products li.product h3.product-card__title {
    min-height: 0;
    margin: 0 0 4px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
}

.woocommerce .collection-products ul.products li.product .product-card__price {
    margin-bottom: 13px;
    font-size: 12px;
}

.woocommerce .collection-products ul.products li.product .product-card__action.button {
    display: block;
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--color-primary);
    border-radius: 0;
    background: transparent;
    color: var(--color-black);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.woocommerce .collection-products ul.products li.product .product-card__action.button:hover,
.woocommerce .collection-products ul.products li.product .product-card__action.button:focus-visible {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-black);
}

.collection-pagination {
    padding-bottom: clamp(52px, 7vw, 96px);
}

.collection-pagination .woocommerce-pagination {
    margin: 0;
}

@media (max-width: 1024px) {
    .collection-catalog {
        grid-template-columns: minmax(175px, 195px) minmax(0, 1fr);
        gap: 32px;
    }

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

@media (max-width: 900px) {
    .collection-catalog {
        display: block;
        padding-top: 32px;
        padding-bottom: 52px;
    }

    .collection-products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 14px;
        row-gap: 42px;
    }
}

/* Collection sidebar */
.collection-sidebar {
    position: sticky;
    top: 118px;
    min-width: 0;
}

.collection-sidebar__header {
    display: none;
}

.collection-filter {
    padding: 0 0 28px;
    margin: 0 0 28px;
    border-bottom: 1px solid #e8e0d7;
}

.collection-filter:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.collection-filter__title,
.collection-filter .widget-title {
    margin: 0 0 18px;
    color: #463d34;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.collection-filter ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.collection-filter li {
    margin: 0 0 11px;
    color: #625b54;
    font-size: 12px;
    line-height: 1.55;
}

.collection-filter li:last-child {
    margin-bottom: 0;
}

.collection-filter a {
    transition: color .2s ease;
}

.collection-filter a:hover,
.collection-filter a:focus-visible,
.collection-filter .current-cat > a {
    color: var(--color-primary-text);
}

.collection-filter .count {
    float: right;
    color: #9a9188;
    font-size: 10px;
}

.collection-filter .children {
    padding: 10px 0 0 14px;
}

.stock-filter__link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.stock-filter__control {
    position: relative;
    width: 14px;
    height: 14px;
    border: 1px solid #cfc4b7;
}

.stock-filter__link.is-active .stock-filter__control {
    border-color: var(--color-primary-text);
    background: var(--color-primary-text);
}

.stock-filter__link.is-active .stock-filter__control::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 4px;
    width: 3px;
    height: 6px;
    border-right: 1px solid var(--color-white);
    border-bottom: 1px solid var(--color-white);
    transform: rotate(45deg);
}

.collection-filter.widget_price_filter .price_slider_wrapper .ui-widget-content {
    height: 2px;
    margin: 10px 7px 24px;
    border: 0;
    border-radius: 0;
    background: #ded5ca;
}

.collection-filter.widget_price_filter .ui-slider .ui-slider-range {
    background: var(--color-primary);
}

.collection-filter.widget_price_filter .ui-slider .ui-slider-handle {
    top: -5px;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border: 1px solid var(--color-primary);
    border-radius: 50%;
    background: var(--color-white);
}

.collection-filter.widget_price_filter .price_slider_amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    line-height: 1.5;
}

.collection-filter.widget_price_filter .price_slider_amount .button {
    order: 2;
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid #bfb4a8;
    border-radius: 0;
    background: transparent;
    color: var(--color-black);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.collection-filter.widget_price_filter .price_label {
    order: 1;
}

.collection-filter .product_list_widget li {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 5px 12px;
    min-height: 68px;
    padding: 0;
    margin-bottom: 14px;
}

.collection-filter .product_list_widget li > a {
    display: contents;
    color: var(--color-black);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.collection-filter .product_list_widget img {
    grid-row: 1 / span 3;
    width: 54px;
    height: 68px;
    margin: 0;
    object-fit: cover;
}

.collection-filter .product_list_widget .amount,
.collection-filter .product_list_widget del,
.collection-filter .product_list_widget ins {
    grid-column: 2;
    color: #625b54;
    font-size: 10px;
}

.collection-sidebar-overlay {
    display: none;
}

@media (max-width: 900px) {
    .collection-sidebar {
        position: fixed;
        z-index: 1201;
        top: 0;
        left: 0;
        width: min(88vw, 370px);
        height: 100dvh;
        padding: 0 26px 40px;
        overflow-y: auto;
        background: var(--color-white);
        box-shadow: 18px 0 46px rgba(18, 14, 10, .14);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .35s ease, visibility .35s ease;
    }

    .collection-sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .collection-sidebar__header {
        position: sticky;
        z-index: 2;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 76px;
        margin: 0 -2px 28px;
        border-bottom: 1px solid #e8e0d7;
        background: var(--color-white);
    }

    .collection-sidebar__header h2 {
        margin: 0;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .12em;
        text-transform: uppercase;
    }

    .collection-sidebar__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--color-black);
        cursor: pointer;
    }

    .collection-sidebar__close svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.4;
        stroke-linecap: round;
    }

    .collection-sidebar-overlay {
        position: fixed;
        z-index: 1200;
        inset: 0;
        display: block;
        background: rgba(15, 12, 9, .38);
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s ease, visibility .3s ease;
    }

    .collection-sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    body.shop-filter-open {
        overflow: hidden;
    }
}

@media (max-width: 340px) {
    .collection-products ul.products {
        grid-template-columns: 1fr;
        gap: 36px;
    }
}

/* Collection toolbar */
.collection-toolbar {
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.collection-toolbar__inner {
    display: grid;
    grid-template-areas: "count . sort";
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    min-height: 78px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.collection-toolbar__filter-toggle {
    display: none;
    grid-area: filter;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid #cfc4b7;
    border-radius: 0;
    background: transparent;
    color: var(--color-black);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.collection-toolbar__filter-toggle svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.collection-toolbar__filter-toggle:hover,
.collection-toolbar__filter-toggle:focus-visible {
    border-color: var(--color-black);
    background: var(--color-black);
    color: var(--color-white);
}

.collection-toolbar__count {
    grid-area: count;
    display: flex;
    align-items: center;
    min-height: 44px;
    color: #5f5851;
    font-size: 13px;
}

.collection-toolbar__count .woocommerce-result-count,
.collection-toolbar__sorting .woocommerce-ordering {
    margin: 0;
}

.collection-toolbar__sorting {
    grid-area: sort;
    display: flex;
    align-items: center;
}

.collection-toolbar__sorting select {
    min-width: 220px;
    min-height: 44px;
    padding: 10px 42px 10px 14px;
    border: 1px solid #cfc4b7;
    border-radius: 0;
    background-color: var(--color-white);
    color: var(--color-black);
    font-family: var(--font-body);
    font-size: 12px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .collection-toolbar__inner {
        grid-template-areas:
            "filter sort"
            "count count";
        grid-template-columns: auto minmax(0, 1fr);
        gap: 18px 12px;
        min-height: 0;
        padding-top: 20px;
        padding-bottom: 22px;
    }

    .collection-toolbar__filter-toggle {
        display: inline-flex;
    }

    .collection-toolbar__sorting {
        justify-self: end;
        min-width: 0;
    }

    .collection-toolbar__sorting select {
        width: 100%;
        min-width: 0;
        max-width: 210px;
    }

    .collection-toolbar__count {
        padding-top: 2px;
        font-size: 12px;
    }
}
