/* Shop, category and product search archives (SPEC "Shop page", Figma catalogue 32729:1175 / 32739:1985). Mobile first. */

.shop-band { padding-bottom: 48px; background: var(--wash); }

/* Page head: base.css */

/* Layout */
.shop { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 24px; }
.shop__side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side-box { margin: 0; min-width: 0; }
.side-box__label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; /* visible from 860px */
	margin: 0 0 10px; font: 500 11.5px/1.2 var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-70);
}

/* Categories: scrollable chips on phones, a list in the sidebar from 860px */
.cat-list {
	display: flex; gap: 8px; margin: 0 -5vw; padding: 2px 5vw 6px; list-style: none;
	overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 5vw; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-list::-webkit-scrollbar { display: none; }
.cat-list li { flex: none; scroll-snap-align: start; }
.cat-list a {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 16px;
	border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line);
	font: 500 14px/1.2 var(--font-text); color: var(--ink); text-decoration: none; white-space: nowrap;
	transition: background-color .2s, box-shadow .2s;
}
.cat-list__count { font-size: 12px; color: var(--ink-70); }
.cat-list a[aria-current] { background: var(--grad-soft); box-shadow: inset 0 0 0 1.5px var(--orange-100); color: var(--accent-d); }
.cat-list a[aria-current] .cat-list__count {
	display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
	border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-weight: 500;
}

/* Toggle switches */
.side-box--filters { display: flex; flex-wrap: wrap; column-gap: 20px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font: 500 14px/1.2 var(--font-text); }
.switch__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch__track {
	position: relative; width: 40px; height: 24px; flex: none; border-radius: var(--r-pill);
	background: var(--line-2); transition: background-color .25s var(--ease);
}
.switch__track::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
	background: var(--paper); box-shadow: var(--sh); transition: transform .25s var(--ease);
}
.switch__input:checked + .switch__track { background: var(--accent); }
.switch__input:checked + .switch__track::after { transform: translateX(16px); }
.switch__input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Search (hidden on phones: the header search covers it) */
.side-box--search { display: none; }
.field-search { position: relative; }
.field-search__icon { position: absolute; top: 50%; left: 16px; width: 18px; height: 18px; translate: 0 -50%; color: var(--ink-70); pointer-events: none; }
.field-search input {
	width: 100%; min-height: 48px; padding: 0 16px 0 44px;
	border: 1.5px solid var(--line-2); border-radius: var(--r-pill); background: var(--paper);
	font-size: 16px; outline: none; transition: border-color .2s;
}
.field-search input:focus { border-color: var(--accent); }
.field-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-search input::-webkit-search-cancel-button { cursor: pointer; }

/* Toolbar */
.shop__main { min-width: 0; }
.shop__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.shop__count { margin: 0; font: 500 14px/1.2 var(--font-text); color: var(--ink-70); }
.woocommerce-ordering { position: relative; margin: 0; }
.woocommerce-ordering::after {
	content: ""; position: absolute; top: 50%; right: 16px; width: 16px; height: 16px; translate: 0 -50%;
	background: var(--ink-70); pointer-events: none;
	-webkit-mask: url(../icons/chevron.svg) center / contain no-repeat; mask: url(../icons/chevron.svg) center / contain no-repeat;
}
.woocommerce-ordering select {
	appearance: none; -webkit-appearance: none; max-width: 52vw; min-height: 44px; padding: 0 40px 0 16px;
	border: 1.5px solid var(--line-2); border-radius: var(--r-pill); background: var(--paper);
	font: 500 16px/1.2 var(--font-text); color: var(--ink); text-overflow: ellipsis; cursor: pointer;
}
.woocommerce-ordering select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Grid */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pgrid > li { min-width: 0; }

/* Pagination */
.woocommerce-pagination { margin-top: 32px; }
.woocommerce-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.woocommerce-pagination .page-numbers {
	display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
	border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line);
	font: 500 14px/1 var(--font-text); color: var(--ink); text-decoration: none;
}
.woocommerce-pagination .page-numbers.current { background: var(--ink); color: var(--paper); box-shadow: none; }

/* Empty state */
.shop__empty {
	display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 20px; text-align: center;
	border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper);
}
.shop__empty p { margin: 0; }
.shop__empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--wash-accent); color: var(--accent); }
.shop__empty-icon svg { width: 22px; height: 22px; }

.shop__note { margin: 24px 0 0; color: var(--ink-70); }

@media (min-width: 640px) {
	.side-box--search { display: block; margin-top: 8px; }
	.pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
	.woocommerce-ordering select { max-width: none; }
}

@media (min-width: 860px) {
	.shop-band { padding-bottom: 72px; }
	.shop { grid-template-columns: 248px minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: start; margin-top: 38px; }
	.shop__side { position: sticky; top: 100px; gap: 14px; }
	.side-box { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); }
	.side-box__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
	.cat-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; overflow: visible; }
	.cat-list a { min-height: 40px; padding: 0 12px; border-radius: var(--r-img); background: transparent; box-shadow: none; }
	.cat-list a:hover { background: var(--wash); color: var(--ink); }
	.cat-list a[aria-current], .cat-list a[aria-current]:hover { background: var(--grad-soft); box-shadow: inset 0 0 0 1.5px var(--orange-100); color: var(--accent-d); }
	.side-box--filters { flex-direction: column; }
	.side-box--search { margin-top: 0; }
	.pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
	.pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 4 columns once a card is ≥ 200px wide (the spec's 1180px leaves 183px cards beside the sidebar) */
@media (min-width: 1280px) {
	.pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
