/* Ìyánífá's Wardrobe — shop sidebar filters (every catalog page, never home).
   Palette of dots for colour (no words), chips for size, arrival dates for
   delivery. Desktop: 260 px left column, sticky. Phones: a "Filters" bar and
   a bottom sheet. Tokens from card.css. */

.wig-catshop { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.wig-shop__main { min-width: 0; }
.wig-stream__inner { min-width: 0; }
/* the stream used to own the container; inside .wig-catshop it must not re-pad */
.wig-catshop .wig-stream > .iyanifas-container { padding-left: 0; padding-right: 0; max-width: none; }

.wig-filters {
	position: sticky; top: 86px; max-height: calc(100vh - 100px); overflow: auto; overscroll-behavior: contain;
	font-family: var(--wig-ui); color: var(--wig-ink); font-size: 14px; line-height: 1.35;
	padding-right: 6px; scrollbar-width: thin;
}
.wig-filters__head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 6px; }
.wig-filters__title { font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: .02em; margin: 0; flex: 1; text-transform: none; }
.wig-filters__clear { color: var(--wig-link); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.wig-filters__close { display: none; }

.wig-filters__chips { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wig-filters__chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--wig-line); border-radius: 999px; background: #fff; color: var(--wig-ink); font-size: 12.5px; text-decoration: none; text-transform: none; }
.wig-filters__chips a:hover { border-color: var(--wig-ink); }

.wig-filters__group { border-top: 1px solid var(--wig-line); padding: 10px 0 12px; }
.wig-filters__group > summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; letter-spacing: .01em; display: flex; align-items: center; padding: 2px 0; }
.wig-filters__group > summary::-webkit-details-marker { display: none; }
.wig-filters__group > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--wig-muted); border-bottom: 2px solid var(--wig-muted); transform: rotate(45deg); transition: transform .15s; }
.wig-filters__group[open] > summary::after { transform: rotate(225deg); }

.wig-filters__list { list-style: none; margin: 8px 0 0; padding: 0; }
.wig-filters__list li a { display: flex; align-items: baseline; gap: 6px; padding: 5px 0; color: var(--wig-ink); text-decoration: none; text-transform: none; border-radius: 4px; }
.wig-filters__list li a:hover { color: var(--wig-save); }
.wig-filters__list li.is-on > a { font-weight: 700; color: var(--wig-ink); }
.wig-filters__list li.is-on > a::before { content: "✓"; color: var(--wig-ok); font-weight: 700; }
.wig-filters__list small { margin-left: auto; color: var(--wig-muted); font-size: 12px; font-weight: 400; }
.wig-filters__list li a span { display: block; font-size: 12px; color: var(--wig-muted); font-weight: 400; }
.wig-filters__list li a strong { font-weight: 600; display: block; }
.wig-filters__list li a strong b { color: var(--wig-ok); font-weight: 700; }

/* category tree */
.wig-filters__cats ul { list-style: none; margin: 2px 0 4px 14px; padding: 0; border-left: 2px solid var(--wig-line); }
.wig-filters__cats ul li a { padding: 4px 0 4px 10px; font-size: 13px; }
.wig-filters__cats li.is-current > a { font-weight: 700; }

/* colour palette — dots, no words */
.wig-filters__palette { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 32px); gap: 8px; }
.wig-filters__swatch { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid transparent; }
.wig-filters__dot { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--dot); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.wig-filters__dot--multi { background: conic-gradient(#b3261e, #c98a1b, #1e6b52, #2b3a67, #6b3f8f, #e88aa8, #b3261e); }
.wig-filters__swatch:hover .wig-filters__dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--wig-ink); }
.wig-filters__swatch.is-on { border-color: var(--wig-ink); }
.wig-filters__swatch.is-on .wig-filters__dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--wig-ink); }
.wig-filters__swatch.is-empty { opacity: .25; pointer-events: none; }
.wig-filters__swatch:focus-visible { outline: 2px solid var(--wig-link); outline-offset: 2px; }
.wig-filters__chips .wig-filters__dot { width: 12px; height: 12px; }

/* size chips */
.wig-filters__chipset { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wig-filters__chip { display: inline-block; min-width: 40px; text-align: center; padding: 5px 9px; border: 1px solid var(--wig-line); border-radius: 6px; background: #fff; color: var(--wig-ink); font-size: 13px; text-decoration: none; text-transform: none; }
.wig-filters__chip:hover { border-color: var(--wig-ink); }
.wig-filters__chip.is-on { background: var(--wig-ink); border-color: var(--wig-ink); color: #fff; font-weight: 700; }
.wig-filters__sizeguide { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--wig-link); }

/* price range */
.wig-filters__range { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.wig-filters__range label { display: flex; align-items: center; border: 1px solid var(--wig-line); border-radius: 6px; background: #fff; padding: 0 6px; flex: 1; min-width: 0; }
.wig-filters__range label span { color: var(--wig-muted); font-size: 12px; }
.wig-filters__range input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 6px 4px; font: inherit; font-size: 13px; color: var(--wig-ink); }
.wig-filters__range input:focus { outline: none; }
.wig-filters__range label:focus-within { border-color: var(--wig-link); box-shadow: 0 0 0 2px rgba(43,58,103,.15); }
.wig-filters__range .wig-filters__dash { color: var(--wig-muted); }
.wig-filters__range button { border: 1px solid var(--wig-ink); background: #fff; color: var(--wig-ink); border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; text-transform: none; cursor: pointer; }
.wig-filters__range button:hover { background: var(--wig-ink); color: #fff; }

/* mobile bar (hidden on desktop) */
.wig-filters__bar { display: none; }
.wig-filters__backdrop { display: none; }

@media (max-width: 900px) {
	.wig-catshop { display: block; }
	.wig-filters__bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-family: var(--wig-ui); }
	.wig-filters__open { border: 1px solid var(--wig-ink); background: #fff; color: var(--wig-ink); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 600; text-transform: none; cursor: pointer; }
	.wig-filters__open b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--wig-cta); color: #fff; font-size: 12px; }
	.wig-filters__count { color: var(--wig-muted); font-size: 13px; }

	.wig-filters {
		position: fixed; inset: auto 0 0 0; z-index: 1001; max-height: 86vh; top: auto;
		background: #fff; border-radius: 16px 16px 0 0; padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
		box-shadow: 0 -12px 40px rgba(0,0,0,.25); transform: translateY(105%); transition: transform .22s ease-out;
	}
	html.wig-filters-open .wig-filters { transform: translateY(0); }
	html.wig-filters-open { overflow: hidden; }
	.wig-filters__close { display: block; border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--wig-muted); cursor: pointer; padding: 0 2px; }
	.wig-filters__backdrop { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(31,26,23,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
	html.wig-filters-open .wig-filters__backdrop { opacity: 1; pointer-events: auto; }
	.wig-filters__backdrop[hidden] { display: block; } /* JS drives visibility via the html class */
	.wig-filters__palette { grid-template-columns: repeat(8, 32px); }
}

/* ── Sort bar (Batch 3, 15 Sept 2026) ── */
.wig-sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 14px; font-family: var(--wig-ui, inherit); font-size: 14px; }
.wig-sortbar__count { color: var(--wig-muted, #6b6b6b); margin-right: auto; }
.wig-sortbar__fast { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--wig-line, #d8d2c8); border-radius: 999px; color: inherit; text-decoration: none; background: #fff; }
.wig-sortbar__fast small { color: var(--wig-muted, #6b6b6b); font-size: 12px; }
.wig-sortbar__fast.is-on { border-color: #1e6b52; background: #eef6f2; color: #1e6b52; font-weight: 600; }
.wig-sortbar__sort label { display: inline-flex; align-items: center; gap: 8px; }
.wig-sortbar__sort select { padding: 7px 28px 7px 10px; border: 1px solid var(--wig-line, #d8d2c8); border-radius: 8px; background: #fff; font: inherit; }
@media (max-width: 700px) { .wig-sortbar__count { width: 100%; } }
