:root {
  --bg: #f4f2ee;
  --ink: #16130f;
  --muted: #7a7469;
  --faint: #a49e93;
  --surface: #f6f4f0;
  --surface-2: #efece6;
  --line: #e7e3dc;
  --hair: #efece6;
  --accent: #16130f;
  --hl: #e8590c;
  --gold: #b08d4f;
  --ok: #2f7d4f;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(22,19,15,.03), 0 18px 44px -26px rgba(22,19,15,.22);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; }
h1 { line-height: 1.12; letter-spacing: -0.025em; font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 6px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--hl); margin-bottom: 8px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 15px; max-width: 68ch; }
.mono { font-variant-numeric: tabular-nums; }

/* шапка */
.hd {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250,249,246,.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 24px;
}
.hd .brand { font-weight: 800; letter-spacing: .02em; font-size: 15px; white-space: nowrap; }
.brand { line-height: 1.1; }
.brand-sub { display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .46em; text-transform: uppercase; color: #e8590c; margin-top: 2px; }
.hd .brand b { color: var(--hl); margin: 0 4px; font-weight: 600; }
.hd .crumb { color: var(--muted); font-size: 14px; white-space: nowrap; }
.hd .sp { flex: 1; }
.hd .who { font-size: 13px; color: var(--muted); max-width: 26vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd .lnk {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  transition: border-color .15s ease; white-space: nowrap;
}
.hd .lnk:hover { border-color: var(--ink); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 34px 24px 150px; }
.center { min-height: 55vh; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-main { background: var(--accent); color: #fff; }
.btn-main:hover { background: #2c2823; }
.btn-main:disabled { opacity: .45; cursor: default; }
.btn-ghost { border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* gate */
.gate { max-width: 560px; margin: 8vh auto 0; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 48px 40px; }
.gate-ic { font-size: 40px; margin-bottom: 14px; }
.gate h1 { font-size: 26px; }
.gate p { color: var(--muted); margin: 10px 0 26px; font-size: 15px; }
.gate .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* условия оптового заказа */
.optterms {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 22px;
}
.ot {
  display: flex; gap: 11px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow);
}
.ot-ic { font-size: 19px; line-height: 1.2; flex-shrink: 0; }
.ot b { display: block; font-size: 13px; margin-bottom: 3px; }
.ot p { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 0; }
.ot b + p b, .ot p b { color: var(--ink); font-size: 14px; }
@media (max-width: 900px) { .optterms { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .optterms { grid-template-columns: 1fr; } }

.minwarn { background: #fdf3e6; border: 1px solid #f2d9b0; color: #8a5a12; border-radius: var(--r-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 4px; }
.minok { color: var(--ok); font-size: 13px; font-weight: 600; padding: 2px 2px 6px; }

/* скачать прайс-лист */
.dlbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 20px; }
.btn-dl { padding: 11px 20px; font-size: 14.5px; }
.btn-terms { padding: 11px 18px; font-size: 14.5px; }
.btn-terms i { font-style: normal; margin-left: 7px; color: var(--muted); transition: transform .18s ease; display: inline-block; }
.btn-terms.on i { transform: rotate(180deg); }
.dl-hint { font-size: 13px; color: var(--muted); }

/* панель менеджера */
.mgrbar { display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; flex-wrap: wrap; }
.mgrbar .btn { padding: 9px 16px; font-size: 14px; }
.mgr-hint { font-size: 13px; color: var(--muted); }

/* партнёрская плашка над прайсом (видят только партнёры) */
#pbarHost:empty { display: none; }
.pbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1.5px solid #e8dcf7; background: linear-gradient(180deg, #fdfbff, #fff);
  border-radius: 14px; padding: 12px 16px; margin: 0 0 18px;
}
.pbar-t { font-weight: 700; font-size: 14px; white-space: nowrap; }
.pbar-link {
  flex: 1; min-width: 180px; font: inherit; font-size: 13px; color: var(--muted);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff;
}
.pbar .btn { padding: 9px 16px; font-size: 13.5px; }
.pbar-stat { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pbar-stat b { color: var(--ink); }
.pbar-more { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pbar-more:hover { color: #6a3ab8; }
.cart-fee { font-size: 13px; color: #6a3ab8; margin: 10px 0 0; }

/* ---------- панель фильтров ---------- */
.toolbar { padding: 12px 0 14px; margin-bottom: 6px; }
.search {
  width: 100%; padding: 13px 20px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 14.5px; font-family: inherit; background: #fff; margin-bottom: 14px; transition: border-color .15s ease;
}
.search:focus { outline: none; border-color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 600; background: #fff; color: var(--muted); transition: all .15s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chipsep { width: 1px; height: 22px; background: var(--line); margin: 4px 6px; }

/* кружки семейств */
.fams {
  display: flex; gap: 4px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.fams::-webkit-scrollbar { height: 6px; }
.fams::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.fam {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 76px; padding: 4px 2px; border-radius: var(--r-md); transition: transform .12s ease;
}
.fam:hover { transform: translateY(-2px); }
.fam-ph {
  width: 58px; height: 58px; border-radius: 999px; overflow: hidden;
  background: #fff; border: 2px solid var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; transition: border-color .15s ease;
}
.fam-ph img { max-width: 82%; max-height: 82%; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.fam:hover .fam-ph { border-color: var(--faint); }
.fam.on .fam-ph { border-color: var(--hl); box-shadow: 0 0 0 3px rgba(232,89,12,.16); }
.fam-l {
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em; color: var(--muted);
  max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.fam.on .fam-l { color: var(--hl); }

/* ---------- таблица прайса ---------- */
.ptable {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.grid-cols {
  display: grid;
  grid-template-columns: 64px minmax(200px, 1.6fr) 110px 88px 100px 66px 124px 96px 96px;
  gap: 14px; align-items: center;
}
.thead {
  display: grid;
  grid-template-columns: 64px minmax(200px, 1.6fr) 110px 88px 100px 66px 124px 96px 96px;
  gap: 14px; align-items: center;
  padding: 13px 22px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.thead span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.thead .c-ean, .thead .c-rrc, .thead .c-opt, .thead .c-sum { text-align: right; }
.thead .c-mrg, .thead .c-qty, .thead .c-stock { text-align: center; }

.secrow {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 22px 8px; background: #fff;
}
.secrow span { font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.secrow i { font-style: normal; font-size: 12px; color: var(--faint); }
.secrow::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

.prow {
  display: grid;
  grid-template-columns: 64px minmax(200px, 1.6fr) 110px 88px 100px 66px 124px 96px 96px;
  gap: 14px; align-items: center;
  padding: 11px 22px; border-top: 1px solid var(--hair);
  transition: background .12s ease;
}
.prow:hover { background: #fbfaf8; }
.prow.inorder { background: #fdf6f0; }
.prow.inorder:hover { background: #fcf1e8; }

.c-img img { width: 52px; height: 52px; object-fit: contain; padding: 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; }
.c-img .noimg { display: block; width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--surface-2); }

.c-model { min-width: 0; cursor: pointer; }
.c-model b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.c-model .msub { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-model .mart { display: block; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: .01em; margin-top: 1px; }
.c-model .tgl { font-style: normal; color: var(--hl); font-weight: 600; margin-left: 6px; opacity: 0; transition: opacity .12s ease; }
.prow:hover .tgl, .prow.open .tgl { opacity: 1; }
.newtag { font-style: normal; background: var(--hl); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; vertical-align: 2px; }
.feat { font-style: normal; color: var(--gold); font-weight: 600; }
.star { font-size: 15px; color: #cfc9c0; padding: 0 3px; line-height: 1; vertical-align: 1px; transition: color .12s ease, transform .12s ease; }
.star:hover { color: var(--hl); transform: scale(1.15); }
.star.on { color: var(--hl); }
.star:disabled { opacity: .5; }
.favo { border: 0; background: none; cursor: pointer; color: #d3ccc2; font-size: 15px; line-height: 1; vertical-align: 1px; padding: 0 4px; transition: color .12s ease, transform .12s ease; }
.favo:hover { color: var(--hl); transform: scale(1.18); }
.favo.on { color: var(--hl); }
.chip-fav.on { background: var(--hl); border-color: var(--hl); color: #fff; }

.c-ean { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-rrc { text-align: right; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-opt { text-align: right; font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-mrg { text-align: center; }
.c-mrg i { font-style: normal; background: #e4f3ec; color: #157355; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.c-sum { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* наличие на складе: бейдж как на витрине /nalichie, шкала одна на оба места */
.c-stock { text-align: center; }
.st {
  display: inline-block; font-size: 12px; font-weight: 700; white-space: nowrap;
  padding: 4px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.st.lv-ok { background: #e4f4e4; color: #237a36; }
.st.lv-mid { background: #e2f3ec; color: #157355; }
.st.lv-low { background: #fdf3d7; color: #8f6400; }
.st.lv-last { background: #fdeadb; color: #b45012; }
.st.st-out { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.st-wait { color: var(--faint); font-size: 12px; }

/* степпер */
.qty { display: flex; align-items: center; gap: 5px; justify-content: center; }
.qty button {
  width: 36px; height: 34px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff;
  font-size: 18px; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: all .12s ease;
}
.qty button:hover { border-color: var(--ink); }
.qty button:active { transform: scale(.9); }
.qty input {
  width: 48px; text-align: center; font: inherit; font-weight: 600; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 6px 2px; background: #fff; font-variant-numeric: tabular-nums;
}
.qty input:focus { outline: none; border-color: var(--ink); }

/* раскрытие характеристик */
.pdetail { grid-column: 1 / -1; overflow: hidden; max-height: 0; transition: max-height .28s ease; }
.prow.open .pdetail { max-height: 460px; }
.pd-in { padding: 4px 4px 14px; border-top: 1px dashed var(--line); margin-top: 8px; }
.pd-name { font-size: 13.5px; color: var(--ink); font-weight: 500; margin: 12px 0 10px; }
.fchips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.fchip { background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; font-size: 13px; }
.spec dt { color: var(--muted); font-weight: 600; }
.spec dd { color: var(--ink); }
.spec dd.full { grid-column: 1 / -1; color: var(--muted); }
.nospec { color: var(--muted); font-size: 13px; }

.empty { padding: 46px 24px; text-align: center; color: var(--muted); }

/* панель заказа */
.orderbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: rgba(250,249,246,.94); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.ob-in { max-width: 1240px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 14px; }
.ob-sum { flex: 1; min-width: 0; }
.ob-sum b { font-size: 21px; letter-spacing: -0.01em; display: block; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ob-sum span { color: var(--muted); font-size: 13px; }

/* модалка */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(22,19,15,.46); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden], .orderbar[hidden] { display: none; }
.modal-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; padding: 30px 30px 26px; position: relative; }
.modal-x { position: absolute; top: 14px; right: 16px; font-size: 16px; color: var(--muted); padding: 6px; }
.modal-x:hover { color: var(--ink); }
.modal h2 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 4px; }
.msub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.mlist { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; max-height: 210px; overflow: auto; }
.mrow { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mrow:last-child { border-bottom: 0; }
.mrow b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mrow .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtotal { display: flex; justify-content: space-between; font-size: 15px; padding: 10px 4px 16px; }
.mtotal b { font-size: 17px; font-variant-numeric: tabular-nums; }
.field { display: block; margin: 12px 0 0; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: 15px; background: #fff; font-family: inherit; transition: border-color .15s ease; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { background: #fdf0ee; color: #b3362a; border: 1px solid #f3cfc7; border-radius: var(--r-sm); padding: 10px 13px; font-size: 14px; margin: 14px 0 0; }
.modal .btn-main { width: 100%; margin-top: 20px; }
.done { text-align: center; padding: 26px 6px 10px; }
.done .ic { font-size: 44px; margin-bottom: 12px; }
.done h2 { margin-bottom: 8px; }
.done p { color: var(--muted); font-size: 14.5px; margin-bottom: 22px; }

/* ---------- планшет: прячем EAN ---------- */
@media (max-width: 1080px) {
  .thead .c-ean, .prow .c-ean { display: none; }
  .thead, .prow { grid-template-columns: 56px minmax(170px, 1.5fr) 84px 94px 58px 116px 88px 88px; }
}
/* ---------- мобильная: карточная строка ---------- */
@media (max-width: 780px) {
  .thead { display: none; }
  .prow {
    grid-template-columns: 54px 1fr auto auto;
    grid-template-areas:
      "img model model model"
      "img opt   mrg   stock"
      "img qty   qty   qty"
      "det det   det   det";
    gap: 4px 12px; padding: 14px 16px; align-items: center;
  }
  .secrow { padding: 18px 16px 6px; }
  .c-img { grid-area: img; align-self: start; }
  .c-img img, .c-img .noimg { width: 54px; height: 54px; }
  .c-model { grid-area: model; }
  .c-ean, .c-rrc, .c-sum { display: none; }
  .c-opt { grid-area: opt; text-align: left; align-self: center; }
  .c-mrg { grid-area: mrg; justify-self: start; align-self: center; }
  .c-qty { grid-area: qty; align-self: center; justify-self: start; }
  .c-stock { grid-area: stock; justify-self: end; align-self: center; }
  .pdetail { grid-area: det; }
  .spec { grid-template-columns: 1fr; gap: 2px 0; }
  .spec dt { margin-top: 6px; }
}
@media (max-width: 620px) {
  .hd { padding: 0 16px; gap: 10px; }
  .hd .who, .hd .crumb { display: none; }
  .wrap { padding: 22px 12px 150px; }
  .ob-in { padding: 12px 14px; flex-wrap: wrap; }
  .ob-in .btn { flex: 1; }
  .field2 { grid-template-columns: 1fr; gap: 0; }
}

/* значок Ozon у позиции прайса */
.ozon-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 11.5px; font-weight: 700; color: #005bff; text-decoration: none; }
.ozon-badge:hover .ozon-ic { transform: scale(1.12); }
/* ссылка на страницу товара: нейтральная, чтобы не спорить с синим бейджем Ozon рядом */
.land-badge { margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.land-badge:hover { color: var(--hl); }
/* та же ссылка в раскрытых характеристиках — там она главное действие блока */
.pd-land { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--hl); text-decoration: none; }
.pd-land:hover { text-decoration: underline; }

/* фирменный знак Ozon (img/ozon.png) — без своей подложки, круг нарисован в самом файле */
.ozon-ic { width: 15px; height: 15px; flex: none; display: block; object-fit: contain; transition: transform .15s ease; }

/* реквизиты на экране входа: партнёр проверяет компанию до регистрации */
.gate-legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.gate-legal a { color: var(--muted); }
.gate-legal a:hover { color: var(--ink); }
