/* Catalog controls source-of-truth. Keep filter panel, filter options, clear/reset, pagination, and catalog control widgets here. */
.catalog-filter {
    --bodycare-filter-z: var(--bodycare-z-filter, 230);
    display: grid;
    align-content: start;
    gap: 0;
    min-width: 0;
    padding-right: 10px;
    border: 0;
    border-radius: 0;
    background: var(--catalog-canvas);
}

.catalog-filter__head {
    display: none;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.catalog-filter__head h2 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 34px;
    line-height: 0.95;
    text-transform: uppercase;
}

.catalog-filter [data-filter-close] {
    display: none;
    color: var(--ink);
}

.filter-section {
    padding: 0;
    border-bottom: 0;
}

.filter-section summary {
    display: flex;
    min-width: 0;
    max-width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
    color: var(--ink);
    font-family: var(--text-font);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    list-style: none;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-transform: uppercase;
    word-break: break-word;
    cursor: pointer;
}

.filter-section summary::-webkit-details-marker {
    display: none;
}

.filter-section summary::after {
    content: "+";
    display: grid;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--pink);
    font-family: var(--text-font);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.filter-section[open] summary::after {
    content: "-";
}

.filter-options {
    display: grid;
    gap: 12px;
    padding: 0 0 22px;
}

.filter-options--scroll {
    margin-bottom: 18px;
    max-height: 318px;
    overflow: auto;
    padding-right: 12px;
    scrollbar-color: rgba(var(--theme-accent-rgb), 0.34) transparent;
    scrollbar-width: thin;
}

.filter-options--scroll::-webkit-scrollbar {
    width: 4px;
}

.filter-options--scroll::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    background: var(--pink);
}

.filter-check {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    min-height: 34px;
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.32;
    overflow-wrap: anywhere;
    text-decoration: none;
    word-break: break-word;
    cursor: pointer;
}

.filter-check > span:last-child {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.filter-check input {
    position: relative;
    display: grid;
    width: 20px;
    height: 20px;
    margin: 0;
    place-items: center;
    appearance: none;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.28);
    border-radius: 6px;
    background: var(--paper);
}

.filter-check input:checked {
    border-color: var(--pink);
    background: var(--pink);
}

.filter-check input::after {
    content: "";
    width: 6px;
    height: 10px;
    border-right: 2px solid var(--paper);
    border-bottom: 2px solid var(--paper);
    opacity: 0;
    transform: rotate(45deg) scale(0.75);
    transform-origin: center;
}

.filter-check input:checked::after {
    opacity: 1;
}

.filter-check__box {
    display: grid;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.28);
    border-radius: 7px;
    background: #fff;
}

.filter-check.is-active {
    color: var(--pink);
    font-weight: 650;
}

.filter-check.is-active .filter-check__box {
    border-color: var(--pink);
    background: var(--pink);
}

.filter-check.is-active .filter-check__box::after {
    content: "";
    display: block;
    width: 9px;
    height: 6px;
    border-bottom: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: rotate(-45deg);
    transform-origin: center;
}

.filter-check.is-disabled {
    color: #b7bbc4;
    cursor: not-allowed;
    opacity: 0.48;
    pointer-events: none;
}

.filter-check.is-disabled input,
.filter-check.is-disabled .filter-check__box {
    border-color: #e3e4e8;
    background: #f4f4f6;
}

.filter-options button {
    display: flex;
    width: 100%;
    min-height: 26px;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
    text-align: left;
    cursor: pointer;
}

.filter-options button:hover,
.filter-options button.is-active {
    color: var(--pink);
    transform: none;
}

.filter-options button:disabled,
.filter-options button.is-disabled {
    color: #b7bbc4;
    cursor: default;
}

.catalog-clear {
    display: inline-flex;
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    margin: 14px 0 0;
    padding: 0 18px;
    border: 1px solid rgba(var(--theme-accent-rgb), 0.38);
    border-radius: 14px;
    background: #fff;
    color: var(--pink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    word-break: break-word;
    cursor: pointer;
    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

.catalog-clear:hover,
.catalog-clear:focus-visible {
    border-color: var(--pink);
    background: color-mix(in srgb, var(--pink-soft) 82%, #ffffff);
    color: var(--pink);
    box-shadow: none;
}

.catalog-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.catalog-pagination:empty {
    display: none;
}

.catalog-pagination span {
    margin-right: 4px;
    color: #8b8e97;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.catalog-pagination button,
.catalog-pagination a {
    display: inline-grid;
    min-width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(72, 52, 105, 0.14);
    border-radius: 12px;
    background: #fff;
    color: #4b3b69;
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.catalog-pagination button:hover,
.catalog-pagination button:focus-visible,
.catalog-pagination a:hover,
.catalog-pagination a:focus-visible {
    border-color: rgba(var(--theme-accent-rgb), 0.34);
    background: color-mix(in srgb, var(--pink-soft) 82%, #ffffff);
    color: var(--pink);
    box-shadow: 0 8px 18px rgba(var(--theme-accent-rgb), 0.12);
    transform: translateY(-1px);
    outline: 0;
}

.catalog-pagination button.is-current,
.catalog-pagination a.is-current {
    border-color: var(--pink);
    background: var(--pink);
    color: #fff;
}

.catalog-pagination button.is-current:hover,
.catalog-pagination button.is-current:focus-visible,
.catalog-pagination a.is-current:hover,
.catalog-pagination a.is-current:focus-visible {
    border-color: var(--pink-dark);
    background: var(--pink-dark);
    color: #fff;
    box-shadow: 0 10px 22px rgba(var(--theme-accent-rgb), 0.18);
}

@media (min-width: 1280px) {
    .catalog-filter {
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
        padding: 8px 18px 18px;
        border: 1px solid rgba(17, 17, 17, 0.07);
        border-radius: 8px;
        background: var(--catalog-glass);
        box-shadow: 0 16px 34px rgba(40, 28, 36, 0.055);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .catalog-filter::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.catalog-page.is-header-hidden .catalog-filter {
        top: auto;
        max-height: none;
    }
}

@media (min-width: 1280px) and (max-width: 1366px) {
    .catalog-filter {
        padding-right: 6px;
    }

    .filter-section summary {
        min-height: 48px;
        font-size: 14px;
    }
}

@media (min-width: 1280px) {
    .catalog-page .catalog-filter {
        padding: 6px 14px 14px;
    }

    .catalog-page .filter-section summary {
        min-height: 48px;
        font-size: 14px;
    }

    .catalog-page .filter-options {
        gap: 8px;
    }

    .catalog-page .filter-check {
        min-height: 38px;
        font-size: 15px;
        font-weight: 600;
    }
}

@media (max-width: 1279px) {
    .catalog-filter {
        position: fixed;
        top: 0;
        right: auto;
        bottom: 0;
        left: 0;
        z-index: var(--bodycare-z-filter, 230);
        width: min(390px, 92vw);
        height: 100vh;
        height: 100svh;
        height: 100dvh;
        max-height: none;
        overflow: auto;
        padding: 0 22px calc(102px + env(safe-area-inset-bottom));
        border-radius: 0;
        background: var(--catalog-canvas);
        box-shadow: var(--shadow);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-104%);
        transition: none;
    }

    body.catalog-page.is-filter-transitioning .catalog-filter {
        transition: transform 220ms ease;
    }

    .catalog-filter__head {
        display: flex;
        min-height: 76px;
        align-items: center;
        padding: 18px 0;
    }

    .catalog-filter__head > div {
        display: flex;
        min-width: 0;
        align-items: center;
    }

    .catalog-filter__head .eyebrow {
        min-width: 0;
        max-width: 100%;
        margin: 0;
        overflow: hidden;
        overflow-wrap: anywhere;
        line-height: 1;
        word-break: break-word;
    }

    .catalog-filter__head h2 {
        display: none;
    }

    .catalog-filter.is-open {
        transform: translateX(0);
    }

    .catalog-filter [data-filter-close] {
        display: grid;
        flex: 0 0 auto;
        align-self: center;
        place-items: center;
    }

    html.is-locked:has(body.catalog-page.has-filter-open),
body.catalog-page.has-filter-open,
body.catalog-page.has-filter-open.is-locked {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

@media (max-width: 699px) {
    body.catalog-page.has-filter-open .catalog-filter {
        right: 0;
        left: 0;
        width: auto;
        max-width: none;
        box-shadow: none;
    }
}

@media (min-width: 1900px) {
    body.catalog-page .catalog-filter {
        --catalog-filter-back-offset: 0px;
        width: 100%;
        margin-left: 0;
        padding-left: 18px;
    }
}
