:root {
  --orange: #ef7f1a;
  --orange-dark: #c9650c;
  --teal: #02b39d;
  --ink: #1f2328;
  --muted: #667085;
  --line: #e6e8eb;
  --bg: #f6f7f8;
  --card: #fff;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
h1, h2 { line-height: 1.2; }
a { color: var(--teal); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* шапка */
.top { background: #fff; border-bottom: 3px solid var(--orange); position: sticky; top: 0; z-index: 5; }
.top__row { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand img { height: 34px; display: block; }
.search { flex: 1; }
.search input {
  width: 100%; height: 40px; padding: 0 14px; font: inherit;
  border: 1px solid var(--line); border-radius: 20px; background: var(--bg); outline: none;
}
.search input:focus { border-color: var(--teal); background: #fff; }
.top__phone { white-space: nowrap; font-weight: 600; color: var(--ink); text-decoration: none; }

.hero { background: linear-gradient(90deg, var(--orange), #f39a45); color: #fff; padding: 22px 0; }
.hero h1 { margin: 0 0 4px; font-size: 26px; }
.hero p { margin: 0; max-width: 760px; opacity: .95; }

/* разделы + сетка */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding-top: 20px; padding-bottom: 32px; }
.sections h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 8px; }
.sections ul { list-style: none; margin: 0; padding: 0; }
.sections li button {
  width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--ink);
  padding: 6px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px;
}
.sections li button:hover { background: #fff; }
.sections li button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.sections li button .n { color: inherit; opacity: .6; font-size: 13px; }
.sections li.sub button { padding-left: 22px; font-size: 14px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); }
.toolbar select { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.toolbar__right { display: flex; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; font: inherit; padding: 4px 12px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--teal); color: #fff; }

/* прайс-лист */
.pricelist { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pl { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl th, .pl td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pl thead th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: 13px; }
.pl tbody tr:hover td { background: #fffaf5; }
.pl__sec th { background: #fff6ee; color: var(--orange-dark); font-size: 13px; font-weight: 700; }
.pl__code { white-space: nowrap; color: var(--muted); font-size: 13px; }
.pl__art { display: block; color: var(--muted); font-size: 12px; }
.pl__price { text-align: right !important; white-space: nowrap; font-weight: 700; }
.pl__btn { width: 1%; white-space: nowrap; }
.pl .open {
  font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--orange); background: #fff; color: var(--orange-dark);
}
.pl .open:hover { background: var(--orange); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.item {
  min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s, transform .15s;
  text-align: left; padding: 0; font: inherit; color: inherit;
}
.item:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-1px); }
.item__img { aspect-ratio: 4 / 3; min-width: 0; overflow: hidden; background: #fff; display: flex; align-items: center; justify-content: center; }
.item__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.item__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item__name { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item__meta { font-size: 12px; color: var(--muted); }
.item__price { margin-top: auto; font-size: 18px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.howto { background: #fff; border-top: 1px solid var(--line); padding: 18px 0; }
.howto h2 { margin: 0 0 6px; font-size: 20px; }
.howto p { margin: 0; max-width: 760px; }

.foot { background: #262a30; color: #e7e9ec; padding: 24px 0 32px; }
.foot h2 { margin: 0 0 4px; font-size: 20px; }
.foot .muted { color: #a9afb8; }
.stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.store { border-left: 3px solid var(--orange); padding-left: 12px; }
.store b { display: block; font-size: 16px; }
.store a { color: #7fe3d5; }

/* карточка товара */
.card { border: 0; border-radius: 14px; padding: 0; width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.card::backdrop { background: rgba(15, 18, 22, .55); }
.card__close { position: absolute; right: 10px; top: 6px; border: 0; background: none; font-size: 32px; cursor: pointer; color: var(--muted); z-index: 1; }
.card__body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; padding: 24px; }
.gallery img#cImg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; }
.thumbs img.on { border-color: var(--orange); }
.crumbs { margin: 0; color: var(--muted); font-size: 13px; }
.card__info h2 { margin: 4px 0 8px; font-size: 20px; padding-right: 24px; }
.price { font-size: 26px; font-weight: 700; margin: 0 0 12px; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 14px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.desc { white-space: pre-line; font-size: 14px; max-height: 260px; overflow: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.order { margin-top: 14px; background: #fff6ee; border: 1px solid #f7d2ae; border-radius: 8px; padding: 12px; font-size: 14px; }
.order b { font-size: 17px; }
.order a.call {
  display: inline-block; margin-top: 8px; background: var(--orange); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: 6px; font-weight: 600;
}
.order a.call:hover { background: var(--orange-dark); }

@media (max-width: 760px) {
  .top__row { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .brand img { height: 28px; }
  .search { order: 3; flex-basis: 100%; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sections ul { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .sections li.sub { display: none; }
  .sections li.sub.show { display: block; }
  .sections li.sub button { padding-left: 10px; background: #f0fbf9; }
  .sections li button { white-space: nowrap; background: #fff; border: 1px solid var(--line); }
  .sections h2 { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .pl th, .pl td { padding: 6px 8px; }
  .pl__code { display: none; }
  .pl__name { font-size: 13px; }
  .card__body { grid-template-columns: 1fr; padding: 16px; }
  .desc { max-height: none; overflow: visible; }   /* на телефоне прокручивается всё окно, без вложенной прокрутки */
  .hero h1 { font-size: 22px; }
}
