/* Дизайн «Спорт и энергия». Шрифты лежат локально в /fonts (лицензия OFL рядом). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-cyrillic.woff2") format("woff2-variations"), url("/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2-variations"), url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {  /* только знак ₽ */
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2-variations"), url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+20BD;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/fonts/unbounded-cyrillic.woff2") format("woff2-variations"), url("/fonts/unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/fonts/unbounded-latin.woff2") format("woff2-variations"), url("/fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --page: #EFEFEC;
  --card: #FFFFFF;
  --ink: #111111;
  --lime: #C8F031;
  --plate: #F4F4F1;
  --hint: #62625D;
  --line: #E0E0DA;
  --danger: #C62828;
  --head: "Unbounded", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--page); }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 15px/1.4 var(--body);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-wrap: anywhere;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2 { font-family: var(--head); font-weight: 800; margin: 0; }

/* шапка */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--page);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.brand { font: 800 22px/1 var(--head); min-height: 44px; padding: 0; letter-spacing: .01em; }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 22px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.cart-btn .ico { flex: none; }

/* главный экран */
.front { padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.banner {
  position: relative; overflow: hidden; height: 150px; border-radius: 24px; background: var(--ink); color: #fff;
  padding: 18px 16px 18px 20px; display: flex; align-items: stretch;
}
.banner-text { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; }
.banner h1 { font-size: 22px; line-height: 1.15; color: #fff; }
.lime-btn {
  position: relative; height: 36px; padding: 0 18px; border-radius: 18px;
  background: var(--lime); color: var(--ink); font-weight: 700; font-size: 14px;
}
.lime-btn::after { content: ""; position: absolute; inset: -4px 0; }
.banner-pic {
  position: absolute; right: 16px; top: 50%; width: 110px; height: 110px; margin-top: -55px;
  border-radius: 18px; background: var(--plate); overflow: hidden;
}
.banner-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tabs { display: flex; gap: 8px; }
.tabs button {
  position: relative; flex: 1 1 0; min-width: 0; height: 40px; border-radius: 20px;
  background: var(--card); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.tabs button::after { content: ""; position: absolute; inset: -2px 0; }
.tabs button.active { background: var(--lime); color: var(--ink); font-weight: 700; }

main { padding: 16px 16px 24px; scroll-margin-top: 72px; }

/* сетка товаров */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.card { background: var(--card); border-radius: 22px; padding: 10px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; min-width: 0; }
.card-open { display: flex; flex-direction: column; gap: 8px; text-align: left; width: 100%; min-height: 44px; }
.plate { background: var(--plate); border-radius: 16px; overflow: hidden; }
.card .plate { height: 128px; }
.plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .title {
  font-size: 13px; font-weight: 500; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price { font-weight: 800; font-size: 16px; white-space: nowrap; }
.add {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--ink);
}
.add::before, .add::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--lime); border-radius: 1px; }
.add::before { width: 16px; height: 2.5px; margin: -1.25px 0 0 -8px; }
.add::after { width: 2.5px; height: 16px; margin: -8px 0 0 -1.25px; }
.add:disabled { opacity: .5; }
.add:active, .primary:active, .lime-btn:active { transform: scale(.96); }

/* кнопки */
.primary, .lime-main {
  display: block; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 24px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px;
}
.lime-main { background: var(--lime); color: var(--ink); }
.primary:disabled { opacity: .4; }
.secondary {
  display: block; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 24px;
  background: var(--card); font-weight: 600; font-size: 15px;
}
.danger { color: var(--danger); }
.more { margin-top: 16px; }
.empty { text-align: center; color: var(--hint); padding: 48px 0; }
.row { display: flex; gap: 10px; margin-top: 10px; }
.row > * { flex: 1 1 0; min-width: 0; }

/* корзина и заказ */
main h2 { font-size: 20px; margin: 0 0 16px; }
.line { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 22px; padding: 10px; margin-bottom: 12px; }
.line .plate { width: 72px; height: 72px; flex: none; }
.line .info { flex: 1; min-width: 0; }
.line .info .t { font-weight: 600; font-size: 14px; }
.line .info .s { color: var(--hint); font-size: 13px; margin-top: 2px; }
.line .x {
  flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--plate);
  font-size: 16px; line-height: 1; color: var(--ink);
}
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 18px; margin: 16px 0; }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; color: var(--hint); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=tel] {
  width: 100%; min-height: 48px; font: inherit; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
}
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; font-size: 14px; }
.consent input { flex: none; margin: 1px 0 0; width: 22px; height: 22px; accent-color: var(--ink); }
.error { color: var(--danger); min-height: 20px; margin: 6px 0; font-size: 14px; }
.done { text-align: center; padding: 40px 0; }
.done .big { font-size: 48px; }
.done h2 { margin: 12px 0; }
.done p { color: var(--hint); }
.done .primary { margin-top: 20px; }

/* карточка товара */
.sheet {
  position: fixed; inset: 0; z-index: 10; background: rgba(17, 17, 17, .5);
  display: flex; align-items: flex-end;
}
.sheet .panel {
  background: var(--page); width: 100%; max-height: 92vh; overflow: auto;
  border-radius: 24px 24px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.sheet .plate { height: min(46vh, 320px); border-radius: 20px; background: var(--plate); }
.sheet .name { font-weight: 600; font-size: 17px; margin: 14px 0 2px; }
.sheet .price { font-size: 22px; margin-bottom: 14px; }
.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.sizes button { min-height: 44px; border-radius: 16px; background: var(--card); font-weight: 600; }
.sizes button.active { background: var(--lime); color: var(--ink); font-weight: 800; }
.sizes.nudge { animation: nudge .6s ease; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0); }
  30% { box-shadow: 0 0 0 6px var(--lime); border-radius: 20px; }
}

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 20px; text-align: center; font-weight: 500;
}

@media (max-width: 380px) {
  .brand { font-size: 20px; }
  .cart-btn { padding: 0 12px; }
  .banner h1 { font-size: 20px; }
  .tabs button { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
