/* Craft Point — дизайн-система витрины.
   Мир: «оттиск». Мастерская давит символ латунным клише под прессом 1,5 тонны,
   поэтому язык интерфейса — вдавленная линия, точечный регистр из знака и
   бирка-образец. Направление зафиксировано в docs/brand.md. */

/* --- Шрифты (локальные, внешних запросов нет) --- */

@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-cyr.f1d30cea5d0a.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Alegreya";
  src: url("../fonts/alegreya-lat.97a4bfd7b3ce.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}
@font-face {
  font-family: "Golos";
  src: url("../fonts/golos-cyr.c7635a080bad.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos";
  src: url("../fonts/golos-lat.f57df9832ab8.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}

:root {
  --paper: #faf5ec;
  --paper-2: #f2e9d9;
  --paper-3: #e8dcc6;
  --ink: #191512;
  --ink-2: #4a3f35;
  --ink-3: #776a5b;
  --brass: #a87b3e;
  --brass-2: #855f2c;
  --leather: #241c17;
  --leather-2: #33281f;
  --line: #ddd0b8;
  --line-strong: #c6b596;
  --sage: #5c6b4f;
  --alarm: #9a3b2f;

  --display: "Alegreya", Georgia, serif;
  --label: "Golos", "Segoe UI", system-ui, sans-serif;

  --page: 1280px;
  --gut: clamp(20px, 4vw, 56px);

  /* Оттиск: тёмная линия и световая грань под ней. */
  --deboss: inset 0 1px 0 rgba(25, 21, 18, 0.16), 0 1px 0 rgba(255, 255, 255, 0.75);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 1.7rem + 3.6vw, 5rem); }
h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 3.1rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.005em; }

p { margin: 0 0 1.1em; max-width: 68ch; }

.page { max-width: var(--page); margin: 0 auto; padding: 0 var(--gut); }
.page--wide { max-width: 1600px; }

/* Служебная типографика: подписи мастерской, набитые узким гротеском. */
.label {
  font-family: var(--label);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lede {
  font-size: clamp(1.06rem, 1rem + 0.4vw, 1.3rem);
  color: var(--ink-2);
  max-width: 54ch;
}

.hint { font-family: var(--label); font-size: 0.82rem; color: var(--ink-3); }

/* --- Шапка --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px var(--gut);
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; flex-shrink: 0; }
.logo__mark { width: 32px; height: 32px; color: var(--ink); flex-shrink: 0; }

.logo__text {
  font-family: var(--display);
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.logo__text small {
  display: block;
  font-family: var(--label);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 5px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-family: var(--label);
  font-size: 0.88rem;
}

.site-nav a { text-decoration: none; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--brass); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

.badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  vertical-align: 1px;
}

.role-note {
  background: var(--leather);
  color: var(--paper-2);
  font-family: var(--label);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.role-note__inner { max-width: 1600px; margin: 0 auto; padding: 9px var(--gut); }
.role-note b { color: var(--brass); font-weight: 600; }

/* --- Первый экран --- */

/* Высота подобрана так, чтобы первый ряд образцов кожи входил в сгиб:
   палитра — доказательство ассортимента, ей нельзя оставаться за краем. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: stretch;
  min-height: min(64vh, 600px);
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hero__text {
  padding: clamp(32px, 4.2vw, 64px) clamp(24px, 4vw, 72px) clamp(32px, 4.2vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  margin-left: auto;
}

.hero h1 { margin-bottom: 0.34em; font-size: clamp(2.4rem, 1.6rem + 3vw, 4.2rem); }
.hero h1 em { font-style: italic; color: var(--brass-2); }

.hero__photo { position: relative; overflow: hidden; background: var(--paper-2); }

/* Снимок выведен из потока: иначе высоту первого экрана задавал его
   интринсик (902px при 1200×1400), а не сетка, и палитра уходила за сгиб. */
.hero__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes settle {
  from { transform: scale(1.06); filter: blur(6px); opacity: 0.4; }
  to { transform: none; filter: none; opacity: 1; }
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; align-items: center; }

.hero__palette {
  display: inline-flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 34px;
  text-decoration: none;
  width: fit-content;
}

.hero__chips { display: flex; border: 1px solid var(--line-strong); box-shadow: var(--deboss); width: fit-content; }
.hero__chips span { width: 26px; height: 30px; }
.hero__chips span + span { border-left: 1px solid rgba(250, 245, 236, 0.35); }
.hero__palette:hover .label { color: var(--brass-2); }

/* --- Кнопки --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--label);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover { background: var(--brass-2); border-color: var(--brass-2); }
.btn:disabled { background: var(--paper-3); border-color: var(--line-strong); color: var(--ink-3); cursor: not-allowed; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

.btn--brass { background: var(--brass); border-color: var(--brass); color: #1c1409; }
.btn--brass:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* --- Палитра кожи: главное доказательство ассортимента --- */

.palette { padding: clamp(40px, 5vw, 72px) 0; border-bottom: 1px solid var(--line); }

.palette__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

/* Сетку разделяют рамки самих образцов: заливка контейнера проступала
   пустыми ячейками в неполном последнем ряду. */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 1px;
}

/* Лента образцов: полосы примыкают друг к другу, рамка одна — внешняя.
   Отдельная рамка у каждой ячейки превращала ленту в таблицу. */
.swatches--ribbon {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: var(--deboss);
  padding: 1px 0;
}

.swatch {
  background: var(--paper);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Честный плоский цвет: имитировать блик кожи поверх hex — подделка
   материала там, где рядом лежит настоящая съёмка. */
.swatch__chip { height: 52px; }

.swatch__name { font-family: var(--label); font-size: 0.74rem; line-height: 1.25; color: var(--ink-2); }

/* Состояние — своей строкой: в подпись оно не помещалось и обрезалось. */
.swatch__state { font-family: var(--label); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--brass-2); margin-top: -4px; }

/* Заканчивается — латунная кромка по низу образца: состояние видно и без подписи. */
.swatch--low .swatch__chip { box-shadow: inset 0 -3px 0 var(--brass); }
.swatch--out { opacity: 0.5; }
.swatch--out .swatch__state { color: var(--ink-3); }
.swatch--out .swatch__chip { position: relative; }
.swatch--out .swatch__chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(250, 245, 236, 0.75) 5px 7px);
}

/* --- Разделы страницы --- */

.section { padding: clamp(56px, 7vw, 112px) 0; }
.section--dark { background: var(--leather); color: var(--paper-2); }
.section--dark h2, .section--dark h3 { color: var(--paper); }
.section--dark .lede { color: #c8b9a4; }
.section--dark .label { color: var(--brass); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 3vw, 48px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.section--dark .section__head { border-bottom-color: rgba(214, 197, 172, 0.24); }
.section__head h2 { margin: 0; }

.section__link {
  font-family: var(--label);
  font-size: 0.86rem;
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 2px;
  white-space: nowrap;
}

/* --- Разделы каталога: чередование масштаба, а не одинаковые плитки --- */

.rows { display: flex; flex-direction: column; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(28px, 3.5vw, 52px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.row:first-child { border-top: 1px solid var(--line); }
.row:nth-child(even) > .row__media { order: -1; }
.row__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.row__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.row:hover .row__media img { transform: scale(1.03); }
.row h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem); margin-bottom: 0.3em; }
.row__meta { font-family: var(--label); font-size: 0.84rem; color: var(--ink-3); }
.row p { color: var(--ink-2); margin-bottom: 0.7em; }

/* --- Сетка товаров --- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: clamp(18px, 2vw, 32px);
}

/* Карточка — бирка-образец: снимок, вдавленная линия, подпись мастерской. */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--paper);
  height: 100%;
}

.card__media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.card:hover .card__media img { transform: scale(1.04); }

.card__body { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-size: 1.06rem; font-weight: 500; line-height: 1.25; margin: 0; }
.card__meta { font-family: var(--label); font-size: 0.78rem; color: var(--ink-3); margin: 0; }

.card__foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card:hover .card__foot { border-top-color: var(--brass); }

.price { font-family: var(--display); font-weight: 700; font-size: 1.14rem; font-variant-numeric: tabular-nums; }
.price__note { font-family: var(--label); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass-2); }

.dots { display: flex; gap: 3px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(25, 21, 18, 0.16); }

/* --- Тиснения: клише на тёмной коже --- */

.dies { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px; }

.die {
  background: var(--leather);
  box-shadow: 0 0 0 1px rgba(214, 197, 172, 0.22);
  padding: 26px 22px 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
  transition: background 0.25s ease;
}

.die:hover { background: var(--leather-2); }

.die__media { display: block; aspect-ratio: 1; overflow: hidden; margin: -26px -22px 6px; background: var(--leather-2); }
.die__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.die:hover .die__media img { transform: scale(1.04); }
.die__media .die__stamp { margin: 40px auto; }
.die__name { font-size: 1.18rem; font-weight: 500; color: var(--paper); line-height: 1.2; }
.die__size { font-family: var(--label); font-size: 0.75rem; color: #a2937f; }
.die__price { margin-top: auto; font-family: var(--label); font-size: 0.8rem; color: var(--brass); }

.die__stamp { width: 44px; height: 44px; color: var(--brass); opacity: 0.85; }

/* --- Спецификация: вдавленная таблица --- */

.spec {
  border-top: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  margin-top: 32px;
  padding-top: 20px;
}
.spec dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 0; font-size: 0.96rem; }
.spec dt { font-family: var(--label); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--ink-3); align-self: baseline; }
.spec dd { margin: 0; color: var(--ink-2); }

/* --- Карточка товара --- */

.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 4vw, 72px); align-items: start; }

.product__gallery { position: sticky; top: 92px; }
.product__photo { aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.product__photo img { width: 100%; height: 100%; object-fit: cover; }

.product__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; margin-top: 8px; }

.product__thumbs button {
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
}

.product__thumbs button[aria-current="true"] { border-color: var(--ink); }
.product__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.7rem); }

.product__price { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 6px; }
.product__price .price { font-size: clamp(2rem, 1.5rem + 1.4vw, 2.7rem); }

/* --- Конфигуратор --- */

.config { margin-top: 26px; }
.config__group { margin-bottom: 24px; }
.config__label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }

.chip span {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(25, 21, 18, 0.18);
  box-shadow: inset 0 -6px 10px rgba(25, 21, 18, 0.12);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.chip input:checked + span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }
.chip input:focus-visible + span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--brass); }
.chip--out span { cursor: not-allowed; opacity: 0.3; }
.chip--out::after {
  content: "";
  position: absolute;
  inset: 50% 2px auto;
  height: 1px;
  background: var(--ink);
  transform: rotate(-45deg);
}

.select {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--label);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: var(--deboss);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%234a3f35' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5.5 7 9.5 11 5.5'/%3E%3C/svg%3E");
  background-position: calc(100% - 13px) center;
  background-size: 14px 14px;
  background-repeat: no-repeat;
}

.select:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.select option:disabled { color: var(--ink-3); }

.stock { display: inline-flex; align-items: center; gap: 7px; font-family: var(--label); font-size: 0.8rem; color: var(--ink-2); }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.stock--low::before { background: var(--brass); }
.stock--out::before { background: var(--alarm); }

.notice { font-family: var(--label); font-size: 0.84rem; color: var(--alarm); margin: 8px 0 0; }

/* --- Корзина --- */

.cart { border-top: 1px solid var(--line); margin-top: 28px; }

.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: clamp(14px, 2vw, 32px);
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line--warn { background: linear-gradient(to right, rgba(154, 59, 47, 0.06), transparent 60%); }
.cart-line__media { display: block; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__title { font-size: 1.1rem; font-weight: 500; text-decoration: none; display: block; margin-bottom: 8px; }
.cart-line__title:hover { color: var(--brass-2); }

.cart-line__options {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 16px;
  margin: 0;
  font-family: var(--label);
  font-size: 0.82rem;
}

.cart-line__options dt { color: var(--ink-3); }
.cart-line__options dd { margin: 0; color: var(--ink-2); }

.cart-line__qty { display: flex; flex-direction: column; gap: 6px; width: 108px; }
.cart-line__qty .select { padding: 9px 10px; text-align: center; background-image: none; }

.cart-line__apply,
.cart-line__remove {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--label);
  font-size: 0.78rem;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-line__apply:hover, .cart-line__remove:hover { color: var(--ink); }
.cart-line__sum { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }

.cart-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 26px;
}

.price--lg { display: block; font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.5rem); margin: 4px 0 6px; }

.messages { list-style: none; margin: 0; padding: 0; }

.messages li {
  font-family: var(--label);
  font-size: 0.88rem;
  padding: 11px var(--gut);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.messages li.error { background: rgba(154, 59, 47, 0.1); color: var(--alarm); }

/* --- Смысл символа --- */

.meaning {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.5;
  border-top: 2px solid var(--brass);
  padding-top: 22px;
  max-width: 58ch;
}

.meaning p:first-child::first-letter {
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
  color: var(--brass-2);
}

/* --- Хлебные крошки --- */

.crumbs { font-family: var(--label); font-size: 0.78rem; color: var(--ink-3); padding: 22px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs i { font-style: normal; margin: 0 7px; color: var(--line-strong); }

/* --- Подвал --- */

.site-footer { background: var(--leather); color: #b7a894; padding: clamp(48px, 6vw, 88px) 0 36px; margin-top: clamp(56px, 7vw, 112px); }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 36px; }
.site-footer h3 { font-family: var(--label); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.site-footer a { display: block; padding: 5px 0; color: #d6c8b4; text-decoration: none; font-size: 0.95rem; }
.site-footer a:hover { color: #fff; }
.site-footer__legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(214, 197, 172, 0.2); font-family: var(--label); font-size: 0.78rem; color: #a0917d; }

/* --- Прочее --- */

[x-cloak] { display: none !important; }
.empty { padding: clamp(48px, 7vw, 96px) 0; text-align: center; color: var(--ink-3); }
.stack > * + * { margin-top: 26px; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__photo { aspect-ratio: 4 / 3; order: -1; }
  .hero__text { margin-left: 0; padding: 36px var(--gut) 44px; }
  .product { grid-template-columns: 1fr; }
  .product__gallery { position: static; }
  .row { grid-template-columns: 1fr; gap: 18px; }
  .row:nth-child(even) > .row__media { order: 0; }
  .row__media { order: -1; }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  .site-nav { gap: 16px; font-size: 0.8rem; overflow-x: auto; }
  .swatches { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .site-header__inner { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

.config__submit { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.field-inline { display: flex; flex-direction: column; gap: 7px; width: 96px; }
.field-inline .select { padding: 13px 10px; text-align: center; background-image: none; }

/* Пересчёт цены не должен подменяться молча. */
#price { transition: opacity 0.14s ease; }
#price.htmx-request { opacity: 0.4; }

/* Клеймо мастерской проступает на тёмной коже — знак присутствует на
   странице, а не только в запасной ветке шаблона. */
.section--dark { position: relative; overflow: hidden; }

.section--dark::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 420px;
  height: 420px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='%23a87b3e'%3E%3Ccircle cx='34' cy='20' r='2.1'/%3E%3Ccircle cx='32.1' cy='13' r='2.1'/%3E%3Ccircle cx='27' cy='7.9' r='2.1'/%3E%3Ccircle cx='20' cy='6' r='2.1'/%3E%3Ccircle cx='12.9' cy='7.9' r='2.1'/%3E%3Ccircle cx='7.9' cy='13' r='2.1'/%3E%3Ccircle cx='6' cy='20' r='2.1'/%3E%3Ccircle cx='7.9' cy='27' r='2.1'/%3E%3Ccircle cx='12.9' cy='32.1' r='2.1'/%3E%3Ccircle cx='20' cy='34' r='2.1'/%3E%3Ccircle cx='27.1' cy='32.1' r='2.1'/%3E%3Ccircle cx='32.1' cy='27' r='2.1'/%3E%3Ccircle cx='20' cy='20' r='3.4'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: 0.2;
  pointer-events: none;
}

.section--dark > * { position: relative; z-index: 1; }

/* --- Оформление заказа --- */

.checkout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.checkout__summary { position: sticky; top: 92px; background: var(--paper-2); padding: 26px; border: 1px solid var(--line-strong); box-shadow: var(--deboss); }
.checkout__summary h2 { font-size: 1.3rem; margin-bottom: 16px; }

.fieldset { border: 0; padding: 0; margin: 0 0 34px; }
.fieldset legend { padding: 0; margin-bottom: 16px; }

.field { display: block; margin-bottom: 18px; }
.field--short { max-width: 220px; }
.field__label { display: block; font-family: var(--label); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 7px; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--label);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: var(--deboss);
}

.field textarea { resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }

.carriers { display: flex; flex-direction: column; gap: 1px; margin-bottom: 20px; }

.carrier {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.carrier:has(input:checked) { box-shadow: 0 0 0 2px var(--ink); }
.carrier__body { display: flex; flex-direction: column; gap: 3px; }
.carrier__title { font-size: 1rem; }
.carrier__meta { font-family: var(--label); font-size: 0.78rem; color: var(--ink-3); }
.carrier__cost { font-size: 1.02rem; }

.check { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start; margin-bottom: 14px; font-size: 0.92rem; line-height: 1.45; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--ink); }

.summary { border-top: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.summary__line { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0 4px; border-bottom: 1px solid var(--line); }
.summary__line:last-of-type { border-bottom: 0; }
.summary__opts { font-family: var(--label); font-size: 0.78rem; color: var(--ink-3); margin: 0 0 10px; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-strong); margin-top: 8px; }
.summary__total .price { font-size: 1.5rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; margin-top: 34px; }
.step { padding: 20px 18px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.step p { margin: 8px 0 0; font-size: 0.95rem; }
.step--done { background: var(--leather); }
.step--done .label { color: var(--brass); }
.step--done p { color: var(--paper-2); }

@media (max-width: 900px) {
  .checkout { grid-template-columns: 1fr; }
  .checkout__summary { position: static; order: -1; }
}

/* Утилиты ритма: инлайновые значения в шаблонах мимо токенов не допускаются. */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 32px; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }
.spec--lead { margin-top: 0; border-top-width: 2px; border-top-color: var(--ink); }

/* --- Вход и кабинет --- */

.auth { max-width: 460px; }
.auth__form { margin-top: 28px; }
.auth__split { display: flex; align-items: center; gap: 14px; margin: 28px 0 22px; font-family: var(--label); font-size: 0.78rem; color: var(--ink-3); }
.auth__split::before, .auth__split::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); box-shadow: 0 1px 0 rgba(255,255,255,0.8); }

.orders { display: flex; flex-direction: column; gap: 1px; }
.order { padding: 20px 22px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.order__head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 12px; }
.order__status { font-family: var(--label); font-size: 0.78rem; color: var(--brass-2); }
.order__line { margin: 0 0 4px; font-size: 0.98rem; }
.order__foot { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* --- Тосты --- */

.toasts {
  position: fixed;
  top: 78px;
  right: clamp(12px, 2vw, 28px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--sage);
  box-shadow: 0 6px 20px rgba(25, 21, 18, 0.14);
  font-family: var(--label);
  font-size: 0.9rem;
  line-height: 1.4;
  pointer-events: auto;
  animation: toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast--error { border-left-color: var(--alarm); background: #fdf6f4; }
.toast--warning { border-left-color: var(--brass); }
.toast--out { animation: toast-out 0.2s ease forwards; }

.toast__close {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.toast__close:hover { color: var(--ink); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 700px) {
  .toasts { top: auto; bottom: 16px; left: 12px; right: 12px; max-width: none; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

/* --- Ошибки формы --- */

.errors-summary {
  border: 1px solid var(--alarm);
  border-left-width: 3px;
  background: #fdf6f4;
  padding: 16px 18px;
  margin-bottom: 26px;
}

.errors-summary__title { font-family: var(--label); font-size: 0.9rem; margin: 0 0 8px; color: var(--alarm); }
.errors-summary ul { margin: 0; padding-left: 18px; font-family: var(--label); font-size: 0.88rem; }
.errors-summary li { margin-bottom: 4px; }
.errors-summary a { color: var(--ink); }

.field--error input,
.field--error textarea,
.field--error select,
.field--error .select { border-color: var(--alarm); box-shadow: inset 0 1px 0 rgba(154, 59, 47, 0.2); }

.field__hint { display: block; font-family: var(--label); font-size: 0.8rem; color: var(--alarm); margin-top: 6px; }
.check--error { color: var(--alarm); }
.check--error input { outline: 2px solid var(--alarm); outline-offset: 2px; }

/* --- Блоки-подсказки в кабинете --- */

.promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 22px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--deboss);
  margin-bottom: 28px;
}

.promo h2 { font-size: 1.2rem; margin: 0 0 6px; }
.promo p { margin: 0; font-size: 0.94rem; color: var(--ink-2); max-width: 62ch; }
.promo--soft { background: transparent; border-style: dashed; box-shadow: none; }

.auth__email {
  font-family: var(--label);
  font-size: 1.15rem;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--deboss);
  word-break: break-all;
  margin: 20px 0 24px;
}

.auth__actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* --- Прогресс заказа --- */

.progress { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; margin: 32px 0 0; padding: 0; }

.progress__step {
  padding: 18px 18px 20px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.progress__title { font-family: var(--label); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.progress__text { font-size: 0.95rem; color: var(--ink-2); }

.progress__step--done .progress__title { color: var(--sage); }
.progress__step--done::after { content: "✓"; position: absolute; top: 16px; right: 16px; color: var(--sage); font-size: 0.9rem; }

.progress__step--current { background: var(--leather); box-shadow: 0 0 0 1px var(--leather); }
.progress__step--current .progress__title { color: var(--brass); }
.progress__step--current .progress__text { color: var(--paper-2); }

.progress__step--next { opacity: 0.6; }

.promise { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
.promise b { font-family: var(--display); font-size: 1.5rem; }

/* --- Лента категорий: один элемент на главной и в каталоге --- */

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: clamp(22px, 3vw, 36px);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tabs::-webkit-scrollbar { display: none; }

.tabs__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 11px 16px 13px;
  font-family: var(--label);
  font-size: 0.92rem;
  color: var(--ink-2);
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tabs__item:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.tabs__item--active { color: var(--ink); border-bottom-color: var(--brass); }
.tabs__count { font-size: 0.72rem; color: var(--ink-3); }
.tabs__item--active .tabs__count { color: var(--brass-2); }

/* Появление товаров при переключении: лёгкий подъём со сдвигом по позициям. */
.grid--enter > * { animation: card-in 0.34s cubic-bezier(0.16, 1, 0.3, 1) both; }
.grid--enter > *:nth-child(2) { animation-delay: 0.03s; }
.grid--enter > *:nth-child(3) { animation-delay: 0.06s; }
.grid--enter > *:nth-child(4) { animation-delay: 0.09s; }
.grid--enter > *:nth-child(5) { animation-delay: 0.12s; }
.grid--enter > *:nth-child(6) { animation-delay: 0.15s; }
.grid--enter > *:nth-child(7) { animation-delay: 0.18s; }
.grid--enter > *:nth-child(8) { animation-delay: 0.21s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* --- Компактные карточки разделов на странице каталога --- */

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: clamp(14px, 1.6vw, 22px); }

.cat { display: flex; flex-direction: column; text-decoration: none; background: var(--paper); }
.cat__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.cat__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.cat:hover .cat__media img { transform: scale(1.04); }
.cat__body { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 2px 0; }
.cat__title { font-family: var(--display); font-size: 1.05rem; }
.cat__meta { font-family: var(--label); font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; }

/* Липкая шапка не должна накрывать ленту при переходе по якорю. */
.tabs, [id] { scroll-margin-top: 84px; }
