/* =========================================================================
   Metal Universe Shop – shop & category pages with filters.
   Layout: header → category tiles → toolbar (Филтри · За кого · sort) → pills →
   [sidebar | product grid]. Phones: the sidebar becomes a bottom drawer.
   Colours come from the archive tokens (--oc-*) + the accent setting.
   ========================================================================= */

body.oc-archive .sh-shop {
	--sh-radius: 12px;
	--sh-soft: #1C1C1C;
	position: relative;
	font-family: var(--oc-body);
	color: var(--oc-ink);
}
body.oc-archive .sh-shop.is-loading .sh-results { opacity: .45; pointer-events: none; transition: opacity .15s; }
body.oc-archive .sh-shop.is-loading .sh-filters { pointer-events: none; }

/* ---------- Header ---------- */
body.oc-archive .sh-crumbs { margin: 0 0 14px; font-size: 13px; color: var(--oc-muted); }
body.oc-archive .sh-crumbs a { color: var(--oc-muted); text-decoration: none; }
body.oc-archive .sh-crumbs a:hover { color: var(--oc-ink); }
body.oc-archive .sh-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 6px; }
body.oc-archive .sh-title { margin: 0; font-family: var(--oc-head); font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
body.oc-archive .sh-count { font-size: 14px; color: var(--oc-muted); font-variant-numeric: tabular-nums; }
body.oc-archive .sh-desc { max-width: 70ch; margin: 0 0 8px; font-size: 15px; line-height: 1.6; color: var(--oc-muted); }
body.oc-archive .sh-desc p { margin: 0 0 8px; }

/* ---------- Category tiles ---------- */
body.oc-archive .sh-tiles { display: flex; gap: 14px; margin: 20px 0 22px; padding: 2px 2px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
body.oc-archive .sh-tile { flex: 0 0 auto; width: 118px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--oc-ink); scroll-snap-align: start; }
body.oc-archive .sh-tile__img { display: flex; align-items: center; justify-content: center; width: 118px; height: 118px; border-radius: 50%; background: var(--oc-well, #F2F2F0); overflow: hidden; border: 2px solid transparent; transition: border-color .15s, transform .2s; }
body.oc-archive .sh-tile__img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
body.oc-archive .sh-tile__ph { font-family: var(--oc-head); font-size: 40px; font-weight: 700; color: var(--oc-muted); }
body.oc-archive .sh-tile__name { font-size: 14px; font-weight: 600; text-align: center; line-height: 1.25; }
body.oc-archive .sh-tile:hover .sh-tile__img { transform: translateY(-2px); }
body.oc-archive .sh-tile.is-active .sh-tile__img { border-color: var(--oc-accent); }
body.oc-archive .sh-tile.is-active .sh-tile__name { color: var(--oc-accent); }

/* ---------- Toolbar ---------- */
body.oc-archive .sh-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-top: 1px solid var(--oc-line-soft, var(--oc-line-soft)); border-bottom: 1px solid var(--oc-line-soft, var(--oc-line-soft)); }
body.oc-archive .sh-filter-btn,
body.oc-archive .sh-filter-btn:hover,
body.oc-archive .sh-filter-btn:focus { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--oc-ink); border-radius: 999px; background: var(--oc-paper); color: var(--oc-ink); font: 600 14px/1 var(--oc-body); cursor: pointer; }
body.oc-archive .sh-filter-btn b { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--oc-accent); color: #fff; font-size: 12px; }
body.oc-archive .sh-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sh-soft); overflow-x: auto; max-width: 100%; }
body.oc-archive .sh-seg a { padding: 7px 14px; border-radius: 999px; color: var(--oc-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
body.oc-archive .sh-seg a:hover { color: var(--oc-ink); }
body.oc-archive .sh-seg a.is-on { background: var(--oc-paper); color: var(--oc-ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
body.oc-archive .sh-sort { margin-left: auto; }
body.oc-archive .sh-sort select { padding: 9px 34px 9px 14px; border: 1px solid var(--oc-line); border-radius: 999px; background-color: var(--oc-paper); color: var(--oc-ink); font: 500 14px var(--oc-body); cursor: pointer; }

/* ---------- Active pills ---------- */
body.oc-archive .sh-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 0; }
body.oc-archive .sh-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--sh-soft); color: var(--oc-ink); font-size: 13px; font-weight: 500; text-decoration: none; }
body.oc-archive .sh-pill span[aria-hidden] { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--oc-paper); font-size: 13px; line-height: 1; }
body.oc-archive .sh-pill:hover { background: var(--oc-line-soft); }
body.oc-archive .sh-pill--clear { padding-right: 12px; background: none; text-decoration: underline; color: var(--oc-muted); }

/* ---------- Layout ---------- */
body.oc-archive .sh-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; margin-top: 24px; align-items: start; }
body.sh-filters-hidden.oc-archive .sh-layout { grid-template-columns: minmax(0, 1fr); }
body.sh-filters-hidden.oc-archive .sh-filters { display: none; }
body.oc-archive .sh-results { min-width: 0; }
body.oc-archive .sh-results ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
body.sh-filters-hidden.oc-archive .sh-results ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

/* ---------- Sidebar ---------- */
body.oc-archive .sh-filters { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
body.oc-archive .sh-filters__head, body.oc-archive .sh-filters__foot, body.oc-archive .sh-scrim { display: none; }
body.oc-archive .sh-facet { border-bottom: 1px solid var(--oc-line-soft, var(--oc-line-soft)); }
body.oc-archive .sh-facet summary { display: flex; align-items: center; gap: 8px; padding: 14px 0; font: 700 14px var(--oc-head); letter-spacing: .02em; text-transform: uppercase; cursor: pointer; list-style: none; }
body.oc-archive .sh-facet summary::-webkit-details-marker { display: none; }
body.oc-archive .sh-facet summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
body.oc-archive .sh-facet[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
body.oc-archive .sh-facet summary b { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--oc-accent); color: #fff; font-size: 11px; }
body.oc-archive .sh-facet__body { padding: 0 0 16px; }
body.oc-archive .sh-facet ul { margin: 0; padding: 0; list-style: none; }
body.oc-archive .sh-facet li { margin: 0; }
body.oc-archive .sh-facet li.is-empty { opacity: .45; }
body.oc-archive .sh-facet label { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; cursor: pointer; }
body.oc-archive .sh-facet input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--oc-accent); flex: none; }
body.oc-archive .sh-opt__name { flex: 1; min-width: 0; }
body.oc-archive .sh-opt__count { font-size: 12px; color: var(--oc-muted); font-variant-numeric: tabular-nums; }
body.oc-archive .sh-facet__search { width: 100%; margin: 0 0 8px; padding: 8px 12px; border: 1px solid var(--oc-line); border-radius: 8px; font: 14px var(--oc-body); }
body.oc-archive .sh-facet--list ul { max-height: 260px; overflow-y: auto; }

/* Size chips */
body.oc-archive .sh-facet--chips ul { display: flex; flex-wrap: wrap; gap: 6px; }
body.oc-archive .sh-facet--chips label { position: relative; justify-content: center; min-width: 46px; padding: 8px 10px; border: 1px solid var(--oc-line); border-radius: 8px; font-weight: 600; font-size: 13px; }
body.oc-archive .sh-facet--chips input { position: absolute; opacity: 0; pointer-events: none; }
body.oc-archive .sh-facet--chips .sh-opt__count { display: none; }
body.oc-archive .sh-facet--chips label:has(input:checked) { border-color: var(--oc-accent); background: var(--oc-accent); color: #fff; }
body.oc-archive .sh-facet--chips label:has(input:focus-visible) { outline: 2px solid var(--oc-accent); outline-offset: 2px; }

/* Colour swatches */
body.oc-archive .sh-facet--swatches ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px 6px; }
body.oc-archive .sh-facet--swatches label { position: relative; flex-direction: column; gap: 5px; padding: 0; font-size: 11.5px; text-align: center; }
body.oc-archive .sh-facet--swatches input { position: absolute; opacity: 0; pointer-events: none; }
body.oc-archive .sh-facet--swatches .sh-opt__count { display: none; }
body.oc-archive .sh-sw { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); border: 2px solid var(--oc-paper); outline: 1px solid transparent; transition: outline-color .15s; }
body.oc-archive .sh-facet--swatches label:has(input:checked) .sh-sw { outline: 2px solid var(--oc-ink); }
body.oc-archive .sh-facet--swatches label:has(input:focus-visible) .sh-sw { outline: 2px solid var(--oc-accent); }

/* Price range */
body.oc-archive .sh-range { --a: 0%; --b: 100%; position: relative; height: 28px; }
body.oc-archive .sh-range::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--oc-line) var(--a), var(--oc-accent) var(--a), var(--oc-accent) var(--b), var(--oc-line) var(--b)); }
body.oc-archive .sh-range input { position: absolute; left: 0; top: 4px; width: 100%; height: 20px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
body.oc-archive .sh-range input::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--oc-accent); background: var(--oc-paper); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
body.oc-archive .sh-range input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--oc-accent); background: var(--oc-paper); cursor: pointer; }
body.oc-archive .sh-range__out { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--oc-muted); font-variant-numeric: tabular-nums; }

/* Toggles */
body.oc-archive .sh-toggles { display: grid; gap: 12px; padding: 18px 0 8px; }
body.oc-archive .sh-switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
body.oc-archive .sh-switch input { position: absolute; opacity: 0; pointer-events: none; }
body.oc-archive .sh-switch__ui { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--oc-line); transition: background .15s; }
body.oc-archive .sh-switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--oc-paper); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
body.oc-archive .sh-switch input:checked + .sh-switch__ui { background: var(--oc-accent); }
body.oc-archive .sh-switch input:checked + .sh-switch__ui::after { transform: translateX(16px); }
body.oc-archive .sh-switch input:focus-visible + .sh-switch__ui { outline: 2px solid var(--oc-accent); outline-offset: 2px; }

/* ---------- Product cards ---------- */
body.oc-archive .sh-results ul.products li.product { position: relative; }
body.oc-archive .sh-badge { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 9px; border-radius: 999px; background: var(--oc-paper); color: var(--oc-ink); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
body.oc-archive .sh-badge--out { background: rgba(17, 17, 17, .82); color: var(--oc-ink); border: 1px solid var(--oc-line); box-shadow: none; text-transform: uppercase; letter-spacing: .08em; }
body.oc-archive li.product.outofstock img { opacity: .55; filter: grayscale(.6); }

/* Sizes under the title: available ones plain, sold-out ones struck through. */
body.oc-archive .sh-sizes { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
body.oc-archive .sh-sizes i { min-width: 26px; padding: 2px 5px; border: 1px solid var(--oc-line); border-radius: 4px; font-style: normal; font-size: 11.5px; font-weight: 600; line-height: 1.4; text-align: center; color: var(--oc-ink-2); }
body.oc-archive .sh-sizes i.is-out { color: var(--oc-muted); opacity: .5; text-decoration: line-through; }
body.oc-archive .sh-results ul.products li.product .onsale { top: 10px; right: 10px; left: auto; min-width: 0; min-height: 0; margin: 0; padding: 4px 9px; border-radius: 999px; background: var(--oc-accent); font-size: 11.5px; line-height: 1.3; }
body.oc-archive .sh-dots { display: flex; align-items: center; gap: 4px; margin: 2px 0 6px; }
body.oc-archive .sh-dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
body.oc-archive .sh-dots em { font-style: normal; font-size: 12px; color: var(--oc-muted); }

body.oc-archive .sh-empty { display: flex; flex-direction: column; gap: 6px; padding: 48px 24px; border: 1px dashed var(--oc-line); border-radius: var(--sh-radius); text-align: center; color: var(--oc-muted); }
body.oc-archive .sh-empty strong { color: var(--oc-ink); font-size: 17px; }
body.oc-archive .sh-empty a { color: var(--oc-accent); }

/* ---------- Tablet / phone: sidebar becomes a drawer ---------- */
@media (max-width: 999px) {
	body.oc-archive .sh-layout { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
	body.oc-archive .sh-results ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 24px 14px !important; }
	body.oc-archive .sh-sort { margin-left: 0; }
	body.oc-archive .sh-toolbar { gap: 10px; }
	body.oc-archive .sh-seg { order: 3; width: 100%; }
	body.oc-archive .sh-tile, body.oc-archive .sh-tile__img { width: 88px; }
	body.oc-archive .sh-tile__img { height: 88px; }
	body.oc-archive .sh-tile__name { font-size: 13px; }

	body.oc-archive .sh-filters {
		position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 100001;
		display: flex; flex-direction: column; max-height: 88vh; max-height: 88dvh; padding: 0;
		border-radius: 18px 18px 0 0; background: var(--oc-paper); box-shadow: 0 -12px 40px rgba(0,0,0,.2);
		transform: translateY(105%); transition: transform .25s ease; overflow: hidden;
	}
	body.sh-drawer-open.oc-archive .sh-filters { transform: none; }
	body.sh-filters-hidden.oc-archive .sh-filters { display: flex; }
	body.oc-archive .sh-filters__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--oc-line-soft, var(--oc-line-soft)); font-size: 17px; }
	body.oc-archive .sh-x, body.oc-archive .sh-x:hover, body.oc-archive .sh-x:focus { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--oc-well, #F2F2F0); color: var(--oc-ink); font-size: 22px; line-height: 1; cursor: pointer; }
	body.oc-archive .sh-filters__form { flex: 1; overflow-y: auto; padding: 0 18px 12px; }
	body.oc-archive .sh-filters__foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--oc-line-soft, var(--oc-line-soft)); }
	body.oc-archive .sh-clear { display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--oc-line); border-radius: 10px; color: var(--oc-ink); font-weight: 600; text-decoration: none; }
	body.oc-archive .sh-show, body.oc-archive .sh-show:hover, body.oc-archive .sh-show:focus { flex: 1; min-height: 48px; border: 0; border-radius: 10px; background: var(--oc-accent); color: #fff; font: 700 15px var(--oc-body); cursor: pointer; }
	body.oc-archive .sh-scrim { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
	body.sh-drawer-open.oc-archive .sh-scrim { display: block; opacity: 1; pointer-events: auto; }
	body.sh-drawer-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	body.oc-archive .sh-filters, body.oc-archive .sh-tile__img, body.oc-archive .sh-scrim { transition: none; }
}

/* ---------- Toggles sit between price and colour ---------- */
body.oc-archive .sh-toggles { padding: 16px 0; border-bottom: 1px solid var(--oc-line-soft, var(--oc-line-soft)); }

/* ---------- Sticky sidebar with its own scroll (desktop) ----------
   --sh-top is set by mu-shop.js from the sticky header's height. */
@media (min-width: 1000px) {
	body.oc-archive .sh-filters {
		position: sticky;
		top: var(--sh-top, 24px);
		max-height: calc(100vh - var(--sh-top, 24px) - 24px);
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-right: 10px;
	}
	body.oc-archive .sh-filters::-webkit-scrollbar { width: 6px; }
	body.oc-archive .sh-filters::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--oc-line); }
}

/* ---------- Pagination ---------- */
body.oc-archive .sh-results .woocommerce-pagination { margin: 40px 0 8px; text-align: center; }
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; border: 0; white-space: normal; }
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li { float: none; margin: 0; border: 0; overflow: visible; }
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; height: 44px; padding: 0 14px;
	border: 1px solid var(--oc-line); border-radius: 999px;
	background: var(--oc-paper); color: var(--oc-ink);
	font: 600 15px/1 var(--oc-body); text-decoration: none;
	transition: border-color .15s, background .15s, color .15s;
}
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li a.page-numbers:hover { border-color: var(--oc-accent); background: var(--oc-paper); color: var(--oc-ink); }
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li span.current { border-color: var(--oc-accent); background: var(--oc-accent); color: #fff; }
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li .dots { border-color: transparent; background: none; min-width: 24px; padding: 0; }
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li .next,
body.oc-archive .sh-results .woocommerce-pagination ul.page-numbers li .prev { padding: 0 18px; }

/* ---------- Title block: keep it readable whatever the theme kit does to h1 / spans ---------- */
body.oc-archive .sh-shop .sh-head { display: flex !important; }
body.oc-archive .sh-shop .sh-title { display: block !important; color: var(--oc-ink) !important; visibility: visible !important; opacity: 1 !important; }
body.oc-archive .sh-shop .sh-count { display: inline !important; color: var(--oc-muted) !important; }
body.oc-archive .sh-tile__name small { font-weight: 400; color: var(--oc-muted); font-size: 12px; }
body.oc-archive .sh-dots i[data-href] { cursor: pointer; transition: transform .12s; }
body.oc-archive .sh-dots i[data-href]:hover { transform: scale(1.25); }
body.oc-archive .sh-dots i.is-on { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px var(--oc-paper), 0 0 0 3px var(--oc-ink); }
