/* Сайт мастерской Eclipse Laboratory. Тот же тёмный графит, что у карточек
   товара (cards/), — фото с конвейера лежат на сайте без шва: фон карточки
   и фон страницы одного тона. Акцент — медь, цвет клейма. */

:root {
  --bg: #171514;
  --bg-2: #1e1b19;
  --panel: #23201e;
  --panel-2: #2b2724;
  --line: rgba(255, 255, 255, .08);
  --text: #ece6df;
  --dim: #a59b90;
  --accent: #c88c56;
  --accent-2: #e0a774;
  --ink: #1a1512;
  --good: #8fbf7a;
  --bad: #e07a6a;
  --radius: 14px;
  --wrap: 1180px;
  --tap: 44px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent-2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; margin: 0 0 14px; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }
.dim { color: var(--dim); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(23, 21, 20, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 15px; letter-spacing: .14em; font-weight: 700; }
.grow { flex: 1; }
.nav a {
  color: var(--dim); text-decoration: none; padding: 8px 10px; border-radius: 8px;
  font-size: 15px; display: inline-flex; align-items: center; min-height: var(--tap);
}
.nav a:hover, .nav a.on { color: var(--text); background: var(--panel); }
.cart-link { position: relative; }
.cart-link .count {
  margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

@media (max-width: 760px) {
  .brand b { display: none; }
  .nav .wide { display: none; }
}

/* ---------- кнопки и поля ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: rgba(255, 255, 255, .2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.big { min-height: 52px; padding: 0 28px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.slim { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.danger { color: var(--bad); }

label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--dim); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: var(--tap);
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; flex: none; }

/* ---------- первый экран ---------- */

.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line);
  background: radial-gradient(900px 420px at 80% 0%, rgba(200, 140, 86, .12), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 40px; align-items: center; }
.hero .lead { font-size: 19px; color: var(--dim); max-width: 56ch; }
.hero .mark { width: min(320px, 70%); justify-self: center; opacity: .95; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
@media (max-width: 760px) {
  .hero { padding: 40px 0 36px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .mark { width: 140px; grid-row: 1; justify-self: start; }
}

/* ---------- разделы ---------- */

.band { padding: 56px 0; border-bottom: 1px solid var(--line); }
.band.alt { background: var(--bg-2); }
.band-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.band-head h2 { margin: 0; }
.band-head a { margin-left: auto; }
.band .lead { color: var(--dim); max-width: 64ch; margin-bottom: 26px; font-size: 17px; }

/* Сообщения об оплате на странице заказа */
.msg { padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.msg.good { border-color: rgba(143, 191, 122, .45); color: var(--good); }
.msg.bad { border-color: rgba(224, 122, 106, .45); color: var(--bad); }

/* ---------- каталог: категории слева ---------- */

.shop.with-kinds { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.kinds { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.kinds a { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.kinds a b { font-weight: 500; font-size: 13px; color: var(--dim); }
.kinds a:hover { background: var(--panel-2); }
.kinds a.on { background: rgba(200, 140, 86, .16); color: var(--accent-2); }
.kinds a.on b { color: var(--accent-2); }
@media (pointer: coarse) { .kinds a { min-height: var(--tap); } }
/* На узком экране панель — ряд кнопок над товарами, листается вбок:
   колонка слева съела бы половину ширины у карточек. */
@media (max-width: 760px) {
  .shop.with-kinds { grid-template-columns: 1fr; gap: 16px; }
  .kinds { position: static; flex-direction: row; overflow-x: auto; padding: 0; gap: 8px;
    background: none; border: 0; border-radius: 0; scrollbar-width: none; }
  .kinds::-webkit-scrollbar { display: none; }
  .kinds a { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; }
  .kinds a.on { border-color: rgba(200, 140, 86, .5); }
}

/* ---------- сетка товаров ---------- */

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: rgba(200, 140, 86, .45); }
.card .pic { aspect-ratio: 1; background: var(--bg-2); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .pic .none { width: 100%; height: 100%; display: grid; place-items: center; color: var(--dim); font-size: 14px; }
.card .body { padding: 14px 16px 16px; }
.card .title { font-weight: 600; margin-bottom: 4px; }
.card .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card .price { font-weight: 700; color: var(--accent-2); }
.tag { font-size: 13px; color: var(--dim); }
.tag.out { color: var(--bad); }
.empty { padding: 40px; text-align: center; color: var(--dim); background: var(--panel);
  border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- страница товара ---------- */

.item { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; padding: 40px 0 56px; }
.gallery .main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs button { width: 72px; height: 72px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: var(--bg-2); cursor: pointer; }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.item .price { font-size: 30px; font-weight: 700; color: var(--accent-2); margin: 6px 0 4px; }
.item .descr { white-space: pre-line; color: var(--text); margin-top: 22px; }
.crumbs { font-size: 14px; color: var(--dim); padding-top: 22px; }
.crumbs a { color: var(--dim); }
@media (max-width: 760px) { .item { grid-template-columns: 1fr; gap: 22px; padding-top: 20px; } }

/* ---------- корзина и заказ ---------- */

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.cart-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px; align-items: start; padding: 32px 0 56px; }
@media (max-width: 860px) { .cart-grid { grid-template-columns: 1fr; } }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: none; }
.line img, .line .ph { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--bg-2); }
.line .qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.line .qty button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 18px; cursor: pointer; }
.line .sum { font-weight: 700; text-align: right; }
.total { display: flex; justify-content: space-between; padding: 8px 0; }
.total.big { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.ways { display: grid; gap: 8px; margin: 6px 0 16px; }
.ways label { display: flex; gap: 10px; align-items: center; margin: 0; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; }
.ways label input { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
.ways label .p { margin-left: auto; color: var(--dim); }
.warn { color: var(--bad); }
.note { font-size: 14px; color: var(--dim); }

/* ---------- блок про СУЧОК ---------- */

.suchok { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
@media (max-width: 760px) { .suchok { grid-template-columns: 1fr; } }

/* ---------- юридические страницы ---------- */

.doc { max-width: 820px; padding: 40px 0 64px; }
.doc h2 { font-size: 22px; margin-top: 30px; }
.doc li { margin-bottom: 6px; }
.stub { color: var(--bad); font-weight: 600; }

/* ---------- подвал ---------- */

.foot { padding: 36px 0 48px; color: var(--dim); font-size: 14px; }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--dim); }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: 1fr; } }

/* ---------- уведомление ---------- */

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); padding: 12px 18px;
  border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
  max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.bad { border-color: var(--bad); }

/* ---------- главная: визитка мастерской ---------- */

.kicker { color: var(--accent-2); letter-spacing: .14em; text-transform: uppercase;
  font-size: 13px; font-weight: 700; margin-bottom: 14px; }

/* Три направления — крупные карточки с картинкой: это главная навигация
   страницы, а не список ссылок. */
.ways3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .ways3 { grid-template-columns: 1fr; } }
.way { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none;
  transition: transform .15s, border-color .15s; }
.way:hover { transform: translateY(-3px); border-color: rgba(200, 140, 86, .5); }
.way-pic { aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; display: grid; place-items: center; }
.way-pic img { width: 100%; height: 100%; object-fit: cover; }
.way-pic img.mk { width: 40%; height: auto; object-fit: contain; opacity: .8; }
.way-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.way-body h2 { font-size: 24px; margin-bottom: 8px; }
.way-body p { color: var(--dim); flex: 1; }
.way .go { color: var(--accent-2); font-weight: 600; }
/* В три колонки карточки делят общие строки сетки (subgrid): заголовок
   в две строки у одной не сдвигает её описание ниже соседних. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 901px) {
    .way { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
    .way-body { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
  }
}
@media (max-width: 900px) {
  .way { flex-direction: row; }
  .way-pic { width: 38%; aspect-ratio: auto; flex: none; }
}
@media (max-width: 520px) {
  .way { flex-direction: column; }
  .way-pic { width: 100%; aspect-ratio: 16 / 9; }
}

.steps4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--accent);
  border-radius: var(--radius); padding: 18px 20px; }
.step b { display: block; margin-bottom: 6px; font-size: 17px; }
.step p { color: var(--dim); margin: 0; }

/* ---------- мои заказы ---------- */

.my-order { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; justify-items: start; }
.my-order:last-child { border-bottom: none; }
.my-order .row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; width: 100%; }
.my-order .row a { font-weight: 700; font-size: 17px; }
.my-order .sum { margin-left: auto; }
.st { padding: 2px 10px; border-radius: 20px; background: var(--panel-2); font-size: 13px; }
.st.new { background: rgba(200, 140, 86, .25); color: var(--accent-2); }
.st.paid, .st.sent { background: rgba(143, 191, 122, .2); color: var(--good); }
.st.cancelled { color: var(--dim); text-decoration: line-through; }

/* Шапка на телефоне — в одну строку: короткие подписи, меньше отступы. */
.nav { display: flex; flex-wrap: nowrap; }
.nav .short { display: none; }
@media (max-width: 520px) {
  .nav a { padding: 8px 7px; font-size: 14px; }
  .nav .full { display: none; }
  .nav .short { display: inline; }
}

/* Своя обложка направления (web/cover-*.jpg): на фото мастерской главное
   обычно руки и изделие, а они ниже центра кадра. Центральная обрезка
   на узкой карточке телефона оставляла лицо и срезала работу. */
.way-pic img.own { object-position: 50% 62%; }

/* Картинка направления — ровно по рамке карточки. Без абсолютного
   позиционирования процентная высота внутри блока с aspect-ratio не
   считалась: картинка выходила квадратной и обрезалась рамкой сверху,
   так что object-fit и сдвиг кадра (img.own) просто не работали. */
.way-pic { position: relative; }
.way-pic img:not(.mk) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- первый экран главной: текст на картинке ---------- */

/* Картинка — рамка первого экрана, текст лежит на её нижней части (на
   уровне стола). Затемнение снизу вверх: под текстом почти глухое, к лицам
   сходит на нет. Цвета текста здесь фиксированные — фон под ними всегда
   тёмный, от темы сайта не зависит. */
.hero.hero-photo { padding: 24px 0 8px; background: none; border-bottom: none; }
.hero-photo .wrap { display: block; }
.hero-frame { position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-frame .hero-pic { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover;
  object-position: 50% 40%; }
.hero-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(17, 15, 14, .95) 0%, rgba(17, 15, 14, .82) 26%,
    rgba(17, 15, 14, .35) 48%, rgba(17, 15, 14, 0) 64%); }
.hero-frame .hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 0 32px 26px; }
.hero-frame h1 { font-size: clamp(26px, 3.6vw, 42px); margin-bottom: 6px; color: #f3ede6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.hero-frame .kicker { margin-bottom: 6px; }
.hero-frame .lead { font-size: 17px; margin: 0; color: #cfc5ba; max-width: 60ch; }

/* Телефон: картинка узкая, текст поверх закрыл бы людей — он уходит под
   неё, а затемнение превращается в плавный переход картинки в фон. */
@media (max-width: 760px) {
  .hero-frame { border: none; box-shadow: none; overflow: visible; background: none; }
  .hero-frame .hero-pic { aspect-ratio: 16 / 10; border-radius: var(--radius) var(--radius) 0 0; }
  .hero-frame::after { bottom: auto; height: calc(100vw * 10 / 16);
    background: linear-gradient(to top, var(--bg) 0%, rgba(23, 21, 20, 0) 40%); }
  .hero-frame .hero-text { position: relative; padding: 0 2px; margin-top: -34px; }
}

.band.band-tight { padding-top: 32px; }

/* Подвал прижат к низу экрана: на коротких страницах (корзина, «Мои заказы»,
   404) он иначе висел сразу под содержимым, а ниже оставалась пустота. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* width: 100% обязателен: в колонке flex элемент с margin: auto (как .wrap
   у админки) сжимается до ширины содержимого — пустой список товаров
   превращал всю админку в узкую полоску посередине. */
body > main { flex: 1 0 auto; width: 100%; }
.foot { flex-shrink: 0; }
