/* =========================================================
   POTiSHE — десктоп-прототип
   Все координаты и размеры — в пикселях холста 2560×1440
   из САЙТ.pdf. Сцена целиком масштабируется под экран (app.js).
   ========================================================= */

:root {
  /* DESIGN_SYSTEM.md — источник истины */
  --font-family-base: Arial, sans-serif;

  --font-size-catalog-product-title: 32px;
  --font-size-action-buy: 48px;
  --font-size-action-back: 48px;
  --font-size-nav-item: 48px;
  --font-size-product-details: 48px;
  --font-size-checkout: 24px;
  --font-size-page-heading: 64px;

  /* Размеры, которых нет в таблице, сняты с макета САЙТ.pdf (не «по аналогии») */
  --font-size-soon: 48px;              /* SOON в пустой карточке */
  --font-size-product-page-title: 48px;/* название на странице товара */
  --font-size-cart-title: 48px;        /* «корзина» */
  --font-size-cart-item: 20px;         /* название и размер в корзине */
  --font-size-cart-qty: 32px;          /* «1» и «-» */
  --font-size-cart-plus: 20px;         /* «+» */
  --font-size-cart-badge: 36px;        /* счётчик на тележке */

  --color-text: #fff;
  --color-page: #011f0f; /* цвет края нового фона — на очень широких/высоких экранах за его пределами */
}

/* ---------- база ---------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--color-page);
}

/* Вся композиция помещается в окно — страница не прокручивается (REVISION 03) */
html { overflow: hidden; }

body {
  font-family: var(--font-family-base);
  color: var(--color-text);
}

/* курсор из курсор.txt — на всём, включая ссылки и кнопки */
html, body, a, button, button:disabled {
  cursor: url("../assets/ui/cursor.png"), auto;
}

/* Графика не выделяется и не перетаскивается; обычный текст выделяется как обычно */
img, video, button, .nav, .logo, .cart-badge, .qty-value {
  -webkit-user-select: none;
  user-select: none;
}
img { display: block; -webkit-user-drag: none; -webkit-touch-callout: none; }
/* <picture> только выбирает файл (WebP или запасной PNG/GIF) и не влияет на раскладку:
   стили и координаты остаются на самом <img> */
picture { display: contents; }
input, textarea { -webkit-user-select: text; user-select: text; }

a { color: inherit; text-decoration: none; }

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Текст ставится по базовой линии, как в PDF.
   При line-height: 1 у Arial базовая линия на 0.8465em ниже верха строки. */
.t {
  position: absolute;
  margin: 0;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  top: calc(var(--bl) - 0.8465em);
}

/* ---------- фон и сцена ----------
   #stage — композиция 2560×1440 из макета. #bg — фон 3000×1600 в том же масштабе (app.js),
   сдвинутый на 220 px влево: отверстие, звёзды и логотип совпадают с макетом при любом размере окна.
   Фон не отражается, не повторяется и не растягивается. */

#page { position: fixed; inset: 0; overflow: hidden; }

#bg,
#stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
#stage { width: 2560px; height: 1440px; }
#bg { width: 3000px; height: 1600px; overflow: hidden; pointer-events: none; }

#wall-reflections {
  position: absolute;
  inset: 0 auto auto 0;
  width: 3000px;
  height: 1600px;
  transform-origin: 0 0;
  pointer-events: none;
}
#wall-reflections::before, #wall-reflections::after {
  position: absolute;
  inset: 0;
  background: url("../assets/bg/wall-3000.webp") center / 100% 100% no-repeat;
}
@media (min-width: 769px) and (min-aspect-ratio: 25/12) {
  #wall-reflections::before { content: ""; transform: translateX(-100%) scaleX(-1); }
  #wall-reflections::after { content: ""; transform: translateX(100%) scaleX(-1); }
}
@media (min-width: 769px) and (max-aspect-ratio: 8/5) {
  #wall-reflections::before { content: ""; transform: translateY(100%) scaleY(-1); }
}

/* Видео в натуральном размере 1280×720 (без увеличения), по центру отверстия в стене.
   Отверстие в новом фоне (вся прозрачная область): x 891–2146, y 29–375 → видео закрывает его
   с запасом 12 px по бокам, звёзды не растянуты. На холсте композиции это те же 659, −158. */
.bg-stars {
  position: absolute;
  left: 879px;
  top: -158px;
  width: 1280px;
  height: 720px;
  object-fit: cover;
  background: #05040f;
}

.bg-wall { position: absolute; left: 0; top: 0; width: 3000px; height: 1600px; }

/* Логотип уменьшен на 4 % (REVISION 03) с сохранением центра: был 791,145 1000×109,
   центр 1291 × 199.5 → теперь 960×104.64 с тем же центром. */
.logo { position: absolute; left: 811px; top: 147.18px; width: 960px; height: 104.64px; }
.logo img { width: 100%; height: 100%; }

.torch { position: absolute; top: 338px; width: 449px; height: 449px; }
.torch-left { left: 224px; }
.torch-right { left: 1886px; }

.panel { position: absolute; left: 584px; top: 384px; width: 1398px; height: 1042px; }

/* контейнер экранов нулевого размера: дети стоят по координатам холста */
#view { position: absolute; left: 0; top: 0; width: 0; height: 0; }
#view > * { position: absolute; }

/* ---------- кнопка (BUY, НАЗАД, ПЕРЕЙТИ К ОФОРМЛЕНИЮ) ---------- */

.btn {
  position: absolute;
  display: block;
  background: url("../assets/ui/btn.png") 0 0 / 100% 100% no-repeat;
}
.btn:active:not(:disabled) { background-image: url("../assets/ui/btn-pressed.png"); }
.btn > .t { left: 0; width: 100%; text-align: center; }

.btn-buy { width: 232px; height: 93px; font-size: var(--font-size-action-buy); }
.btn-buy > .t { --bl: 63px; }

.btn-back {
  left: 589px;
  top: 391px;
  width: 194px;
  height: 78px;
  font-size: var(--font-size-action-back);
}
.btn-back > .t { --bl: 55px; }

/* ---------- каталог ---------- */

.slot {
  top: 421px;
  width: 309px;
  height: 389px;
  background: url("../assets/ui/card-frame.png") 0 0 / 100% 100% no-repeat;
}

.slot-title {
  --bl: 37px;
  left: 6px;
  width: 291px; /* центр на 151.5 — как на макете */
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: var(--font-size-catalog-product-title);
}

.slot-photo { position: absolute; left: 17px; top: 82px; width: 274px; height: 274px; }
.slot-photo img { width: 100%; height: 100%; }

.photo-lens {
  position: absolute;
  width: 202px;
  height: 202px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
.photo-lens::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/ui/lens.png") center / contain no-repeat;
}
.lens-glass {
  position: absolute;
  inset: 23px;
  overflow: hidden;
  border-radius: 17px;
  background: #8f8f8f;
}
.fps {
  position: fixed;
  left: 4px;
  top: 4px;
  color: #ce69ff;
  font: 16px Arial, sans-serif;
  pointer-events: none;
}
@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .fps { display: none; }
}

.catalog-error {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  padding: 1rem;
  background: #888;
  color: #fff;
  text-align: center;
  z-index: 20;
}

.slot-soon {
  --bl: 246px;
  left: 0;
  width: 309px;
  text-align: center;
  font-size: var(--font-size-soon);
}

/* на макете ценник 194×194, повёрнут на −14.94°, центр в 727.8, 769.8 */
.price-tag {
  position: absolute;
  left: -71.25px;
  top: 251.75px;
  width: 194.1px;
  height: 194.1px;
  transform: rotate(-14.94deg);
  pointer-events: none;
}

.slot-buy { left: 39px; top: 421px; }

/* position задан явно: баннер лежит внутри <picture>, правило #view > * до него не доходит */
.banner { position: absolute; left: 768px; top: 1048px; width: 1023px; height: 268px; }

/* Навигация по центру холста. Ширина — по пунктам, а не на весь холст,
   чтобы невидимая полоса не перекрывала другие кнопки. */
.nav {
  left: 1280px;
  transform: translateX(-50%);
  top: calc(1392px - 0.8465em);
  display: flex;
  gap: 53px;
  font-size: var(--font-size-nav-item);
  line-height: 1;
  white-space: nowrap;
}

/* ---------- страница товара ---------- */

.product-card {
  left: 625px;
  top: 496px;
  width: 533px;
  height: 671px;
  background: url("../assets/ui/card-frame.png") 0 0 / 100% 100% no-repeat;
}

.product-card-title {
  --bl: 62px;
  left: 10px;
  width: 501px; /* центр на 260.5 — как на макете */
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: var(--font-size-product-page-title);
}

.product-photo { position: absolute; left: 29px; top: 140px; width: 472px; height: 472px; }

.product-buy { left: 774px; top: 1224px; }

.details {
  left: 1201px;
  top: 496px;
  width: 382px;
  height: 268px;
  background: url("../assets/ui/details-frame.png") 0 0 / 100% 100% no-repeat;
}

.details-list {
  left: 1229px;
  /* первая базовая линия на 558, шаг 68 */
  top: calc(558px - 34px - 0.3465em);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-product-details);
  line-height: 68px;
  white-space: nowrap;
}

/* ---------- страницы ОФЕРТА / ИНФО / КАНАЛ / СОГЛАШЕНИЕ / ОФОРМЛЕНИЕ ---------- */

/* Заголовок по центру холста. Раньше блок заголовка был шириной во весь холст и
   невидимо накрывал нижнюю часть кнопки НАЗАД — из-за этого она нажималась не по всей площади. */
.page-heading {
  --bl: 489px;
  left: 1280px;
  transform: translateX(-50%);
  font-size: var(--font-size-page-heading);
}

/* Окно с прокруткой — стиль из «Скроллер для офферты и тд.txt».
   На макете пример вставлен с увеличением ×3,42, поэтому все размеры ×3,2
   (3px рамка → 9.6, 10px отступ → 32, 2px обводка → 6.4). */
.scrollbox {
  left: 721px;
  top: 544px;
  width: 1118px;
  height: 774px;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 32px;
  border: 9.6px solid;
  border-top-color: #555;
  border-left-color: #555;
  border-right-color: #fff;
  border-bottom-color: #fff;
  outline: 6.4px solid #8e8e8e;
  background: transparent; /* на макете середина окна серая, как панель */
  -webkit-user-select: text;
  user-select: text;
}

/* ---------- скроллбар из «Скроллер для офферты и тд.txt» ----------
   .sb — окна внутри холста (оферта, инфо, корзина, оформление): размеры ×3.2,
   потому что холст потом уменьшается вместе со всем сайтом. Сама страница не прокручивается. */

.sb::-webkit-scrollbar {
  width: 51.2px;   /* $width: 16px */
  height: 51.2px;
  background: red;
}

.sb::-webkit-scrollbar-corner { background: #8e8e8e; }

.sb::-webkit-scrollbar-thumb,
.sb::-webkit-scrollbar-button {
  /* @mixin volume */
  background-color: #8e8e8e;
  border-width: 3.2px;
  border-style: solid;
  border-color: #373737;
  border-top-color: #8e8e8e;
  border-left-color: #8e8e8e;
  box-shadow: inset 3.2px 3.2px #fff, inset -3.2px -3.2px #888;
}

/* В исходнике два непрозрачных градиента без смешивания — в браузере это
   вертикальные полосы, а не шахматка. На макете и в комментарии к коду —
   шахматка, поэтому она собрана тем же размером плитки и теми же цветами. */
.sb::-webkit-scrollbar-track {
  background-size: 9.6px 9.6px;
  background-image: conic-gradient(#a1a1a1 25%, #bababa 0 50%, #a1a1a1 0 75%, #bababa 0);
}

/* В исходнике длина кнопок не задана, и Chrome сплющивает их на большом
   масштабе. Делаем квадратными, как на примере. */
.sb::-webkit-scrollbar-button:vertical { height: 51.2px; }
.sb::-webkit-scrollbar-button:horizontal { width: 51.2px; }
.sb::-webkit-scrollbar-button:start:increment,
.sb::-webkit-scrollbar-button:end:decrement { display: none; }

.sb::-webkit-scrollbar-button:start:decrement,
.sb::-webkit-scrollbar-button:end:increment {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 25.6px;
}

.sb::-webkit-scrollbar-button:start:decrement:active,
.sb::-webkit-scrollbar-button:end:increment:active {
  border: 3.2px solid #888;
  box-shadow: none;
  background-position: 10.24px 10.24px;
}

.sb::-webkit-scrollbar-button:horizontal:start:decrement {
  background-image: url("data:image/svg+xml,%3Csvg  transform='rotate(180)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6.86 6.86'%3E%3Cpath fill='%231d1d1b' d='M4.41 2.94v-.98h-.98V.98h-.98V0h-.98V6.86h.98v-.98h.98V4.9h.98v-.98h.98v-.98h-.98z'/%3E%3C/svg%3E");
}
.sb::-webkit-scrollbar-button:horizontal:end:increment {
  background-image: url("data:image/svg+xml,%3Csvg  transform='rotate(0)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6.86 6.86'%3E%3Cpath fill='%231d1d1b' d='M4.41 2.94v-.98h-.98V.98h-.98V0h-.98V6.86h.98v-.98h.98V4.9h.98v-.98h.98v-.98h-.98z'/%3E%3C/svg%3E");
}
.sb::-webkit-scrollbar-button:vertical:start:decrement {
  background-image: url("data:image/svg+xml,%3Csvg  transform='rotate(270)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6.86 6.86'%3E%3Cpath fill='%231d1d1b' d='M4.41 2.94v-.98h-.98V.98h-.98V0h-.98V6.86h.98v-.98h.98V4.9h.98v-.98h.98v-.98h-.98z'/%3E%3C/svg%3E");
}
.sb::-webkit-scrollbar-button:vertical:end:increment {
  background-image: url("data:image/svg+xml,%3Csvg  transform='rotate(90)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6.86 6.86'%3E%3Cpath fill='%231d1d1b' d='M4.41 2.94v-.98h-.98V.98h-.98V0h-.98V6.86h.98v-.98h.98V4.9h.98v-.98h.98v-.98h-.98z'/%3E%3C/svg%3E");
}

/* ---------- кнопка корзины ---------- */

.cart-button {
  position: absolute;
  left: 2192px;
  top: 1083px;
  width: 285px;
  height: 285px;
  background: url("../assets/ui/cart-button.png") 0 0 / 100% 100% no-repeat;
}
.cart-button:active, .cart-button.key-pressed {
  background-image: url("../assets/ui/cart-pressed.png");
}

.cart-badge {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 59px;
  height: 59px;
  background: url("../assets/ui/square-raised.png") 0 0 / 100% 100% no-repeat;
  font-size: var(--font-size-cart-badge);
}
.cart-badge > .t { --bl: 42px; left: 0; width: 100%; text-align: center; }

/* ---------- окно корзины ----------
   Немодальное окно поверх сайта, как в старой Windows: не затемняет и не блокирует страницу,
   перетаскивается за заголовок. Живёт поверх окна браузера (position: fixed) и масштабируется
   вместе с холстом (--s), поэтому выглядит ровно как на макете. Позицию ставит app.js. */

.cart {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: 452px;
  height: 617px;
  transform: scale(var(--s, 1));
  transform-origin: 0 0;
  background: url("../assets/ui/cart-window.png") 0 0 / 100% 100% no-repeat;
}

/* заголовок окна — за него тянем (верхняя полоса над списком) */
.cart-titlebar {
  position: absolute;
  left: 0;
  top: 0;
  width: 452px;
  height: 72px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.cart-titlebar:focus-visible { outline: 3.2px dotted #fff; outline-offset: -10px; }

.cart-title {
  --bl: 44px;
  left: 0;
  width: 452px;
  text-align: center;
  font-size: var(--font-size-cart-title);
}

.cart-close {
  position: absolute;
  left: 395px;
  top: 14px;
  width: 41px;
  height: 40px;
  background: url("../assets/ui/close.png") 0 0 no-repeat;
}
.cart-close:active { background-image: url("../assets/ui/close-pressed.png"); }

.cart-list {
  position: absolute;
  left: 26px;
  top: 83px;
  width: 399px;
  height: 395px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cart-item {
  position: relative;
  flex: none;
  width: 399px;
  height: 159px;
  background: url("../assets/ui/cart-item.png") 0 0 / 100% 100% no-repeat;
  font-size: var(--font-size-cart-item);
}

.cart-item-photo { position: absolute; left: 13px; top: 23px; width: 122px; height: 122px; }

.cart-item-name,
.cart-item-size {
  left: 160px;
  max-width: 225px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-name { --bl: 41px; }
.cart-item-size { --bl: 74px; }

.qty-btn,
.qty-value {
  position: absolute;
  background: url("../assets/ui/square-raised.png") 0 0 / 100% 100% no-repeat;
}
.qty-btn > .t,
.qty-value > .t { left: 0; width: 100%; text-align: center; }

.qty-btn { top: 99px; width: 27px; height: 27px; }
.qty-btn:active { background-image: url("../assets/ui/square-inset.png"); }

.qty-minus { left: 160px; font-size: var(--font-size-cart-qty); }
.qty-minus > .t { --bl: 22px; }

.qty-plus { left: 252px; font-size: var(--font-size-cart-plus); }
.qty-plus > .t { --bl: 20px; }

.qty-value {
  left: 200px;
  top: 93px;
  width: 39px;
  height: 39px;
  background-image: url("../assets/ui/square-inset.png");
  font-size: var(--font-size-cart-qty);
}
.qty-value > .t { --bl: 31px; }

.cart-checkout {
  left: 110px;
  top: 494px;
  width: 232px;
  height: 93px;
  font-size: var(--font-size-checkout);
}
.cart-checkout > .t {
  /* две строки, базовые линии 40 и 68 */
  top: calc(40px - 14px - 0.3465em);
  line-height: 28px;
  white-space: normal;
}

/* =========================================================
   REVISION 01
   ========================================================= */

/* ---------- окно-сообщение после оформления (модальное) ---------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.cart:focus,
.msgbox:focus { outline: none; }

/* окно-сообщение: рамка — оригинальная карточка card-frame.png, нарезанная на 9 частей
   (уголки, синяя полоса и вдавленная рамка не растягиваются). По центру экрана, в масштабе холста. */
.msgbox {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  width: 900px;
  padding: 28px 48px 28px;
  border-style: solid;
  border-width: 83px 18px 33px;
  border-image: url("../assets/ui/card-frame.png") 83 18 33 fill / 83px 18px 33px stretch;
  font-size: 32px;
  line-height: 1.35;
  text-align: center;
}
.msgbox-bar {
  position: absolute;
  left: -12px;
  right: -12px;
  top: -77px;
  height: 41px;
}
.msgbox-title {
  margin: 0;
  padding-left: 14px;
  font-size: 32px;
  font-weight: 400;
  line-height: 41px;
  text-align: left;
}
.msgbox-close { left: auto; right: -8px; top: -77px; }
.msgbox-text p { margin: 0 0 12px; }
.msgbox-ok {
  position: relative;
  margin: 20px auto 0;
  width: 232px;
  height: 93px;
  font-size: var(--font-size-action-buy);
}
.msgbox-ok > .t { --bl: 63px; }

/* ---------- текст в окнах ИНФО / КАНАЛ ---------- */

.page-text {
  font-size: 32px;
  line-height: 1.4;
}
.page-text h2 {
  margin: 0 0 20px;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}
.page-text p { margin: 0 0 16px; }
.page-text section > :last-child { margin-bottom: 0; }

/* разделитель — «вдавленная» линия теми же цветами, что рамка окна */
.page-text hr {
  margin: 36px 0;
  border: 0;
  border-top: 3.2px solid #555;
  border-bottom: 3.2px solid #fff;
}

.page-text a {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  word-break: break-all;
}
.page-text a:hover,
.page-text a:focus-visible { background: #0004ff; outline: none; }

.channel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.channel h2 { margin-bottom: 24px; }

/* QR во вдавленной рамке — та же картинка, что у блока деталей товара */
.channel .qr {
  display: block;
  width: 420px;
  height: 420px;
  margin-bottom: 28px;
  border-style: solid;
  border-width: 6px 5px;
  border-image: url("../assets/ui/details-frame.png") 5 4 / 6px 5px stretch;
}
.channel .qr:hover,
.channel .qr:focus-visible { background: none; outline: 3.2px dotted #fff; outline-offset: 8px; }
.channel .qr img { width: 100%; height: 100%; }
.channel p { margin: 0; }

/* ---------- оформление заказа ----------
   С блоком СДЭК и картой форма выше окна, поэтому она прокручивается внутри серой панели
   тем же скроллером, что окна оферты и инфо. Композиция 2560×1440 вокруг не меняется. */

.checkout-scroll {
  left: 612px;
  top: 505px;
  width: 1356px;
  height: 795px;
  overflow-x: hidden;
  overflow-y: auto;
}

.checkout {
  width: 1260px;
  margin: 22px 0 30px 22px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 44px;
  align-items: start;
  font-size: var(--font-size-checkout);
}

/* группа полей — «канавка» в духе старых окон, цвета рамки окна #555 / #fff */
.group {
  min-width: 0;
  margin: 0;
  padding: 12px 24px 4px;
  border: 3.2px solid #555;
  box-shadow: inset 3.2px 3.2px 0 #fff, 3.2px 3.2px 0 #fff;
}
.group > legend {
  padding: 0 12px;
  font-size: 32px;
  line-height: 1;
  background: #8f8f8f; /* цвет панели — линия рамки не пересекает заголовок */
}

.g-buyer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 4px;
}
.g-buyer .c3 { grid-column: span 3; }
.g-buyer .c4 { grid-column: span 4; }
.g-buyer .c5 { grid-column: span 5; }

/* слева внизу — доставка с картой, справа — промокод, оплата, согласие, итог и кнопка */
.g-delivery { grid-column: 1 / span 8; }

.checkout-side {
  grid-column: 9 / span 4;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.field {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 36px; /* место под сообщение об ошибке — форма не прыгает */
}
.field > label,
.field > .field-label { line-height: 1; }
.label-hidden > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* поле ввода: оригинальная вдавленная рамка details-frame.png (впуклость.png) */
.inp {
  display: block;
  width: 100%;
  height: 64px;
  margin: 0;
  padding: 0 14px;
  border-style: solid;
  border-width: 6px 5px;
  border-image: url("../assets/ui/details-frame.png") 5 4 / 6px 5px stretch;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 32px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.inp::placeholder { color: rgba(255, 255, 255, 0.5); opacity: 1; }
.inp:focus { background: rgba(0, 0, 0, 0.07); }
.inp:-webkit-autofill {
  -webkit-text-fill-color: var(--color-text);
  box-shadow: inset 0 0 0 100px #8f8f8f;
  caret-color: var(--color-text);
}

/* ошибка — белый текст на синей полосе (синий — цвет заголовков карточек) */
.field-error {
  position: absolute;
  left: 0;
  bottom: 2px;
  margin: 0;
  padding: 4px 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-checkout);
  line-height: 1;
  background: #0004ff;
}

/* телефон: страна (флаг + код) — как старый выпадающий список */
.phone { position: relative; display: flex; gap: 10px; }
.phone .inp { flex: 1; min-width: 0; }

.phone-country {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 7px 0 14px;
  border-style: solid;
  border-width: 6px 5px;
  border-image: url("../assets/ui/details-frame.png") 5 4 / 6px 5px stretch;
  font-size: 32px;
}
.phone-country:focus-visible,
.choice > input:focus-visible ~ span:last-child { outline: 3.2px dotted #fff; outline-offset: 4px; }
.co-submit:focus-visible { outline: 3.2px dotted #fff; outline-offset: -12px; }

.flag { flex: none; width: 40px; height: 30px; box-shadow: 0 0 0 1.6px #373737; }
.phone-code { min-width: 70px; text-align: left; }

/* кнопка-стрелка: квадрат выдавленный / вдавленный + стрелка из кода скроллера */
.phone-arrow {
  position: relative;
  flex: none;
  width: 39px;
  height: 39px;
  background: url("../assets/ui/square-raised.png") 0 0 / 100% 100% no-repeat;
}
.phone-arrow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg  transform='rotate(90)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6.86 6.86'%3E%3Cpath fill='%231d1d1b' d='M4.41 2.94v-.98h-.98V.98h-.98V0h-.98V6.86h.98v-.98h.98V4.9h.98v-.98h.98v-.98h-.98z'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.phone-country:active .phone-arrow,
.phone-country[aria-expanded="true"] .phone-arrow { background-image: url("../assets/ui/square-inset.png"); }
.phone-country:active .phone-arrow::after,
.phone-country[aria-expanded="true"] .phone-arrow::after { background-position: calc(50% + 2px) calc(50% + 2px); }

/* выпадающие списки (страны, города, пункты выдачи): рамка — квадрат выдавленный.png */
.dropdown {
  position: absolute;
  left: 0;
  top: 70px;
  z-index: 5;
  width: 100%;
  max-height: 540px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
  background: #8f8f8f;
  border-style: solid;
  border-width: 4px;
  border-image: url("../assets/ui/square-raised.png") 4 / 4px stretch;
  outline: none;
}
.phone-list { width: 470px; }
.phone-option {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 14px;
  font-size: 32px;
  white-space: nowrap;
}
.phone-option-name { flex: 1; }
.phone-option.is-active,
.dropdown-option.is-active { background: #0004ff; }

.combo { position: relative; }
.dropdown-option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  padding: 8px 14px;
  font-size: 32px;
  line-height: 1.15;
}
.dropdown-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-sub { font-size: var(--font-size-checkout); }

/* чекбокс и радио: квадрат вдавленный.png + пиксельная галочка / точка */
.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  line-height: 1.25;
}
.choice > input {
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.box {
  position: relative;
  flex: none;
  width: 39px;
  height: 39px;
  background: url("../assets/ui/square-inset.png") 0 0 / 100% 100% no-repeat;
}
.choice > input:checked + .box::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
}
.choice > input:checked + .box-check::after {
  background-size: 21px 21px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%231d1d1b' d='M6 0h1v1H6zM5 1h2v1H5zM0 2h1v1H0zM4 2h3v1H4zM0 3h2v1H0zM3 3h3v1H3zM0 4h5v1H0zM1 5h3v1H1zM2 6h1v1H2z'/%3E%3C/svg%3E");
}
.choice > input:checked + .box-radio::after {
  background-size: 15px 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 5' shape-rendering='crispEdges'%3E%3Cpath fill='%231d1d1b' d='M1 0h3v1H1zM0 1h5v3H0zM1 4h3v1H1z'/%3E%3C/svg%3E");
}
.g-pay .choice { margin: 10px 0 22px; }
.consent { padding-top: 0; }
.consent .choice { align-items: flex-start; }
.consent .choice a { text-decoration: underline; text-underline-offset: 4px; }

.g-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 14px;
}
.total-sum { font-size: 48px; line-height: 1; }
.total-note { line-height: 1; }

.co-submit {
  position: relative;
  align-self: center;
  width: 232px;
  height: 93px;
  font-size: var(--font-size-checkout);
}
.co-submit > .t {
  top: calc(40px - 14px - 0.3465em);
  line-height: 28px;
  white-space: normal;
}

/* =========================================================
   REVISION 02
   ========================================================= */

/* ---------- раздел ОФЕРТА: два документа ----------
   Переключатели — оригинальные кнопки (кнопка купить / вжатая), нарезанные на 9 частей:
   открытый документ — «вжатая» кнопка. */
.doc-tabs {
  left: 721px;
  top: 498px;
  display: flex;
  gap: 10px;
}
.doc-tab {
  display: block;
  height: 46px;
  padding: 0 24px;
  line-height: 34px;
  font-size: var(--font-size-checkout);
  border-style: solid;
  border-width: 6px;
  border-image: url("../assets/ui/btn.png") 6 fill / 6px stretch;
}
.doc-tab[aria-current="page"],
.doc-tab:active { border-image-source: url("../assets/ui/btn-pressed.png"); }
.doc-tab:focus-visible { outline: 3.2px dotted #fff; outline-offset: -12px; }

/* ---------- выбор размера (только у товаров не ONE SIZE) ---------- */
.sizes {
  left: 1201px;
  top: 800px;
  width: 382px;
}
.sizes-label {
  display: block;
  font-size: var(--font-size-product-details);
  line-height: 1;
}
.sizes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}
.size-btn {
  width: 84px;
  height: 84px;
  font-size: 32px;
  border-style: solid;
  border-width: 5px;
  border-image: url("../assets/ui/square-raised.png") 5 fill / 5px stretch;
}
.size-btn[aria-checked="true"],
.size-btn:active:not(:disabled) { border-image-source: url("../assets/ui/square-inset.png"); }
.size-btn:disabled { opacity: 0.4; text-decoration: line-through; }
.size-btn:focus-visible { outline: 3.2px dotted #fff; outline-offset: -14px; }
.size-hint {
  display: inline-block;
  margin: 18px 0 0;
  padding: 4px 10px;
  font-size: var(--font-size-checkout);
  line-height: 1;
  background: #0004ff;
}

/* ---------- доставка СДЭК ---------- */
.dlv-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 4px 0 28px;
}
.dlv-head .choice { font-size: 32px; }
.dlv-estimate { font-size: var(--font-size-checkout); }

.pvz-picked {
  height: auto;
  min-height: 64px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
}
.pvz-addr { font-size: 32px; }
.pvz-meta { font-size: var(--font-size-checkout); }
.pvz-empty { font-size: 32px; color: rgba(255, 255, 255, 0.5); }

/* карта во вдавленной рамке; сама карта — в настоящих пикселях экрана (app.js, sizeMap) */
.map-frame {
  position: relative;
  height: 520px;
  border-style: solid;
  border-width: 6px 5px;
  border-image: url("../assets/ui/details-frame.png") 5 4 / 6px 5px stretch;
  background: #8f8f8f;
}
.map-inner {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.dlv-note {
  margin: 14px 0 0;
  font-size: var(--font-size-checkout);
  line-height: 1.3;
}
.dlv-note:empty { display: none; }

/* Leaflet в стилистике сайта (через #pvz-map: leaflet.css подгружается позже и иначе перебил бы эти правила) */
#pvz-map.leaflet-container { background: #8f8f8f; font: 14px/1.3 Arial, sans-serif; }
#pvz-map.leaflet-container,
#pvz-map .leaflet-interactive,
#pvz-map .leaflet-grab,
#pvz-map.leaflet-dragging .leaflet-grab,
#pvz-map a { cursor: url("../assets/ui/cursor.png"), auto !important; }
/* подсказка у точки — как всплывающая подсказка старой Windows */
#pvz-map .leaflet-popup-content-wrapper {
  border-radius: 0;
  border: 1px solid #000;
  background: #ffffe1;
  color: #000;
  box-shadow: none;
}
#pvz-map .leaflet-popup-tip { background: #ffffe1; box-shadow: none; border: 1px solid #000; }
#pvz-map .leaflet-popup-content { margin: 8px 10px; font-size: 14px; line-height: 1.35; }
#pvz-map .leaflet-bar { border: 0 !important; box-shadow: none !important; }
#pvz-map .leaflet-bar a,
#pvz-map .leaflet-bar a:hover {
  width: 32px;
  height: 32px;
  line-height: 24px;
  color: #fff;
  background: #8f8f8f;
  border-style: solid !important;
  border-width: 3px !important;
  border-image: url("../assets/ui/square-raised.png") 4 / 3px stretch;
  border-radius: 0 !important;
}
#pvz-map .leaflet-bar a:active { border-image-source: url("../assets/ui/square-inset.png"); }
#pvz-map .leaflet-bar a + a { margin-top: 4px; }
#pvz-map .leaflet-control-attribution { font-size: 11px; }

.catalog-tabs { display: contents; }
.catalog-tabs > a, .cart-label { display: none; }
