/* Каталог и карточка товара */

.sec__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 48px); }

/* ---------- каталог ---------- */
.cat { padding-bottom: var(--sec); }
.filters {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap;
  padding: 14px 0; margin-bottom: 8px; background: var(--bg); transition: top .4s var(--ease-out);
}
body:not(.hdr-hidden) .filters { top: var(--header-h); }
.filters__right { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.chip__x { width: 16px; height: 16px; }
.cat__count { font-size: var(--t-small); margin-bottom: 24px; min-height: 1.5em; }
.cat__empty { padding: 48px 0; display: grid; gap: 24px; justify-items: start; }
.cat__empty-b { display: flex; gap: 12px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: .9375rem; font-weight: 500; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--wool); transition: background-color .25s; flex: none; }
.switch__ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); transition: transform .35s var(--ease-out); box-shadow: 0 1px 3px rgba(30, 38, 34, .2); }
.switch input:checked + .switch__ui { background: var(--ink); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 3px solid var(--rowan); outline-offset: 3px; }

@media (max-width: 760px) {
  .filters { flex-direction: column; align-items: stretch; }
  .filters .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); scrollbar-width: none; }
  .filters .chips::-webkit-scrollbar { display: none; }
}

/* ---------- карточка товара ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px clamp(40px, 6vw, 88px); align-items: start; padding-bottom: clamp(56px, 7vw, 96px); }
.pd__gal { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.pd__main { grid-column: 2; grid-row: 1; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--wool); max-height: calc(100svh - var(--header-h) - 40px); }
.pd__main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.pd__thumbs { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 10px; max-height: calc(100svh - var(--header-h) - 40px); overflow-y: auto; scrollbar-width: none; }
.pd__thumbs::-webkit-scrollbar { display: none; }
.pd__thumb { flex: none; width: 88px; aspect-ratio: 3 / 4; padding: 0; border: 2px solid transparent; border-radius: var(--r); overflow: hidden; background: var(--wool); transition: border-color .25s, opacity .25s; opacity: .72; }
.pd__thumb:hover { opacity: 1; }
.pd__thumb[aria-pressed="true"] { border-color: var(--ink); opacity: 1; }
.pd__thumb img { width: 100%; height: 100%; object-fit: cover; }

.pd__info { display: grid; gap: 22px; align-content: start; padding-top: 4px; }
.pd__title { font: 400 clamp(2.125rem, 1.5rem + 2vw, 3.25rem)/1.05 var(--f-display); }
.pd__price { font-size: 1.75rem; font-weight: 500; letter-spacing: -.01em; }
.pd__price s { font-size: 1.25rem; font-weight: 400; color: var(--ink-2); margin-right: 8px; }
.pd__status { color: var(--ink-2); }
.pd__desc { font-size: var(--t-lead); line-height: 1.6; max-width: 52ch; }
.pd__label { font-weight: 500; margin-bottom: 12px; }
.pd__sizes .chips.is-need .chip { border-color: var(--rowan); }
.pd__buy { display: grid; gap: 10px; max-width: 440px; }
.pd__note { font-size: var(--t-small); line-height: 1.55; color: var(--ink-2); max-width: 52ch; }
.pd__stitch { max-width: 440px; margin: 6px 0; }
.pd__h { font: 400 1.5rem/1.2 var(--f-display); margin-bottom: 14px; }
.pd__hint { margin-top: 12px; max-width: 52ch; }

.mtable { width: 100%; max-width: 460px; border-collapse: collapse; font-size: 1rem; }
.mtable th, .mtable td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.mtable th { font-weight: 400; color: var(--ink-2); }
.mtable td { font-weight: 600; text-align: right; width: 30%; }
.mtable tr:nth-child(odd) { background: linear-gradient(var(--wool-2), var(--wool-2)) 0 0 / var(--wave, 100%) 100% no-repeat; }

.pd__facts { margin: 0; display: grid; gap: 0; max-width: 460px; }
.pd__facts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pd__facts dt { color: var(--ink-2); font-size: var(--t-small); padding-top: 2px; }
.pd__facts dd { margin: 0; }
.pd__post { font-size: var(--t-small); }

.pd-missing { padding: 64px var(--gutter) var(--sec); display: grid; gap: 24px; justify-items: start; }
.related { padding-top: 0; }

@media (max-width: 960px) {
  .pd { grid-template-columns: 1fr; }
  .pd__gal { position: static; grid-template-columns: 1fr; }
  .pd__main { grid-column: 1; max-height: none; }
  .pd__thumbs { grid-column: 1; grid-row: 2; flex-direction: row; overflow-x: auto; max-height: none; }
  .pd__thumb { width: 72px; }
  .pd__buy, .mtable, .pd__facts, .pd__stitch { max-width: none; }
}

.sortsel select {
  appearance: none; min-height: 44px; padding: 0 40px 0 18px; border-radius: 999px; border: 1px solid var(--ink); background: transparent
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2622' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat;
  font: 500 .9375rem/1 var(--f-text); color: var(--ink); cursor: pointer;
}
.sortsel select:hover { background-color: var(--wool-2); }
