:root {
  --bg: #14151b;
  --surface: #1c1d24;
  --surface-2: #24262e;
  --soft: #2b2d36;
  --line: rgba(255, 255, 255, .07);
  --text: #ffffff;
  --muted: #8d909b;
  --accent: #19f28d;
  --accent-hover: #4df6a8;
  --accent-text: #00210f;
  --ok: #19f28d;
  --danger: #ff5a5a;
  --warn: #ffb547;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Geologica", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 30px; }
h2 { font-size: 26px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-text); }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.accent { color: var(--accent); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- header ---------- */
.header { position: sticky; top: 0; z-index: 30; background: rgba(20, 21, 27, .92); backdrop-filter: blur(14px); }
.header__row { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: flex; flex-direction: column; line-height: 1; flex: none; }
.logo__name { font-size: 22px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); }
.logo__sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.qnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.qnav::-webkit-scrollbar { display: none; }
.qnav a {
  display: flex; align-items: center; gap: 10px; flex: none; padding: 6px 14px 6px 6px;
  border-radius: 12px; background: var(--surface); transition: background .15s;
}
.qnav a:hover, .qnav a.is-active { background: var(--soft); }
.qnav__icon { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.qnav__icon img { width: 100%; height: 100%; object-fit: cover; }
.qnav b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; }
.qnav small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.header__actions { display: flex; gap: 8px; margin-left: auto; flex: none; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 10px; background: rgba(255, 255, 255, .1); font-weight: 600; font-size: 14px; transition: background .15s;
}
.cart-btn:hover { background: rgba(255, 255, 255, .16); }
.cart-btn__count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.search { position: relative; padding-bottom: 14px; }
.search input {
  width: 100%; height: 46px; padding: 0 16px 0 46px; border: 1px solid transparent; border-radius: 12px;
  background: var(--surface); outline: none; font-size: 15px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: rgba(255, 255, 255, .18); background: var(--surface-2); }
.search svg { position: absolute; left: 16px; top: 23px; transform: translateY(-50%); color: var(--muted); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 24px; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 16px; cursor: pointer;
  transition: background .15s, transform .06s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: rgba(255, 255, 255, .08); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, .14); }
.btn--light { background: #fff; color: #111; }
.btn--light:hover { background: #e9e9ec; }
.btn--block { width: 100%; }
.btn--sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .label { font-size: 13px; color: var(--muted); }
.input, .field input[type=text], .field input[type=email], .field input[type=number], .field input[type=password],
.field select, .field textarea {
  width: 100%; height: 50px; padding: 0 16px; border: 1px solid transparent; border-radius: 12px;
  background: rgba(255, 255, 255, .06); outline: none; font-size: 15px;
}
.field textarea { height: auto; min-height: 110px; padding: 12px 16px; resize: vertical; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #61646f; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(255, 255, 255, .2); }
.field select option { background: var(--surface); }
.hint { font-size: 12px; color: var(--muted); }
.error-text { color: var(--danger); font-size: 13px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; }
.panel--tight { padding: 16px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel__title { display: inline-flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 600; }
.panel__title svg { color: var(--muted); transition: transform .15s; }
a.panel__title:hover svg { transform: translateX(3px); color: var(--text); }
.stack { display: grid; gap: 16px; }
.page { padding-top: 16px; padding-bottom: 40px; display: grid; gap: 16px; }

/* ---------- banners ---------- */
.banners { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 48px) / 4); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-top: 4px; }
.banners::-webkit-scrollbar { display: none; }
.banner {
  display: block; overflow: hidden; scroll-snap-align: start; border-radius: var(--radius);
  aspect-ratio: 2.35 / 1; background: var(--surface); transition: transform .2s;
}
a.banner:hover { transform: translateY(-2px); }
.banner img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 20px; }
.tiles--more > .tile:nth-child(n+13) { display: none; }
.tiles--more.is-open > .tile { display: block; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 7 * 16px) / 8); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.shelf::-webkit-scrollbar { display: none; }
.shelf .tile { scroll-snap-align: start; }
.tile { display: block; min-width: 0; }
.tile__img { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile:hover .tile__img img, .tile:hover .cover { transform: scale(1.04); }
.tile__name { margin-top: 10px; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile:hover .tile__name { color: var(--accent); }
.tile__price { margin-top: 2px; font-size: 13px; color: var(--muted); }
.tile__price s { margin-left: 4px; opacity: .7; }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 1; padding: 3px 8px; border-radius: 6px;
  background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 600;
}
.badge--muted { background: rgba(0, 0, 0, .7); color: #fff; left: auto; right: 10px; }

/* обложка-заглушка, если у товара нет фото */
.cover {
  width: 100%; height: 100%; display: grid; place-items: center; container-type: inline-size;
  color: #fff; transition: transform .3s; overflow: hidden;
}
.cover span { font-weight: 800; font-size: 34cqw; line-height: 1; letter-spacing: -.04em; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }

.arrows { display: flex; gap: 8px; }
.arrow {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08);
  display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.arrow:hover { background: rgba(255, 255, 255, .16); }
.more { display: flex; justify-content: center; margin-top: 24px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 14px; color: #c9cbd2; white-space: nowrap; }
.chip:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.chip.is-active { background: #fff; color: #111; }

.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 8px; font-size: 22px; }
.empty .btn { margin-top: 20px; }

/* ---------- product ---------- */
.pp { display: grid; grid-template-columns: 260px minmax(0, 1fr) 380px; gap: 16px; align-items: start; padding-top: 16px; padding-bottom: 40px; }
.side { padding: 12px; position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; scrollbar-width: thin; }
.side__title { font-size: 13px; color: var(--muted); padding: 6px 10px 10px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; font-size: 14px; }
.side a:hover { background: rgba(255, 255, 255, .05); }
.side a.is-active { background: rgba(255, 255, 255, .1); }
.side__icon { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; flex: none; }
.side__icon img { width: 100%; height: 100%; object-fit: cover; }

.pp-hero { display: flex; gap: 20px; align-items: center; }
.pp-hero__img { width: 112px; height: 112px; border-radius: 20px; overflow: hidden; flex: none; background: var(--surface-2); }
.pp-hero__img img { width: 100%; height: 100%; object-fit: cover; }
.pp-hero h1 { font-size: 28px; }
.pp-hero .muted { margin-top: 6px; }
.perks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.perk { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: rgba(25, 242, 141, .1); color: var(--accent); font-size: 12px; font-weight: 500; }

.nominals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.nominal { position: relative; cursor: pointer; }
.nominal input { position: absolute; opacity: 0; pointer-events: none; }
.nominal__box {
  display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 2px solid transparent; transition: border-color .15s, background .15s;
}
.nominal:hover .nominal__box { background: rgba(255, 255, 255, .08); }
.nominal input:checked + .nominal__box { border-color: var(--accent); background: rgba(25, 242, 141, .06); }
.nominal input:focus-visible + .nominal__box { outline: 2px solid #fff; outline-offset: 2px; }
.nominal__img { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.nominal__img img { width: 100%; height: 100%; object-fit: cover; }
.nominal__price { font-weight: 700; font-size: 17px; padding: 0 4px; }
.nominal__price s { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 4px; }
.nominal__name { font-size: 13px; color: var(--muted); padding: 0 4px 4px; }
.nominal__check {
  position: absolute; top: 18px; right: 18px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); display: none; place-items: center;
}
.nominal input:checked ~ .nominal__check { display: grid; }

.desc { white-space: pre-line; color: #d6d8de; line-height: 1.6; }

.buy { position: sticky; top: 140px; display: grid; gap: 18px; }
.buy__item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.buy__thumb { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex: none; }
.buy__thumb img { width: 100%; height: 100%; object-fit: cover; }
.buy__item b { display: block; font-weight: 500; font-size: 14px; line-height: 1.3; }
.buy__variant { display: block; font-size: 13px; color: var(--muted); }
.buy__total { display: flex; justify-content: space-between; align-items: baseline; }
.buy__total b { font-size: 26px; font-weight: 700; }
.buy__row { display: flex; gap: 10px; }
.buy__row .btn { flex: 1; }
.terms { font-size: 12px; color: var(--muted); line-height: 1.5; }
.terms a { color: #c9cbd2; text-decoration: underline; text-underline-offset: 2px; }

.pmethods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm { position: relative; cursor: pointer; }
.pm input { position: absolute; opacity: 0; pointer-events: none; }
.pm__box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 74px;
  border-radius: 12px; background: rgba(255, 255, 255, .06); border: 2px solid transparent; font-size: 12px; color: #c9cbd2; text-align: center;
  transition: border-color .15s, background .15s;
}
.pm:hover .pm__box { background: rgba(255, 255, 255, .1); }
.pm input:checked + .pm__box { border-color: #fff; background: rgba(255, 255, 255, .12); color: #fff; }
.pm input:focus-visible + .pm__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.pm__logo { height: 22px; display: grid; place-items: center; }

.qty { display: inline-flex; align-items: center; height: 50px; border-radius: 12px; background: rgba(255, 255, 255, .06); flex: none; }
.qty button { width: 42px; height: 100%; border: 0; background: none; cursor: pointer; font-size: 20px; color: var(--muted); }
.qty button:hover { color: #fff; }
.qty input { width: 32px; border: 0; text-align: center; background: none; outline: none; font-weight: 600; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty--sm { height: 38px; border-radius: 10px; }
.qty--sm button { width: 34px; font-size: 17px; }

/* ---------- cart ---------- */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 0; }
.cart-line + .cart-line { border-top: 1px solid var(--line); }
.cart-line__img { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__title { font-weight: 500; }
.cart-line__title:hover { color: var(--accent); }
.cart-line__sum { font-weight: 700; font-size: 17px; min-width: 100px; text-align: right; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; margin-top: 4px; }
.link-btn:hover { color: var(--danger); }
.summary { position: sticky; top: 140px; }

/* ---------- pay ---------- */
.pay { max-width: 540px; margin: 24px auto 48px; display: grid; gap: 16px; }
.pay__amount { font-size: 40px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.pay__items { display: grid; gap: 8px; font-size: 14px; }
.pay__items div { display: flex; justify-content: space-between; gap: 12px; }
.notice { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 14px; line-height: 1.5; }
.notice--warn { background: rgba(255, 181, 71, .12); color: #ffd79a; }
.secure { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12px; color: var(--muted); }

/* ---------- footer ---------- */
.footer { margin-top: 24px; padding: 40px 0 32px; background: #101116; font-size: 14px; color: var(--muted); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.footer h4 { margin: 0 0 12px; color: #fff; font-size: 14px; font-weight: 600; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a:hover { color: #fff; }
.footer__pay { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.footer__pay span { padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, .06); font-size: 12px; font-weight: 600; color: #c9cbd2; }
.footer__bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #fff; color: #111; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
  transition: .2s; z-index: 50; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #0a8f52; font-weight: 700; white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .shelf { grid-auto-columns: calc((100% - 5 * 16px) / 6); }
  .pp { grid-template-columns: 220px minmax(0, 1fr) 340px; }
}
@media (max-width: 1100px) {
  .banners { grid-auto-columns: calc((100% - 16px) / 2); }
  .pp { grid-template-columns: minmax(0, 1fr) 340px; }
  .pp .side { display: none; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shelf { grid-auto-columns: calc((100% - 4 * 16px) / 5); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .pp, .cart { grid-template-columns: 1fr; }
  .buy, .summary { position: static; }
  .qnav { display: none; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; }
  .shelf { grid-auto-columns: calc((100% - 2 * 12px) / 3.3); gap: 12px; }
  .arrows { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 12px; }
  .header__row { height: 58px; }
  .panel { padding: 16px; border-radius: 20px; }
  .panel__title, h2 { font-size: 21px; }
  .banners { grid-auto-columns: 86%; gap: 10px; }
  .tiles { gap: 16px 10px; }
  .tile__name { font-size: 13px; }
  .shelf { grid-auto-columns: calc((100% - 2 * 10px) / 2.6); gap: 10px; }
  .pp-hero__img { width: 76px; height: 76px; border-radius: 16px; }
  .pp-hero h1 { font-size: 22px; }
  .nominals { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cart-line { grid-template-columns: 60px minmax(0, 1fr); }
  .cart-line__img { width: 60px; height: 60px; }
  .cart-line__controls { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .footer__grid { grid-template-columns: 1fr; gap: 24px; }
  .pay__amount { font-size: 32px; }
}
@media (min-width: 601px) { .cart-line__controls { display: contents; } }
