/* Фирменная тема Smokee Islland — по логотипу: белые «дымные» буквы с синей обводкой
   и выдавленной тенью на ночном чёрно-синем фоне. Не зависит от темы Telegram. */
@font-face {
  font-family: 'Nunito';
  font-weight: 400 900;
  font-display: swap;
  src: url(../assets/fonts/nunito-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Nunito';
  font-weight: 400 900;
  font-display: swap;
  src: url(../assets/fonts/nunito-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+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #03070f;            /* ночной фон логотипа; совпадает с BRAND_BG в app.js */
  --sea: #071a3d;           /* ночное море — шапка каталога */
  --card: #0a1529;          /* карточки и блоки */
  --card-2: #0e1d38;        /* поля ввода, вложенные блоки */
  --border: rgb(31 122 255 / .24);
  --border-strong: rgb(31 122 255 / .5);
  --text: #f4f8ff;
  --hint: #8696b8;
  --flavor: #a9bde3;

  --smoke: #f4f8ff;         /* «дымный» белый — для текста на действиях */
  --action: #1565e8;        /* заливка главных действий: чуть глубже --ocean, чтобы белый текст читался (5:1) */
  --action-text: #ffffff;
  --ocean: #1f7aff;         /* обводка букв */
  --ocean-deep: #0b3a9e;    /* выдавленная тень букв */
  --ink: #04112b;           /* текст на белом */
  --lagoon: #3cc8ff;        /* цены */
  --palm: #5bd64a;          /* в наличии, скидка */
  --sand: #f0cd8c;          /* промокоды */
  --danger: #ff5a4a;        /* коралловый — ошибки и удаление */
  --soft: rgb(31 122 255 / .14);

  /* Выдавливание вниз, как у букв логотипа */
  --puff: 0 4px 0 var(--ocean-deep), 0 8px 18px rgb(0 0 0 / .45);
  --puff-pressed: 0 1px 0 var(--ocean-deep), 0 3px 8px rgb(0 0 0 / .4);
  --lift: 0 10px 28px rgb(0 0 0 / .5);

  --radius: 22px;
  --display: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --tabbar-h: calc(68px + var(--safe-bottom));
  color-scheme: dark;
  accent-color: var(--ocean);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.4 var(--display);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  caret-color: var(--lagoon);
}
body.no-scroll { overflow: hidden; }
::selection { background: rgb(31 122 255 / .45); color: #fff; }
:focus-visible { outline: 2.5px solid var(--lagoon); outline-offset: 2px; }

h1, h2, h3, p { margin: 0; }
a { color: var(--lagoon); text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon { display: inline-flex; flex-shrink: 0; }
.muted { color: var(--hint); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }

/* ---------- Каркас ---------- */

.view { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + 16px); }
.page { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 30px; font-weight: 900; letter-spacing: -.01em; padding: 4px 2px 0; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; height: var(--tabbar-h); padding: 6px 8px var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgb(0 0 0 / .45);
}
.tabbar:empty { display: none; }
.tab {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--hint); font-size: 12px; font-weight: 700;
}
.tab .icon { padding: 3px 16px; border-radius: 999px; transition: background .2s, color .2s; }
.tab.active { color: var(--text); }
.tab.active .icon { background: var(--action); color: var(--action-text); }
.badge {
  position: absolute; top: 2px; left: calc(50% + 8px);
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--ocean); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
  border: 2px solid var(--card);
}

/* ---------- Кнопки ---------- */

/* Главная кнопка — синяя пилюля с выдавливанием вниз, как буквы логотипа */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  background: var(--action); color: var(--action-text);
  font-weight: 900; font-size: 17px; letter-spacing: .01em;
  box-shadow: var(--puff);
  margin-bottom: 4px; /* место под выдавливание */
  transition: transform .12s cubic-bezier(.2, .8, .2, 1), box-shadow .12s cubic-bezier(.2, .8, .2, 1), opacity .15s;
}
.btn:active { transform: translateY(3px); box-shadow: var(--puff-pressed); }
.btn:disabled { pointer-events: none; background: var(--card-2); color: var(--hint); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.block { width: 100%; }
.btn.secondary {
  background: var(--soft); color: var(--text); font-weight: 800; margin-bottom: 0;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}
.btn.secondary:active { transform: scale(.98); box-shadow: inset 0 0 0 1.5px var(--ocean); }
.btn.danger { background: rgb(255 90 74 / .1); color: var(--danger); box-shadow: inset 0 0 0 1.5px rgb(255 90 74 / .4); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.link-btn { color: var(--lagoon); font-weight: 800; padding: 6px 0; align-self: center; }
.link-btn.danger-link { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); }

/* Своя стрелка «Назад» — только вне Telegram (в Telegram она в шапке) */
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 12px 0 -4px 10px; padding: 6px 12px 6px 6px; border-radius: 999px;
  color: var(--lagoon); font-weight: 800; font-size: 16px;
}
.back-btn:active { background: var(--soft); }
.icon-btn { display: inline-flex; padding: 8px; border-radius: 999px; color: var(--hint); }
.icon-btn:active { background: var(--soft); }
.round-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%; margin-bottom: 4px;
  background: var(--action); color: var(--action-text);
  box-shadow: var(--puff);
  transition: transform .12s cubic-bezier(.2, .8, .2, 1), box-shadow .12s cubic-bezier(.2, .8, .2, 1);
}
.round-btn .icon svg { stroke-width: 3; }
.round-btn:active { transform: translateY(3px); box-shadow: var(--puff-pressed); }

.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.stepper button { display: inline-flex; padding: 9px; color: var(--lagoon); }
.stepper button .icon svg { stroke-width: 2.6; }
.stepper button:disabled { opacity: .3; }
.stepper-value { min-width: 22px; text-align: center; font-weight: 900; }

.segmented { display: flex; padding: 5px; gap: 4px; border-radius: 999px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--border); }
.segmented button { flex: 1; min-height: 40px; padding: 0 8px; border-radius: 999px; font-weight: 800; color: var(--hint); transition: background .2s, color .2s; }
.segmented button.active { background: var(--action); color: var(--action-text); box-shadow: 0 2px 0 var(--ocean-deep); }

.chips { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex-shrink: 0; padding: 10px 20px; margin-bottom: 4px; border-radius: 999px;
  background: transparent; color: var(--text); font-size: 15px; font-weight: 800;
  box-shadow: inset 0 0 0 1.5px var(--border-strong); white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}
.chips.wrap .chip { padding: 9px 16px; font-size: 14px; white-space: normal; text-align: left; }
.chip:disabled { opacity: .4; text-decoration: line-through; }
.chip-note { margin-left: 6px; font-size: 11px; text-decoration: none; display: inline-block; }
.chip.active { background: var(--action); color: var(--action-text); font-weight: 900; box-shadow: var(--puff); }
/* Чипы в несколько строк (сохранённые адреса) — без выдавливания, чтобы не налезали друг на друга */
.chips.wrap .chip { margin-bottom: 0; }
.chips.wrap { padding-bottom: 6px; }
.chips.wrap .chip.active { box-shadow: none; }

/* ---------- Формы ---------- */

.input {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 16px;
  border: 1.5px solid var(--border); background: var(--card-2); outline: none; resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--hint); }
.input:focus { border-color: var(--ocean); background: #11234a; }
select.input { appearance: none; }
textarea.input { resize: none; field-sizing: content; min-height: 76px; }
input[type='time'].input { color-scheme: dark; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 800; color: var(--hint); }
.hint { font-size: 12px; color: var(--hint); }
.form { display: flex; flex-direction: column; gap: 14px; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.toggle input { width: 22px; height: 22px; accent-color: var(--ocean); }
.phone-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* Подсказки адресов под полем */
.suggest { position: relative; }
.suggest-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 6;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card-2); border: 1.5px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--lift);
}
.suggest-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; text-align: left; font-size: 14px; }
.suggest-item + .suggest-item { border-top: 1px solid var(--border); }
.suggest-item .icon { color: var(--lagoon); margin-top: 1px; }
.suggest-item:active { background: var(--soft); }

/* ---------- Блоки ---------- */

.section {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.section-title { font-size: 18px; font-weight: 900; color: var(--text); }
.note { padding: 12px 16px; border-radius: 16px; background: var(--soft); border: 1px solid var(--border); font-size: 14px; }

.list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.section .list { background: none; border: 0; border-radius: 0; margin: 0 -16px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .icon { color: var(--hint); }
.list-item.clickable:active { background: var(--card-2); }
.product-card.out .photo, .list-item.out .photo { opacity: .45; filter: grayscale(.6); }
.product-card.out .price, .list-item.out .price { color: var(--hint); }
.product-card.out .card-title { color: var(--flavor); }

/* Заглушка в обычном браузере: «Откройте магазин в Telegram» */
.tg-only {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px 24px; text-align: center;
  background: linear-gradient(180deg, var(--sea), var(--bg) 60%);
}
.tg-only h1 { font-size: 26px; font-weight: 900; line-height: 1.2; max-width: 22ch; }
.tg-only > p:not(.age-note) { color: var(--flavor); max-width: 34ch; margin: 0 0 8px; }
.tg-only .age-note { margin-top: 24px; }
.empty { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; color: var(--hint); font-size: 16px; font-weight: 700; }
.empty-icon {
  width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--lagoon); box-shadow: inset 0 0 0 1.5px var(--border-strong); margin-bottom: 6px;
}
.empty-inline { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--hint); font-weight: 700; padding: 40px 0; }

.loader { display: flex; justify-content: center; padding: 48px 0; }
.loader span { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--lagoon); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sticky-footer {
  position: sticky; bottom: calc(var(--tabbar-h) + 10px); z-index: 5;
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--card-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--lift);
}

/* ---------- Каталог ---------- */

/* Шапка — ночная лагуна во всю ширину, плавно уходит в ночной фон.
   Название несёт сам логотип (его «дымные» буквы), текстом оно только для экранных дикторов. */
.shop-header {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: -16px -16px 0; padding: 20px 16px 26px;
  background:
    radial-gradient(70% 80% at 50% 38%, rgb(31 122 255 / .34), transparent 70%),
    linear-gradient(180deg, var(--sea), var(--bg));
}
.logo {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgb(0 0 0 / .55);
  background: var(--card); color: var(--smoke); font-weight: 900; font-size: 40px;
}
div.logo { box-shadow: 0 0 0 2.5px var(--ocean); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tagline { display: inline-flex; align-items: center; gap: 6px; color: var(--flavor); font-size: 14px; font-weight: 800; }
.tagline .icon { color: var(--lagoon); }
.tagline .dot { margin: 0 10px; }

.search {
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  border-radius: 999px; background: var(--card); color: var(--hint);
  box-shadow: inset 0 0 0 1.5px var(--border);
  transition: box-shadow .15s;
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--ocean); color: var(--lagoon); }
.search input { flex: 1; min-height: 52px; border: 0; outline: none; background: none; color: var(--text); font-size: 16px; font-weight: 600; }
.search input::placeholder { color: var(--hint); }
.search input::-webkit-search-cancel-button { filter: invert(.6) sepia(1) hue-rotate(180deg); }

.catalog-results { display: flex; flex-direction: column; gap: 22px; }
.catalog-group { display: flex; flex-direction: column; gap: 14px; }
.group-title { font-size: 26px; font-weight: 900; letter-spacing: -.01em; padding: 0 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(155px, 100%), 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.product-card { transition: transform .12s cubic-bezier(.2, .8, .2, 1); }
.product-card:active { transform: scale(.98); }
.card-body { display: flex; flex-direction: column; gap: 3px; flex: 1; padding: 12px 14px 12px; }
.card-title { font-weight: 800; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.card-flavors { color: var(--flavor); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-specs { color: var(--hint); font-size: 12px; font-weight: 600; }
.variant-label { color: var(--hint); }
.card-foot .muted { font-size: 12px; text-align: right; line-height: 1.2; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 8px; min-height: 50px; }
.price { color: var(--lagoon); font-weight: 900; font-size: 19px; white-space: nowrap; }
.price.big { font-size: 26px; }

/* Фото товара — на «ночном море» с бликом, бутылки не обрезаются */
.photo {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  background: radial-gradient(ellipse at 50% 70%, #123a80 0%, #0a1d42 50%, #071330 100%);
}
.photo.placeholder { display: flex; align-items: center; justify-content: center; color: var(--hint); }
.photo.thumb { width: 60px; height: 60px; aspect-ratio: 1; border-radius: 16px; flex-shrink: 0; border: 1px solid var(--border); }
.photo.hero { border-radius: var(--radius); border: 1px solid var(--border); max-height: 42vh; }

/* Предупреждение — тихо, в самом низу каталога */
.catalog-page { min-height: calc(100vh - var(--tabbar-h) - 16px); }
.age-note { margin-top: auto; padding: 18px 12px 0; text-align: center; color: var(--hint); font-size: 12px; line-height: 1.5; opacity: .8; }

/* ---------- Товар ---------- */

.product-name { font-size: 26px; font-weight: 900; letter-spacing: -.01em; line-height: 1.15; }
.specs { color: var(--hint); font-size: 14px; font-weight: 600; }
.description { white-space: pre-line; color: var(--flavor); max-width: 68ch; }

/* ---------- Профиль и заказы ---------- */

.profile-head { display: flex; align-items: center; gap: 16px; padding: 8px 2px; }
.profile-head h1 { font-size: 26px; font-weight: 900; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2.5px var(--ocean);
  background: var(--soft); color: var(--text); font-size: 28px; font-weight: 900;
}

.order-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.section .order-card { background: var(--card-2); }
.order-card + .order-card { margin-top: 10px; }
.order-head { display: flex; align-items: center; gap: 8px; }
.order-head .grow-end { margin-left: auto; }
.order-head b { font-weight: 900; }
.order-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.order-row .icon { color: var(--lagoon); margin-top: 1px; }
.order-comment { font-style: italic; }
.order-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.order-items li { display: flex; justify-content: space-between; gap: 12px; }
.order-items li span:last-child { white-space: nowrap; color: var(--flavor); }
.order-total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 700; }
.order-total b { color: var(--lagoon); font-weight: 900; }
.order-card.cancelled .order-items, .order-card.cancelled .order-total { opacity: .55; }
.order-actions { gap: 10px; padding-top: 4px; }
.orders-title { font-size: 15px; font-weight: 800; color: var(--hint); margin: 0 0 10px; }
.orders-history { margin-top: 16px; }
.orders-history summary {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
  min-height: 48px; padding: 0 16px; border-radius: 16px;
  background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--border); font-weight: 800;
}
.orders-history summary::-webkit-details-marker { display: none; }
.orders-history summary .icon { color: var(--lagoon); transition: transform .2s; }
.orders-history[open] summary .icon { transform: rotate(180deg); }
.orders-history-list { margin-top: 10px; }

.done { align-items: center; text-align: center; padding-top: 56px; }
.done h1 { font-size: 30px; font-weight: 900; }
.done-number { color: var(--lagoon); font-size: 18px; font-weight: 900; }
.done-icon {
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--palm); box-shadow: inset 0 0 0 2px var(--palm); margin-bottom: 6px;
  animation: puff-in .6s cubic-bezier(.16, 1, .3, 1) both;
}
.done-icon .icon svg { stroke-width: 3; }
@keyframes puff-in {
  from { transform: scale(.6); filter: blur(6px); }
  to { transform: none; filter: none; }
}

.buy-box { display: flex; flex-direction: column; gap: 14px; }
.buy-area { display: flex; flex-direction: column; gap: 12px; padding: 0 2px; }

/* Варианты в столбик: крупное название и свой счётчик у каждого */
.variant-list { display: flex; flex-direction: column; gap: 8px; }
.variant-line {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 10px 10px 16px;
  border-radius: 20px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow .15s, background .15s;
}
.variant-line.picked { background: rgb(31 122 255 / .16); box-shadow: inset 0 0 0 2px var(--ocean); }
.variant-line.out { opacity: .45; }
.variant-name { font-size: 17px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.variant-note { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--sand); }
.variant-status { font-size: 13px; color: var(--hint); white-space: nowrap; padding-right: 6px; }
.variant-line .stepper button { padding: 11px; }
.variant-line .stepper-value { min-width: 26px; font-size: 17px; }

/* Статус под полем адреса: найден / выберите из подсказок */
.address-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 700; }
.address-status:empty { display: none; }
.address-status.ok { color: var(--palm); }
.address-status.warn { color: var(--hint); }

.badge-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: var(--hint); background: var(--card-2); border: 1px solid var(--border);
}
.badge-pill.off { color: var(--danger); background: rgb(255 90 74 / .1); border-color: rgb(255 90 74 / .35); }
.badge-pill.ok { color: var(--palm); background: rgb(91 214 74 / .1); border-color: rgb(91 214 74 / .35); }

/* ---------- Промокоды ---------- */

.promo-box { padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1.5px dashed rgb(240 205 140 / .45); }
.promo-box .input { flex: 1; min-width: 0; text-transform: uppercase; }
.promo-box .input::placeholder { text-transform: none; }
.promo-icon { color: var(--sand); display: inline-flex; }
.promo-code { font-weight: 900; letter-spacing: .08em; font-size: 16px; color: var(--sand); }
.promo-code-input { text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
.discount-row { color: var(--palm); }
.order-total.discount-row + .order-total { border-top: 0; padding-top: 0; }
.promo-list { display: flex; flex-direction: column; gap: 10px; }
.promo-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
}
.promo-card.off { opacity: .6; }
.promo-discount { font-size: 19px; font-weight: 900; color: var(--sand); }

/* ---------- Админка ---------- */

.admin-tab { display: flex; flex-direction: column; gap: 14px; }
/* Четыре вкладки админки должны влезать в ширину телефона */
.page > .segmented button { font-size: 14px; padding: 0 4px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }

.photo-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.photo-preview img, .photo-preview .photo {
  width: 100%; max-width: 280px; height: auto; aspect-ratio: 4 / 3;
  border-radius: var(--radius); object-fit: contain; border: 1px solid var(--border);
}

/* Редактор кадра как в «Фото» на iPhone: картинка целиком, поверх — рамка с уголками */
.crop-stage {
  position: relative; width: 100%; overflow: hidden; border-radius: var(--radius);
  background: #02050b; touch-action: none; user-select: none;
}
.crop-image { position: absolute; max-width: none; pointer-events: none; }
.crop-box {
  position: absolute; cursor: move; touch-action: none;
  border: 1px solid rgb(255 255 255 / .85);
  box-shadow: 0 0 0 9999px rgb(0 0 0 / .7); /* затемнение всего, что вне рамки */
}
.crop-grid { position: absolute; inset: 0; pointer-events: none; }
/* Зона захвата 40px, видимая часть — уголки и чёрточки по центру сторон */
.crop-handle { position: absolute; width: 40px; height: 40px; z-index: 1; }
.crop-handle::after { content: ''; position: absolute; border: 0 solid #fff; }
.crop-handle-nw { left: -20px; top: -20px; cursor: nwse-resize; }
.crop-handle-ne { right: -20px; top: -20px; cursor: nesw-resize; }
.crop-handle-se { right: -20px; bottom: -20px; cursor: nwse-resize; }
.crop-handle-sw { left: -20px; bottom: -20px; cursor: nesw-resize; }
.crop-handle-nw::after, .crop-handle-ne::after, .crop-handle-se::after, .crop-handle-sw::after { width: 22px; height: 22px; }
.crop-handle-nw::after { left: 16px; top: 16px; border-left-width: 4px; border-top-width: 4px; }
.crop-handle-ne::after { right: 16px; top: 16px; border-right-width: 4px; border-top-width: 4px; }
.crop-handle-se::after { right: 16px; bottom: 16px; border-right-width: 4px; border-bottom-width: 4px; }
.crop-handle-sw::after { left: 16px; bottom: 16px; border-left-width: 4px; border-bottom-width: 4px; }
.crop-handle-n, .crop-handle-s { left: 50%; margin-left: -20px; cursor: ns-resize; }
.crop-handle-n { top: -20px; }
.crop-handle-s { bottom: -20px; }
.crop-handle-e, .crop-handle-w { top: 50%; margin-top: -20px; cursor: ew-resize; }
.crop-handle-e { right: -20px; }
.crop-handle-w { left: -20px; }
.crop-handle-n::after, .crop-handle-s::after { left: 9px; width: 22px; height: 0; border-top-width: 4px; }
.crop-handle-n::after { top: 18px; }
.crop-handle-s::after { bottom: 18px; }
.crop-handle-e::after, .crop-handle-w::after { top: 9px; height: 22px; width: 0; border-left-width: 4px; }
.crop-handle-e::after { right: 18px; }
.crop-handle-w::after { left: 18px; }
/* С фиксированной пропорцией тянут только за углы */
.crop-box.locked .crop-handle-n, .crop-box.locked .crop-handle-s,
.crop-box.locked .crop-handle-e, .crop-box.locked .crop-handle-w { display: none; }
.crop-grid::before, .crop-grid::after {
  content: ''; position: absolute;
  border: 0 solid rgb(255 255 255 / .6);
  filter: drop-shadow(0 0 1px rgb(0 0 0 / .8));
}
.crop-grid::before { top: 0; bottom: 0; left: 33.333%; width: 33.333%; border-left-width: 1px; border-right-width: 1px; }
.crop-grid::after { left: 0; right: 0; top: 33.333%; height: 33.333%; border-top-width: 1px; border-bottom-width: 1px; }
.variants-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-2); }
.variants-box .input { background: var(--card); }
.variants-box > .btn { align-self: flex-start; }
.variant-row { display: flex; align-items: center; gap: 8px; }
.variant-row .input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; }
.variant-row .icon-btn { padding: 6px; }
.stepper-input {
  width: 46px; padding: 0; border: 0; background: none; outline: none;
  text-align: center; font-weight: 900; color: var(--text); appearance: textfield; -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Шторка и уведомления ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-end;
  background: rgb(1 3 8 / 0); transition: background .25s;
}
.sheet-backdrop.open { background: rgb(1 3 8 / .7); }
.sheet {
  width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 0 16px calc(16px + var(--safe-bottom));
  background: var(--card); border-top: 1.5px solid var(--border-strong);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 40px rgb(0 0 0 / .5);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.16, 1, .3, 1);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 0 12px; background: var(--card); }
.sheet-head h3 { font-size: 21px; font-weight: 900; }

/* Окно подтверждения: по центру, а не шторкой снизу */
.sheet-backdrop.dialog { align-items: center; justify-content: center; padding: 16px; }
.dialog .sheet {
  max-width: 400px; padding: 4px 20px 20px; border: 1.5px solid var(--border-strong); border-radius: 28px;
  box-shadow: var(--lift); opacity: 0; transform: scale(.94);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), opacity .18s;
}
.dialog.open .sheet { opacity: 1; transform: none; }
.dialog .sheet-head h3 { font-size: 19px; line-height: 1.25; }
.dialog-body { display: flex; flex-direction: column; gap: 12px; }
.dialog-text { margin: 0 0 6px; color: var(--flavor); }
.btn.danger-solid { background: var(--danger); color: #fff; box-shadow: 0 4px 0 #a3271b, 0 8px 18px rgb(0 0 0 / .45); }
.btn.danger-solid:active { box-shadow: 0 1px 0 #a3271b, 0 3px 8px rgb(0 0 0 / .4); }

/* Сверху экрана: внизу живут главные кнопки («В корзину», «Оформить») — тост их не закрывает */
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 30;
  top: calc(12px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  padding: 13px 18px; border-radius: 18px;
  background: var(--card-2); color: var(--text); border: 1.5px solid var(--border-strong);
  font-size: 14px; font-weight: 800; text-align: center; box-shadow: var(--lift);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.16, 1, .3, 1);
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--card-2); color: var(--danger); border-color: rgb(255 90 74 / .6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
