:root {
  --brand: #0b5cab;
  --brand-dark: #08457f;
  --brand-soft: #e8f1fb;
  --wa: #1fa855;
  --wa-dark: #178a45;
  --kaspi: #f14635;
  --kaspi-dark: #d63a2a;
  --text: #13202f;
  --muted: #5c6b7c;
  --line: #e2e8ef;
  --bg: #ffffff;
  --bg-tint: #f4f7fb;
  --danger: #c62828;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(16, 38, 66, 0.08);
  --mobilebar-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--mobilebar-h) + env(safe-area-inset-bottom));
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 7vw, 48px); font-weight: 800; }
h2 { font-size: clamp(24px, 5vw, 34px); font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none;
  cursor: pointer; transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-dark); }
.btn--ghost { background: var(--brand-soft); color: var(--brand); }
.btn--kaspi { background: var(--kaspi); color: #fff; }
.btn--kaspi:hover { background: var(--kaspi-dark); }
/* Логотип Kaspi: круг с белой обводкой, чтобы не сливался с красной кнопкой */
.kaspi-logo { width: 24px; height: 24px; flex: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #fff; }
.kaspi-logo--sm { width: 14px; height: 14px; box-shadow: none; vertical-align: -2px; margin-right: 2px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; text-decoration: none; }
.logo__icon { width: 26px; height: 26px; fill: var(--brand); }
.nav { display: none; gap: 24px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--brand); }
.header__phone {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font-weight: 700; text-decoration: none; color: var(--brand);
}
.header__phone span { display: none; }
.header__phone svg { width: 22px; height: 22px; }

/* ---------- Первый экран ---------- */
.hero {
  background:
    radial-gradient(1000px 400px at 100% 0%, rgba(11, 92, 171, .14), transparent 60%),
    linear-gradient(180deg, var(--brand-soft), #fff);
  padding: 36px 0 40px;
}
.hero__eyebrow { color: var(--brand); font-weight: 700; margin-bottom: 10px; }
.hero__lead { font-size: 17px; color: var(--muted); max-width: 620px; }
.hero__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

/* ---------- Секции ---------- */
.section { padding: 48px 0; }
.section--tint { background: var(--bg-tint); }
.section__head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.section__head h2 { margin: 0; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-tint); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 14px; color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; height: 46px; outline: none; color: var(--text); }
.search:focus-within { border-color: var(--brand); }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 18px; padding: 2px 16px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; min-height: 40px;
}
.chip[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product {
  display: flex; flex-direction: column; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; padding: 0; font: inherit; color: inherit; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.product:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product__img { aspect-ratio: 1; background: var(--bg-tint); position: relative; }
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.product__badge {
  position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.95); color: var(--muted); padding: 3px 8px; border-radius: 999px;
}
.product__badge--sale { background: #e53935; color: #fff; }
.product__body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product__cat { font-size: 12px; color: var(--muted); }
.product__name { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product__price { margin-top: auto; padding-top: 6px; font-weight: 800; font-size: 16px; color: var(--brand); }
.product__price s { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 6px; }

.placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #b4c4d6; }
.placeholder svg { width: 40%; height: 40%; }

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

/* ---------- Преимущества / шаги ---------- */
.features { display: grid; gap: 12px; }
.feature { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 20px; margin-bottom: 12px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { display: flex; gap: 14px; }
.steps li > span { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; }
.steps p { color: var(--muted); margin: 0; }

/* ---------- Контакты и форма ---------- */
.contact { display: grid; gap: 24px; }
.contact__info p { color: var(--muted); }
.contact__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.contact__list span { display: block; font-size: 13px; color: var(--muted); }
.contact__list a, .contact__list b { font-weight: 700; text-decoration: none; }

.map { margin-top: 32px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.map__frame { height: 320px; background: var(--brand-soft); }
.map__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map__routes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
.map__routes span { grid-column: 1 / -1; font-size: 14px; font-weight: 600; color: var(--muted); }
.map__routes .btn { min-height: 44px; padding: 8px 6px; font-size: 14px; }

.people { display: grid; gap: 10px; margin-top: 4px; }
.person { display: flex; align-items: center; gap: 8px; }
.person__info { flex: 1; min-width: 0; }
.person__info b { display: block; }
.person__info a { white-space: nowrap; font-weight: 600; color: var(--muted); text-decoration: none; font-size: 15px; }
.person .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }

.product__kaspi { font-size: 11px; font-weight: 700; color: var(--kaspi); }

/* Выбор менеджера и кнопки в карточке */
.picker { padding: 20px; display: grid; gap: 12px; }
.picker h3 { font-size: 20px; margin: 0 40px 4px 0; }
.picker .person { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.wa-group { display: grid; gap: 8px; }
.wa-group__label { font-size: 14px; font-weight: 600; color: var(--muted); }
.wa-group__btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }

.card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.form { display: grid; gap: 14px; }
.form__title { font-size: 20px; margin: 0; }
.form__product { margin: -6px 0 0; color: var(--muted); font-size: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-size: 14px; font-weight: 600; }
.field i { font-style: normal; color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px — чтобы iOS не зумил */
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.field textarea { resize: vertical; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.segmented input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }
.form__error { color: var(--danger); margin: 0; font-size: 14px; }
.form__note { font-size: 12px; color: var(--muted); margin: 0; text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

.success { text-align: center; padding: 16px 0; }
.success__icon { width: 64px; height: 64px; border-radius: 50%; background: #e7f7ee; color: var(--wa); display: grid; place-items: center; margin: 0 auto 12px; font-size: 32px; }
.success p { color: var(--muted); }

/* ---------- Подвал и мобильная панель ---------- */
.footer { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 14px; }
.footer__inner { display: flex; flex-direction: column; gap: 4px; }

.mobilebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

/* ---------- Всплывающее окно (bottom sheet на телефоне, окно по центру на ПК) ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%;
  max-height: 92dvh; border-radius: 24px 24px 0 0; background: #fff; color: var(--text);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 -12px 40px rgba(10, 22, 38, .18);
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(10, 22, 38, .5); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } }
.sheet__handle {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 40px; height: 5px; border-radius: 3px; background: rgba(19, 32, 47, .25);
}
.sheet__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(10, 22, 38, .15);
  font-size: 24px; line-height: 1; cursor: pointer; color: var(--text); transition: background .15s;
}
.sheet__close:hover { background: #fff; }
.sheet__body, .sheet > form, .pv__info {
  overflow-y: auto; overscroll-behavior: contain; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #cdd6e0 transparent;
}
.sheet__body::-webkit-scrollbar, .sheet > form::-webkit-scrollbar, .pv__info::-webkit-scrollbar { width: 10px; }
.sheet__body::-webkit-scrollbar-thumb, .sheet > form::-webkit-scrollbar-thumb, .pv__info::-webkit-scrollbar-thumb {
  background: #cdd6e0; border-radius: 10px; border: 3px solid #fff;
}
.sheet__body::-webkit-scrollbar-track, .sheet > form::-webkit-scrollbar-track, .pv__info::-webkit-scrollbar-track { background: transparent; }
.sheet__body { flex: 1; padding-bottom: env(safe-area-inset-bottom); }
.sheet .form { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.sheet .form__title, .sheet .back { margin-right: 44px; }

/* Карточка товара */
.pv__media {
  position: relative; aspect-ratio: 4 / 3; max-height: 40dvh; width: 100%;
  background: radial-gradient(circle at 50% 40%, #fff, var(--bg-tint) 70%);
}
.pv__media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.pv__media .placeholder svg { width: 22%; height: 22%; }
.pv__info { display: flex; flex-direction: column; }
.pv__head { padding: 20px 20px 4px; display: grid; gap: 8px; }
.pv__cat {
  justify-self: start; font-size: 12px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 4px 10px; border-radius: 999px;
}
.pv__head h3 { font-size: 21px; line-height: 1.25; margin: 0; }
.pv__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sheet__price { font-size: 26px; font-weight: 800; color: var(--brand); letter-spacing: -0.01em; }
.sheet__price s { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--yes { background: #e7f7ee; color: var(--wa-dark); }
.pill--no { background: var(--bg-tint); color: var(--muted); }
.pv__desc { margin: 12px 20px 0; padding: 14px 16px; background: var(--bg-tint); border-radius: 14px; }
.pv__desc h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pv__desc p { margin: 0; white-space: pre-line; color: #33414f; font-size: 15px; }
.pv__actions {
  position: sticky; bottom: 0; margin-top: auto; display: grid; gap: 8px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255, 255, 255, .85), #fff 30%);
  backdrop-filter: blur(6px);
}
.pv__info > .pv__desc + .pv__actions, .pv__head + .pv__actions { margin-top: 12px; }
.pv__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.pv__actions .btn { min-height: 46px; padding: 10px 12px; font-size: 15px; }
.pv__actions .wa-group__label { font-size: 13px; }

.back { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; padding: 0; cursor: pointer; justify-self: start; }
body.locked { overflow: hidden; }

/* ---------- Планшет / ПК ---------- */
@media (min-width: 720px) {
  .sheet { margin: auto; max-width: 520px; max-height: 88dvh; border-radius: 24px; box-shadow: 0 30px 80px rgba(10, 22, 38, .3); }
  .sheet[open] { animation: sheet-in .22s ease-out; }
  .sheet--wide { max-width: 900px; }
  .sheet--wide .sheet__body { overflow: hidden; display: flex; }
  .sheet__handle { display: none; }
  .pv { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: min(580px, 88dvh); }
  .pv__media { aspect-ratio: auto; max-height: none; height: 100%; }
  .pv__media img { padding: 28px; }
  .pv__head { padding: 30px 28px 4px; }
  .pv__head h3 { font-size: 24px; margin-right: 40px; }
  .pv__desc { margin: 16px 28px 0; }
  .pv__actions { padding: 16px 28px 24px; }
}
@keyframes sheet-in { from { transform: scale(.97); opacity: 0; } }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .hero__actions { flex-direction: row; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .section__head { flex-direction: row; align-items: center; justify-content: space-between; }
  .search { width: 320px; }
  .header__phone span { display: inline; }
}

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .mobilebar { display: none; }
  .nav { display: flex; }
  .header__phone { margin-left: 24px; }
  .hero { padding: 72px 0 64px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .product__name { font-size: 15px; }
  .features { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .section { padding: 72px 0; }
  .contact { grid-template-columns: 1fr 1fr; align-items: start; gap: 48px; }
  .card { padding: 28px; }
  .map { margin-top: 48px; }
  .map__frame { height: 420px; }
  .map__routes { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
  .map__routes span { margin-right: auto; }
  .map__routes .btn { padding: 8px 18px; }
  .footer__inner { flex-direction: row; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
