/* Catalog V2 brand integration */
.sf-catalog {
    --sf-catalog-tint: color-mix(in srgb, var(--brand-50) 82%, #fff);
    --sf-catalog-soft: color-mix(in srgb, var(--brand-100) 48%, #fff);
    --sf-catalog-line: color-mix(in srgb, var(--brand-500) 16%, #dbe3ec);
    --sf-catalog-ink: color-mix(in srgb, var(--brand-900) 30%, #0f172a);
    --sf-catalog-hero-ink: color-mix(in srgb, var(--brand-50) 72%, #fff);
    --sf-catalog-hero-muted: color-mix(in srgb, var(--brand-100) 58%, #fff);
    --sf-catalog-hero-line: color-mix(in srgb, var(--brand-100) 26%, transparent);
}
.sf-catalog__hero,
.sf-category-v2__hero {
    border-color: color-mix(in srgb, var(--brand-500) 22%, transparent) !important;
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--brand-500) 34%, transparent), transparent 26%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand-900) 78%, #111827), color-mix(in srgb, var(--brand-700) 70%, #251713)) !important;
}
.sf-catalog__eyebrow,
.sf-category-v2__eyebrow {
    border-color: var(--sf-catalog-hero-line) !important;
    background: color-mix(in srgb, var(--brand-500) 14%, transparent) !important;
    color: var(--sf-catalog-hero-muted) !important;
}

/* Category hero uses theme-derived foreground tokens over the dark brand surface. */
.sf-category-v2__hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--brand-900) 86%, rgba(8, 15, 25, .94)),
            color-mix(in srgb, var(--brand-900) 64%, rgba(8, 15, 25, .72)) 58%,
            color-mix(in srgb, var(--brand-700) 28%, rgba(8, 15, 25, .28))
        );
}
.sf-category-v2__hero-content {
    position: relative;
    z-index: 2;
    min-width: 0;
    color: var(--sf-catalog-hero-ink) !important;
}
.sf-category-v2__hero-content h1 {
    color: var(--sf-catalog-hero-ink) !important;
    text-shadow: 0 2px 22px color-mix(in srgb, var(--brand-900) 58%, transparent);
}
.sf-category-v2__hero-content > p {
    color: var(--sf-catalog-hero-muted) !important;
}
.sf-category-v2__stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}
.sf-category-v2__stats > span,
.sf-category-v2__stats > a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 36px;
    padding: .42rem .65rem;
    border: 1px solid var(--sf-catalog-hero-line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--brand-50) 8%, transparent);
    color: var(--sf-catalog-hero-ink) !important;
    font-size: .62rem;
    font-weight: 850;
    backdrop-filter: blur(10px);
}
.sf-category-v2__stats strong {
    color: #fff;
    font-size: .76rem;
    font-weight: 950;
}
.sf-category-v2__stats small {
    color: var(--sf-catalog-hero-muted);
    font-size: .56rem;
    font-weight: 750;
}
.sf-category-v2__stats > a:hover {
    border-color: color-mix(in srgb, var(--brand-100) 42%, transparent);
    background: color-mix(in srgb, var(--brand-50) 14%, transparent);
}

.sf-catalog__toolbar,
.sf-catalog__filters,
.sf-catalog__empty {
    border-color: var(--sf-catalog-line) !important;
    background: color-mix(in srgb, var(--sf-catalog-tint) 34%, #fff) !important;
}
.sf-catalog__toolbar { box-shadow: 0 20px 48px -40px color-mix(in srgb, var(--brand-900) 36%, transparent) !important; }
.sf-catalog__result-copy strong,
.sf-catalog__filters-head strong,
.sf-catalog__filter-group h3 { color: var(--sf-catalog-ink) !important; }
.sf-catalog__filter-toggle,
.sf-catalog__toolbar-sort,
.sf-catalog__choice,
.sf-catalog__select,
.sf-catalog__category-search { border-color: var(--sf-catalog-line) !important; }
.sf-catalog__choice:hover,
.sf-catalog__choice:has(input:checked),
.sf-catalog__chip {
    border-color: color-mix(in srgb, var(--brand-500) 34%, #dbe3ec) !important;
    background: var(--brand-50) !important;
    color: var(--brand-700) !important;
}
.sf-catalog__choice input,
.sf-catalog__category-search input { accent-color: var(--brand-600); }
.sf-catalog__apply,
.sf-catalog__filter-toggle {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700)) !important;
    color: #fff !important;
}
.sf-catalog__category-search {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 42px;
    border: 1px solid var(--sf-catalog-line);
    border-radius: 12px;
    background: #fff;
    transition: .18s ease;
}
.sf-catalog__category-search:focus-within {
    border-color: color-mix(in srgb, var(--brand-500) 62%, #cbd5e1) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 10%, transparent);
}
.sf-catalog__category-search svg {
    position: absolute;
    inset-inline-start: .72rem;
    width: 17px;
    height: 17px;
    color: var(--brand-600);
}
.sf-catalog__category-search input {
    width: 100%;
    min-height: 40px;
    padding-inline: 2.25rem 2rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--sf-catalog-ink);
    font-size: .72rem;
    font-weight: 700;
}
.sf-catalog__category-search input::placeholder { color: #94a3b8; }
.sf-catalog__category-search [data-sf-category-filter-spinner] {
    position: absolute;
    inset-inline-end: .75rem;
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, var(--brand-500) 22%, transparent);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: sfCatalogSpin .7s linear infinite;
}
.sf-catalog__category-search [hidden] { display: none; }
.sf-catalog__filter-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .65rem;
}
.sf-catalog__filter-title h3 { margin: 0 !important; }
.sf-catalog__filter-title small,
.sf-catalog__category-hint {
    color: color-mix(in srgb, var(--brand-700) 42%, #94a3b8);
    font-size: .58rem;
    font-weight: 700;
}
.sf-catalog__category-hint { margin-top: .5rem; line-height: 1.6; }
.sf-catalog__category-picker .sf-catalog__choices { margin-top: .65rem; }
.sf-catalog__choice small {
    margin-inline-start: auto;
    color: var(--brand-600);
    font-size: .54rem;
    font-weight: 900;
}

/* Keep filter CTAs compact even when they contain an SVG icon. */
.sf-catalog__apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
}
.sf-catalog__apply svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}
[dir="rtl"] .sf-catalog__apply svg {
    transform: rotate(180deg);
}

@keyframes sfCatalogSpin { to { transform: rotate(360deg); } }
body[data-sf-personality="minimal"] .sf-catalog__toolbar,
body[data-sf-personality="minimal"] .sf-catalog__filters,
body[data-sf-personality="minimal"] .sf-catalog__category-search { box-shadow: none; }
body[data-sf-motion="off"] .sf-catalog__category-search [data-sf-category-filter-spinner] { animation: none; }
@media (max-width: 700px) {
    .sf-category-v2__hero-overlay {
        background:
            linear-gradient(
                0deg,
                color-mix(in srgb, var(--brand-900) 88%, rgba(8, 15, 25, .96)),
                color-mix(in srgb, var(--brand-900) 58%, rgba(8, 15, 25, .58))
            );
    }
    .sf-category-v2__stats { align-items: stretch; }
    .sf-category-v2__stats > span,
    .sf-category-v2__stats > a { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .sf-catalog__category-search [data-sf-category-filter-spinner] { animation: none; }
}
