/* Парфюмотека · опт — стили. Цвета и размеры совпадают с дизайн-макетом. */
:root {
  --ground: #F7F3EF;
  --surface: #FFFFFF;
  --line: #E9E1DA;
  --line-strong: #E2D8D0;
  --ink: #231F1C;
  --ink-2: #4A433E;
  --muted: #6B625B;
  --accent: #9E4B3E;
  --accent-dark: #7A3A30;
  --accent-soft: #F4E6E1;
  --green: #1E5E38;
  --green-soft: #E6F2EA;
  --red: #B42318;
  --red-soft: #FBE9E7;
  --amber: #6B5300;
  --amber-soft: #FBF1DC;
  --blue: #23446E;
  --blue-soft: #E7EEF8;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.45 var(--sans); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }

/* Шапка */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--ink); }
.logo b { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.logo span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.chip-balance { display: flex; flex-direction: column; align-items: flex-end; padding: 5px 10px; border-radius: 10px; text-decoration: none; line-height: 1.15; }
.chip-balance small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.chip-balance b { font-size: 14px; }
.chip-balance.debt { background: var(--red-soft); color: var(--red); }
.chip-balance.credit { background: var(--green-soft); color: var(--green); }
.cart-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.cart-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

/* Нижнее меню (телефон) */
.nav { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; }
.nav a.on { color: var(--ink); font-weight: 700; }

/* Сообщения */
.flash { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }
.flash.info { background: var(--amber-soft); color: var(--amber); }

/* Кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.block { width: 100%; min-height: 52px; font-size: 16px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 16px; }
textarea.input { min-height: 72px; resize: vertical; }
label.lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }

/* Карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card + .card { margin-top: 10px; }
.section-title { font-size: 16px; font-weight: 700; margin: 18px 0 8px; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 8px; background: var(--ground); font-size: 11px; font-weight: 600; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.pill.gray { background: #EDE6DF; }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.dark { background: var(--ink); color: #fff; }

/* Поиск */
.search-box { background: var(--surface); padding: 14px 0 0; border-bottom: 1px solid var(--line); }
.search-field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 14px; border: 1.5px solid var(--ink); border-radius: 14px; background: #fff; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 16px; background: transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 14px; scrollbar-width: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps { list-style: none; margin: 16px 0 0; padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.steps b { width: 28px; height: 28px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }

.prod { display: flex; gap: 12px; }
.thumb { flex: none; width: 72px; height: 92px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.prod-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.prod-name { font-size: 16px; font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.25; }
.price { font-size: 18px; font-weight: 700; }
.group-box { border: 1px dashed #CDBFB4; }

/* Карточка аромата */
.p-head h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.05; }
.pyramid { display: grid; grid-template-columns: 56px 1fr; gap: 4px 8px; font-size: 13px; margin: 8px 0 0; }
.pyramid dt { color: var(--muted); }
.pyramid dd { margin: 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #EDE6DF; border-radius: 14px; }
.tabs a { height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.tabs a.on { background: #fff; color: var(--ink); font-weight: 700; }
.offer { display: flex; flex-direction: column; gap: 10px; }
.code { padding: 4px 8px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.qty { width: 64px; min-height: 40px; text-align: center; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 15px; }

/* Корзина и итог */
.totals { background: var(--ink); color: #fff; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.totals .muted { color: #D9CFC7; }
.totals .big { font-size: 24px; font-weight: 700; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.radio-card:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg label { display: flex; }
.seg input { position: absolute; opacity: 0; }
.seg span { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; cursor: pointer; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 10px; border: 1.5px dashed #CDBFB4; border-radius: 12px; background: #FBF9F7; text-align: center; cursor: pointer; font-size: 13px; font-weight: 700; }
.upload input { max-width: 100%; font-size: 12px; font-weight: 400; }

/* Баланс */
.balance { border-radius: 16px; padding: 14px; }
.balance.debt { background: var(--red-soft); border: 1px solid #F2C9C3; }
.balance.credit { background: var(--green-soft); border: 1px solid #C9E3D2; }
.balance.zero { background: var(--surface); border: 1px solid var(--line); }
.balance .amount { font-size: 26px; font-weight: 700; }
.balance.debt .amount { color: var(--red); }
.balance.credit .amount { color: var(--green); }
.hist { display: grid; grid-template-columns: 80px 1fr auto; gap: 6px 10px; font-size: 13px; }

/* Документы и подвал */
.footer { padding: 20px 0 30px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 16px 0; }
.doc h1 { font-family: var(--serif); font-size: 30px; margin-bottom: 12px; }
.cookie { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto; padding: 14px; background: var(--ink); color: #fff; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.cookie a { color: #F4C9BE; }
.cookie .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cookie button { min-height: 44px; border-radius: 12px; font-weight: 700; cursor: pointer; }

/* Таблицы (админка) */
.table-box { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 6px; border-bottom: 1px solid #EFE8E2; vertical-align: top; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
table.t tr.link-row:hover td { background: #FBF9F7; cursor: pointer; }
.hint { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.hint.green { background: var(--green-soft); color: var(--green); }
.hint.amber { background: var(--amber-soft); color: var(--amber); }

/* Админка */
.admin { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; background: var(--ink); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.side .logo b { color: #fff; font-size: 24px; }
.side .logo span { color: #C9BFB7; }
.side h4 { margin: 14px 8px 6px; font-size: 11px; color: #A89D94; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.side a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 10px; color: #E8E1DB; text-decoration: none; font-size: 14px; }
.side a.on { background: #3A332E; color: #fff; font-weight: 700; }
.side a .n { font-size: 12px; color: #C9BFB7; }
.side a.on .n { background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 10px; }
.main { flex: 999 1 560px; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.main h1 { font-size: 24px; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cols > .wide { flex: 999 1 520px; min-width: 0; }
.cols > .narrow { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kv span:first-child { color: var(--muted); }
.statusbar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.statusbar li { padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.statusbar li.on { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (max-width: 640px) {
  .statusbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 16px; }
}
@media (min-width: 900px) {
  .nav { display: none; }
}
