/* Storefront Catalog V2 — polished mobile filter sheet. */

.sf-catalog__filter-sheet { min-width: 0; }
.sf-catalog__sheet-handle { display: none; }
.sf-catalog__filters-head small { display: none; }
.sf-catalog__filters-head-actions { display: flex; align-items: center; gap: .45rem; }
.sf-catalog__reset { display: none; }
.sf-catalog__filters-close svg { width: 18px; height: 18px; }
.sf-catalog__filter-icon { display: none; }
.sf-catalog__category-option-copy { min-width: 0; display: grid; gap: .1rem; }
.sf-catalog__category-option-copy strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-catalog__category-option-copy small { color: var(--muted-text); font-size: .58rem; font-weight: 650; }
.sf-catalog__category-count,
.sf-catalog__category-option-state { display: none; }
.sf-catalog__sort-options { display: none; }

.sf-catalog__availability-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    padding: .55rem .2rem;
    cursor: pointer;
}
.sf-catalog__availability-toggle > span { display: grid; gap: .12rem; }
.sf-catalog__availability-toggle strong { color: #334155; font-size: .69rem; font-weight: 900; }
.sf-catalog__availability-toggle small { color: #94a3b8; font-size: .54rem; font-weight: 650; }
.sf-catalog__availability-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.sf-catalog__availability-toggle i {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #dbe3ec;
    transition: background .18s ease;
}
.sf-catalog__availability-toggle i::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(15,23,42,.18);
    transition: transform .18s ease;
}
.sf-catalog__availability-toggle:has(input:checked) i { background: var(--brand-600); }
.sf-catalog__availability-toggle:has(input:checked) i::after { transform: translateX(-18px); }
[dir="ltr"] .sf-catalog__availability-toggle:has(input:checked) i::after { transform: translateX(18px); }

.sf-catalog__filter-toggle b {
    min-width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    margin-inline-start: .15rem;
    border-radius: 999px;
    background: #fff;
    color: var(--brand-700);
    font-size: .56rem;
    font-weight: 950;
}

@media (max-width: 1023px) {
    .sf-catalog__filters {
        display: flex !important;
        align-items: end !important;
        padding: 0 !important;
        background: color-mix(in srgb, var(--brand-900) 20%, rgba(15,23,42,.5)) !important;
        backdrop-filter: blur(9px) saturate(.9);
    }

    .sf-catalog__filters.is-open::before { display: none !important; }

    .sf-catalog__filter-sheet {
        position: relative;
        width: 100%;
        max-height: min(88dvh, 52rem);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 28px 28px 0 0;
        background:
            radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--brand-100) 46%, transparent), transparent 13rem),
            #fff;
        box-shadow: 0 -26px 80px -32px rgba(15,23,42,.72);
        transform: translateY(18px);
        transition: transform .24s cubic-bezier(.2,.8,.2,1);
    }
    .sf-catalog__filters.is-open .sf-catalog__filter-sheet { transform: translateY(0); }

    .sf-catalog__sheet-handle {
        display: block;
        flex: 0 0 auto;
        width: 3rem;
        height: 4px;
        margin: .6rem auto .15rem;
        border-radius: 999px;
        background: color-mix(in srgb, var(--brand-500) 20%, #cbd5e1);
    }

    .sf-catalog__filters-head {
        position: relative;
        z-index: 2;
        width: 100%;
        min-height: 66px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .75rem 1rem .8rem !important;
        border-bottom: 1px solid color-mix(in srgb, var(--brand-500) 13%, #e2e8f0);
        background: rgba(255,255,255,.91) !important;
        backdrop-filter: blur(16px);
    }
    .sf-catalog__filters-head > div:first-child { display: grid; gap: .12rem; }
    .sf-catalog__filters-head small {
        display: block;
        color: var(--brand-600);
        font-size: .54rem;
        font-weight: 900;
    }
    .sf-catalog__filters-head strong {
        color: var(--sf-brand-ink, #0f172a) !important;
        font-size: 1rem;
        line-height: 1.2;
    }
    .sf-catalog__reset {
        display: inline-flex;
        align-items: center;
        min-height: 34px;
        padding-inline: .55rem;
        border-radius: 10px;
        color: var(--brand-700);
        font-size: .62rem;
        font-weight: 900;
    }
    .sf-catalog__reset:active { background: var(--brand-50); }
    .sf-catalog__filters-close {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        border: 1px solid color-mix(in srgb, var(--brand-500) 14%, #e2e8f0);
        border-radius: 12px;
        background: #fff;
        color: #64748b;
    }

    .sf-catalog__filter-sheet > form {
        width: 100%;
        min-height: 0;
        max-height: none !important;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: .9rem 1rem 0 !important;
        scrollbar-width: none;
        background: transparent !important;
    }
    .sf-catalog__filter-sheet > form::-webkit-scrollbar { display: none; }

    .sf-catalog__filter-group {
        padding: 0 !important;
        border: 0 !important;
    }
    .sf-catalog__filter-card {
        margin-bottom: .8rem;
        padding: .85rem !important;
        border: 1px solid color-mix(in srgb, var(--brand-500) 12%, #e5e7eb) !important;
        border-radius: 18px;
        background: color-mix(in srgb, var(--brand-50) 18%, #fff);
        box-shadow: 0 16px 38px -34px color-mix(in srgb, var(--brand-900) 25%, transparent);
    }

    .sf-catalog__filter-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        margin-bottom: .72rem !important;
    }
    .sf-catalog__filter-title > div {
        display: flex;
        align-items: center;
        gap: .5rem;
        min-width: 0;
    }
    .sf-catalog__filter-title h3 {
        margin: 0 !important;
        color: var(--sf-brand-ink, #0f172a) !important;
        font-size: .76rem;
        font-weight: 950;
    }
    .sf-catalog__filter-title small {
        color: color-mix(in srgb, var(--brand-700) 38%, #94a3b8);
        font-size: .55rem;
        font-weight: 700;
    }
    .sf-catalog__filter-icon {
        width: 28px;
        height: 28px;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        border-radius: 9px;
        background: var(--brand-50);
        color: var(--brand-700);
    }
    .sf-catalog__filter-icon svg { width: 15px; height: 15px; }

    .sf-catalog__category-search {
        min-height: 48px !important;
        border-radius: 14px !important;
        background: #fff !important;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
    }
    .sf-catalog__category-search input {
        min-height: 46px !important;
        padding-inline: 2.5rem 2.2rem !important;
        font-size: .72rem !important;
    }
    .sf-catalog__category-search > svg { width: 18px !important; height: 18px !important; }

    .sf-catalog__category-picker .sf-catalog__choices {
        display: grid;
        gap: .38rem;
        max-height: 15.5rem;
        margin-top: .65rem !important;
        overflow-y: auto;
        padding-inline-end: .1rem;
    }
    .sf-catalog__category-option {
        position: relative;
        min-height: 52px;
        display: grid !important;
        grid-template-columns: minmax(0,1fr) auto 24px;
        align-items: center;
        gap: .55rem;
        padding: .55rem .65rem !important;
        border: 1px solid transparent !important;
        border-radius: 13px !important;
        background: #fff !important;
        color: #475569 !important;
        cursor: pointer;
        transition: border-color .16s ease, background .16s ease, transform .16s ease;
    }
    .sf-catalog__category-option:hover {
        transform: translateY(-1px);
        border-color: color-mix(in srgb, var(--brand-500) 18%, #e2e8f0) !important;
    }
    .sf-catalog__category-option:has(input:checked) {
        border-color: color-mix(in srgb, var(--brand-500) 38%, #cbd5e1) !important;
        background: color-mix(in srgb, var(--brand-50) 74%, #fff) !important;
        color: var(--brand-800, var(--brand-700)) !important;
    }
    .sf-catalog__category-option input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }
    .sf-catalog__category-option-copy { display: grid; gap: .08rem; min-width: 0; }
    .sf-catalog__category-option-copy strong {
        color: currentColor;
        font-size: .7rem;
        font-weight: 900;
    }
    .sf-catalog__category-option-copy small {
        color: #94a3b8;
        font-size: .54rem;
        font-weight: 650;
    }
    .sf-catalog__category-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.35rem;
        height: 24px;
        padding-inline: .4rem;
        border-radius: 999px;
        background: color-mix(in srgb, var(--brand-50) 76%, #f8fafc);
        color: var(--brand-700);
        font-size: .54rem;
        font-weight: 950;
        font-variant-numeric: tabular-nums;
    }
    .sf-catalog__category-option-state {
        width: 22px;
        height: 22px;
        display: grid;
        place-items: center;
        border: 1px solid #d8e0ea;
        border-radius: 999px;
        color: transparent;
        font-size: .64rem;
        font-weight: 950;
        transition: .16s ease;
    }
    .sf-catalog__category-option:has(input:checked) .sf-catalog__category-option-state {
        border-color: var(--brand-600);
        background: var(--brand-600);
        color: #fff;
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 9%, transparent);
    }
    .sf-catalog__category-option.is-all { grid-template-columns: minmax(0,1fr) 24px; }
    .sf-catalog__category-option.is-all .sf-catalog__category-option-state { grid-column: 2; }
    .sf-catalog__category-hint {
        margin-top: .55rem !important;
        color: #94a3b8 !important;
        font-size: .54rem !important;
        line-height: 1.6 !important;
    }

    .sf-catalog__availability-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 52px;
        padding: .55rem .2rem;
        cursor: pointer;
    }
    .sf-catalog__availability-toggle > span { display: grid; gap: .12rem; }
    .sf-catalog__availability-toggle strong { color: #334155; font-size: .69rem; font-weight: 900; }
    .sf-catalog__availability-toggle small { color: #94a3b8; font-size: .54rem; font-weight: 650; }
    .sf-catalog__availability-toggle input { position: absolute; opacity: 0; pointer-events: none; }
    .sf-catalog__availability-toggle i {
        position: relative;
        width: 42px;
        height: 24px;
        flex: 0 0 auto;
        border-radius: 999px;
        background: #dbe3ec;
        transition: background .18s ease;
    }
    .sf-catalog__availability-toggle i::after {
        content: "";
        position: absolute;
        top: 3px;
        inset-inline-start: 3px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 3px 8px rgba(15,23,42,.18);
        transition: transform .18s ease;
    }
    .sf-catalog__availability-toggle:has(input:checked) i { background: var(--brand-600); }
    .sf-catalog__availability-toggle:has(input:checked) i::after { transform: translateX(-18px); }
    [dir="ltr"] .sf-catalog__availability-toggle:has(input:checked) i::after { transform: translateX(18px); }

    .sf-catalog__sort-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: .42rem;
    }
    .sf-catalog__sort-options label { position: relative; cursor: pointer; }
    .sf-catalog__sort-options input { position: absolute; opacity: 0; pointer-events: none; }
    .sf-catalog__sort-options span {
        min-height: 42px;
        display: grid;
        place-items: center;
        padding: .45rem;
        border: 1px solid color-mix(in srgb, var(--brand-500) 12%, #e2e8f0);
        border-radius: 12px;
        background: #fff;
        color: #64748b;
        text-align: center;
        font-size: .62rem;
        font-weight: 850;
        transition: .16s ease;
    }
    .sf-catalog__sort-options label:has(input:checked) span {
        border-color: color-mix(in srgb, var(--brand-500) 40%, #cbd5e1);
        background: var(--brand-50);
        color: var(--brand-700);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-500) 8%, transparent);
    }

    .sf-catalog__filter-actions {
        position: sticky !important;
        z-index: 4;
        bottom: 0 !important;
        display: grid !important;
        grid-template-columns: auto minmax(0,1fr);
        align-items: center;
        gap: .65rem;
        margin: .15rem -1rem 0;
        padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid color-mix(in srgb, var(--brand-500) 12%, #e2e8f0);
        background: rgba(255,255,255,.96) !important;
        backdrop-filter: blur(16px);
    }
    .sf-catalog__clear {
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding-inline: .5rem;
        color: #64748b;
        font-size: .62rem;
        font-weight: 850;
        white-space: nowrap;
    }
    .sf-catalog__apply {
        min-height: 48px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: .45rem;
        border-radius: 14px !important;
        font-size: .73rem !important;
        font-weight: 950 !important;
    }
    .sf-catalog__apply svg { width: 16px; height: 16px; }
}

@media (max-width: 380px) {
    .sf-catalog__filter-sheet { max-height: 91dvh; border-radius: 22px 22px 0 0; }
    .sf-catalog__filters-head { padding-inline: .8rem !important; }
    .sf-catalog__filter-sheet > form { padding-inline: .8rem !important; }
    .sf-catalog__filter-actions { margin-inline: -.8rem; padding-inline: .8rem !important; }
    .sf-catalog__filter-title small { display: none; }
    .sf-catalog__category-picker .sf-catalog__choices { max-height: 13.5rem; }
}
