:root {
  --bg: #fff;
  --fg: #111;
  --muted: #767676;
  --line: #e5e5e3;
  --card: #f4f4f2;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
/* !important, иначе более поздние display: grid / flex / block перебивают скрытие */
.hidden { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; }

button { background: var(--fg); color: #fff; border: 1px solid var(--fg); padding: 10px 16px; cursor: pointer; font: inherit; touch-action: manipulation; }
button:hover { opacity: .85; }
button:disabled { background: #e8e8e6; border-color: #e8e8e6; color: var(--muted); cursor: not-allowed; opacity: 1; }
button.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
input, textarea { font: inherit; padding: 10px; border: 1px solid #ccc; background: #fff; color: var(--fg); width: 100%; border-radius: 0; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }

/* ---------- Шапка ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; letter-spacing: 4px; color: var(--fg); text-decoration: none; }
.link-quiet { color: var(--muted); font-size: 14px; text-decoration: none; }
.link-quiet:hover { color: var(--fg); }

/* ---------- Приветствие со шторами ---------- */
#intro { height: 240vh; position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transform: scale(calc(.9 + var(--p, 0) * .1)); }
.reveal h2 { font-size: clamp(40px, 10vw, 140px); margin: 0; letter-spacing: 4px; text-transform: uppercase; }

.curtain { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; z-index: 5; will-change: transform;
  background: repeating-linear-gradient(90deg, #f3f2ef 0 46px, #ebe9e5 46px 50px); }
.curtain.left  { left: 0;  transform: translateX(calc(var(--p, 0) * -100%)); box-shadow: 8px 0 30px rgba(0,0,0,.12); }
.curtain.right { right: 0; transform: translateX(calc(var(--p, 0) * 100%));  box-shadow: -8px 0 30px rgba(0,0,0,.12); }

/* Текст приветствия лежит на обеих шторах и стыкуется посередине: каждая штора показывает свою половину */
.curtain .inner { position: absolute; top: 0; bottom: 0; width: 200%; display: flex; align-items: center; justify-content: center; }
.curtain.left  .inner { left: 0; }
.curtain.right .inner { right: 0; }

.hello { text-align: center; padding: 0 16px; }
.hello h1 { font-size: clamp(56px, 20vw, 280px); line-height: .9; margin: 0; letter-spacing: clamp(2px, 1vw, 14px); font-weight: 800; }
.eyebrow { text-transform: uppercase; letter-spacing: 6px; font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.sub { color: var(--muted); margin: 20px 0 0; }
.arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- Каталог ---------- */
main { padding: 40px 24px 80px; max-width: 1280px; margin: 0 auto; }
.section-title { font-size: 14px; letter-spacing: 6px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

/* Карточка товара */
.card { padding: 12px; border: 1px solid transparent; background: #fff; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card .img { aspect-ratio: 4 / 5; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .25s ease; }
.card h3 { margin: 12px 0 0; font-weight: 600; }
.card .desc { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.price { margin: 8px 0 10px; font-weight: 600; }

/* Подсветка при наведении мышью. Только для устройств с мышью, чтобы на телефоне карточка не "залипала". */
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: 0 16px 36px rgba(0, 0, 0, .10); }
  .card:hover .img img { transform: scale(1.05); }
}
.card:focus-within { border-color: var(--fg); }
@media (hover: none) { .card:active { background: #f8f8f6; } }

/* Переключатель цвета */
.swatches { display: flex; gap: 12px; margin: 4px 0 2px; flex-wrap: wrap; }
.swatch { position: relative; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid #c9c9c9; background: var(--sw, #111); }
.swatch::after { content: ""; position: absolute; inset: -8px; }          /* увеличенная область нажатия для пальца */
.swatch:hover { opacity: 1; }
.swatch.active { outline: 2px solid var(--fg); outline-offset: 3px; }
.swatch.soldout { opacity: .35; }
.color-name { font-size: 13px; color: var(--muted); min-height: 1.3em; margin-bottom: 8px; }

.sizes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.size { background: transparent; color: var(--fg); border: 1px solid #bbb; padding: 8px 12px; min-width: 44px; min-height: 44px; }
.size.active { background: var(--fg); color: #fff; border-color: var(--fg); }
.size:disabled { opacity: .4; text-decoration: line-through; background: transparent; }
.add { width: 100%; min-height: 46px; }
footer { text-align: center; padding: 40px; color: var(--muted); letter-spacing: 6px; font-size: 12px; border-top: 1px solid var(--line); }

/* ---------- Корзина ---------- */
#cartPanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; z-index: 40; box-shadow: -10px 0 40px rgba(0,0,0,.08); }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.line { display: flex; justify-content: space-between; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line .qty { text-align: right; white-space: nowrap; }
.line .qty button { padding: 2px 10px; min-width: 36px; min-height: 36px; }
.note { color: var(--danger); min-height: 1.2em; font-size: 14px; }
.cart-total { margin: 16px 0 8px; font-size: 1.1rem; }
#checkoutBtn { width: 100%; min-height: 48px; }

/* ---------- Оформление заказа ---------- */
.narrow { max-width: 560px; margin: 0 auto; padding: 90px 20px 60px; }
.steps { display: flex; gap: 16px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 12px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.steps li.on { color: var(--fg); font-weight: 700; }
.page-title { font-size: 22px; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 20px; }
.summary { border: 1px solid var(--line); padding: 16px; margin-bottom: 24px; font-size: 14px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 700; font-size: 16px; }
.summary .problem { color: var(--danger); font-size: 13px; }
.stack { display: grid; gap: 18px; }
.stack label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field-error { color: var(--danger); font-size: 13px; min-height: 1em; }
input.invalid, textarea.invalid { border-color: var(--danger); }
/* Мелкая неяркая приписка под полем. Серый #767676 на белом читается и не бросается в глаза. */
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.btn { display: inline-block; background: var(--fg); color: #fff; padding: 12px 20px; text-decoration: none; }
.recap { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.recap b { color: var(--fg); font-weight: 600; }
.done { text-align: center; padding-top: 14vh; }
.done h1 { font-size: 26px; margin: 0 0 12px; }
.stack button[type="submit"] { min-height: 50px; }

/* ---------- Если у человека отключены анимации: без штор ---------- */
@media (prefers-reduced-motion: reduce) {
  #intro { height: auto; }
  .stage { position: static; height: 60vh; }
  .curtain { display: none; }
  .reveal { transform: none; }
  .arrow { animation: none; }
  .card, .card .img img { transition: none; }
  @media (hover: hover) { .card:hover { transform: none; } .card:hover .img img { transform: none; } }
}

/* ---------- Админка ---------- */
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 90px 24px 60px; }
.admin-wrap h1 { font-size: 22px; letter-spacing: 3px; text-transform: uppercase; margin: 0 0 24px; }
.login-box { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; display: grid; gap: 12px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; margin-top: 16px; min-width: 560px; }
table.list th, table.list td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }
.thumb { width: 56px; height: 70px; object-fit: cover; background: var(--card); display: block; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.form { display: grid; gap: 14px; margin-top: 16px; padding: 20px; border: 1px solid var(--line); }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.size-row { display: flex; gap: 8px; align-items: center; }
.size-row input:first-child { width: 110px; }
.size-row input:nth-child(2) { width: 110px; }
.preview { max-width: 160px; max-height: 200px; display: block; margin-top: 8px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.error { color: var(--danger); min-height: 1.2em; font-size: 14px; }
.stock-cell { color: var(--muted); font-size: 13px; }
.stock-cell div + div { margin-top: 4px; }
.status { color: #1b6e3c; min-height: 1.2em; font-size: 14px; margin: 8px 0 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.tab.active { background: var(--fg); color: #fff; border-color: var(--fg); }

/* Блок одного цвета в форме товара */
.color-block { border: 1px solid var(--line); padding: 14px; display: grid; gap: 12px; background: #fafaf8; }
.color-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.color-head .c-name { flex: 1 1 180px; width: auto; }
.color-head .c-hex { width: 48px; height: 42px; padding: 2px; flex: 0 0 auto; cursor: pointer; }
.size-list { display: grid; gap: 8px; }

/* Заказы */
.order { border: 1px solid var(--line); padding: 14px 16px; margin-top: 12px; font-size: 14px; display: grid; gap: 6px; }
.order-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; }
.badge { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.order .muted { color: var(--muted); }
.order a { color: var(--fg); }

/* ---------- Телефоны ---------- */
@media (max-width: 640px) {
  .top { padding: 0 16px; }
  main { padding: 24px 12px 60px; }
  .section-title { margin-bottom: 18px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 6px; }
  .card h3 { font-size: 15px; }
  .card .desc { display: none; }               /* на узком экране описание в карточке только мешает */
  .price { font-size: 15px; }
  .sizes { gap: 6px; }
  .size { padding: 6px 8px; min-width: 40px; min-height: 44px; }
  input, textarea { font-size: 16px; }         /* меньше 16px iPhone приближает страницу при нажатии на поле */
  #cartPanel { width: 100%; border-left: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .narrow { padding: 80px 16px 40px; }
  .admin-wrap { padding: 80px 14px 40px; }
  .form { padding: 14px; }
  .size-row input:first-child, .size-row input:nth-child(2) { width: 90px; }
}

/* ---------- Подробная карточка товара ---------- */
.no-scroll { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.modal-sheet { position: relative; background: #fff; width: min(940px, calc(100% - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto; padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; }
.modal-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-content: start; cursor: default; padding: 0; }
.modal-card .img { grid-column: 1; grid-row: 1 / span 8; }
.modal-card > :not(.img) { grid-column: 2; }
.modal-card:hover { transform: none; box-shadow: none; border-color: transparent; }
.modal-info { margin-top: 20px; border-top: 1px solid var(--line); }
.modal-info details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.modal-info summary { cursor: pointer; font-weight: 600; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.modal-info p, .modal-info li { font-size: 14px; line-height: 1.6; color: #444; }
.modal-info ul { padding-left: 18px; margin: 10px 0 0; }
table.chart { border-collapse: collapse; margin-top: 10px; font-size: 14px; width: 100%; max-width: 480px; }
table.chart th, table.chart td { border: 1px solid var(--line); padding: 8px 10px; text-align: center; }
table.chart th { background: var(--card); font-weight: 600; }
@media (max-width: 700px) {
  .modal-sheet { width: 100%; height: 100vh; height: 100dvh; max-height: none; padding: 16px; padding-top: 52px; }
  .modal-card { display: block; }
}

/* ---------- Статус заказа в админке ---------- */
.status-row select { font: inherit; padding: 8px 10px; border: 1px solid #ccc; background: #fff; margin-left: 8px; }
.order.refund { border-color: var(--danger); }

/* ---------- Меню в шапке и окно информации ---------- */
.top-nav { display: flex; gap: 22px; margin: 0 auto 0 32px; }
.top-nav a, .top-nav-mobile { color: var(--muted); font-size: 14px; text-decoration: none; }
.top-nav a:hover, .top-nav-mobile:hover { color: var(--fg); }
.top-nav-mobile { display: none; margin: 0 14px 0 auto; }

.info-sheet { position: fixed; inset: 0; z-index: 50; background: #fff; overflow-y: auto; }
.info-close { position: fixed; top: 14px; right: 18px; z-index: 2; background: #fff; }
.info-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; max-width: 1100px; margin: 0 auto; padding: 72px 24px 48px; }
.info-nav { display: grid; align-content: start; gap: 6px; position: sticky; top: 72px; }
.info-nav button { text-align: left; background: transparent; border: 0; color: var(--muted); padding: 12px 14px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.info-nav button:hover { color: var(--fg); }
.info-nav button.active { background: #f4f4f4; color: var(--fg); }
.info-body h1 { font-size: 24px; margin: 0 0 20px; }
.info-body p { color: #333; line-height: 1.6; margin: 0 0 14px; }
.info-body details { background: #f8f8f6; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.info-body summary { list-style: none; cursor: pointer; padding: 20px; display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.info-body summary::-webkit-details-marker { display: none; }
.info-body summary::after { content: "+"; font-weight: 700; font-size: 18px; line-height: 1; }
.info-body details[open] summary::after { content: "−"; }
.info-body .acc-body { padding: 0 20px 6px; }

@media (max-width: 700px) {
  .top-nav { display: none; }
  .top-nav-mobile { display: block; }
  .info-wrap { grid-template-columns: 1fr; gap: 16px; padding: 64px 16px 32px; }
  .info-nav { display: flex; overflow-x: auto; position: static; gap: 4px; padding-bottom: 4px; }
  .info-nav button { white-space: nowrap; padding: 10px 12px; }
}

/* ---------- Согласие и страница документа ---------- */
.stack .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--fg); cursor: pointer; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.consent a { color: var(--fg); }
.doc-page p { line-height: 1.6; color: #333; margin: 0 0 12px; font-size: 14px; }
