/* Вцветъ · мини-апп. Значения — из tokens.json дизайн-системы сайта, ничего не выдумано. */

@font-face {
  font-family: "Vetrino";
  src: url("assets/fonts/vetrino.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/montserrat-cyrillic.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045f, U+0490-0491, U+04b0-04b1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0000-00ff, U+0131, U+0152-0153, U+02bb-02bc, U+02c6, U+02da, U+02dc, U+2000-206f,
    U+20ac, U+2122, U+2212, U+feff, U+fffd;
}

:root {
  --ink: #1c1c1a;
  --ink-800: #2f2e2b;
  --ink-700: #4d4c48;
  --ink-300: #b9b6ae;
  --ink-150: #e8e5de;
  --paper: #fbfaf6;
  --paper-raised: #ffffff;
  --lavender: #6269bb;
  --lavender-150: #eef0ff;
  --lavender-300: #c0c4f4;
  --peony: #f49ab7;
  --peony-100: #fff0f5;
  --stem: #9dba4b;
  --stem-100: #f1f6df;
  --coral: #ff8562;
  --coral-100: #fff0eb;
  --success: #406218;
  --error: #9e352d;

  --font-display: "Vetrino", Georgia, serif;
  --font-text: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;

  --radius-control: 12px;
  --radius-card: 20px;
  --radius-feature: 32px;
  --radius-pill: 999px;

  --shadow-card: 0 14px 44px rgba(28, 28, 26, 0.08);
  --shadow-lift: 0 18px 50px rgba(28, 28, 26, 0.14);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --tab-height: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Собственный display у .sheet/.toast перебивает браузерное [hidden] — вернём его силой,
   иначе невидимая шторка ловит нажатия по всему экрану. */
[hidden] {
  display: none !important;
}

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

html,
body {
  margin: 0;
  padding: 0;
  touch-action: manipulation;  /* двойной тап больше не масштабирует */
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.55;
  overscroll-behavior-y: none;
}

.app {
  padding: 0 16px calc(var(--tab-height) + var(--safe-bottom) + 28px);
  max-width: 640px;
  margin: 0 auto;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  margin: 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 19px;
}

p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* --- служебное ------------------------------------------------------- */

.boot {
  display: grid;
  gap: 8px;
  place-content: center;
  min-height: 70vh;
  text-align: center;
}

.boot__mark {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: 0.06em;
}

.boot__hint,
.muted {
  color: var(--ink-700);
  font-size: 13px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-700);
}

.screen {
  padding-top: 18px;
  animation: rise 0.32s var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
}

/* --- шапка экрана ----------------------------------------------------- */

.hero {
  position: relative;
  /* Экран телефона короткий: шапка не должна съедать больше трети первого вида. */
  padding: 16px 18px 18px;
  border-radius: var(--radius-feature);
  background: linear-gradient(150deg, var(--lavender-150), var(--paper-raised) 62%);
  overflow: hidden;
  margin-bottom: 22px;
}

.hero--peony {
  background: linear-gradient(150deg, var(--peony-100), var(--paper-raised) 62%);
}

.hero--stem {
  background: linear-gradient(150deg, var(--stem-100), var(--paper-raised) 62%);
}

.hero h1 {
  margin: 2px 0 6px;
  font-size: 30px;
  max-width: 13ch;
}

/* Именно подзаголовок, а не любой абзац в шапке: под «.hero p» попадал и надзаголовок,
   из-за чего он получал чужой кегль и ширину и разваливался на четыре строки. */
.hero__lead {
  color: var(--ink-700);
  font-size: 14px;
  /* Уже, чем блок: справа внизу лежит иллюстрация, и текст не должен под неё заезжать. */
  max-width: 24ch;
  padding-bottom: 26px;
}

.hero__art {
  position: absolute;
  right: -14px;
  bottom: -16px;
  width: 116px;
  height: 116px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
}

/* --- карточки каталога ------------------------------------------------ */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ink-150);
  background: var(--paper-raised);
  font-size: 13px;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out),
    border-color 0.16s var(--ease-out);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* Один размер строки на всю сетку: карточки одинаковые, даже когда названия
     разной длины — иначе ряды прыгают по высоте. */
  grid-auto-rows: 1fr;
  gap: 12px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  background: var(--paper-raised);
  border: 1px solid var(--ink-150);
  overflow: hidden;
  text-align: left;
  padding: 0;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-lift);
}

.card__media {
  /* span внутри button: без display:block не работают ни aspect-ratio, ни overflow */
  display: block;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--lavender-150);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Специфичность выше, чем у «.card__media img», иначе стикер растягивается на всё фото. */
.card__media .card__art {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(28, 28, 26, 0.18));
}

.card__body {
  /* flex + margin-top:auto у цены: карточки в ряду одной высоты, и цены стоят на одной
     линии независимо от длины названия. С grid цена ехала следом за текстом. */
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 13px 14px;
  gap: 4px;
}

.card__title {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.1;
}

.card__sub {
  font-size: 12px;
  color: var(--ink-700);
  min-height: 30px;
}

.card__price {
  /* auto прижимает цену к низу карточки: в ряду они встают на одну линию,
     как бы ни было длинно название. Прежние 2px тянули её следом за текстом. */
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

/* --- секции и блоки ---------------------------------------------------- */

.section {
  margin-top: 26px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.panel + .panel {
  margin-top: 12px;
}

.note {
  border-radius: var(--radius-card);
  background: var(--stem-100);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-700);
}

/* --- опции (охапка, ритм, зона) ---------------------------------------- */

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-card);
  border: 1px solid var(--ink-150);
  background: var(--paper-raised);
  text-align: left;
  transition: border-color 0.16s var(--ease-out), background 0.16s var(--ease-out);
}

.option[aria-pressed="true"] {
  border-color: var(--lavender);
  background: var(--lavender-150);
}

.option__badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--ink-150);
  font-family: var(--font-display);
  font-size: 17px;
}

.option[aria-pressed="true"] .option__badge {
  background: var(--lavender);
  border-color: var(--lavender);
  color: #fff;
}

.option__text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.option__title {
  font-weight: 600;
  font-size: 14px;
}

.option__sub {
  font-size: 12px;
  color: var(--ink-700);
}

.option__price {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.option__art {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* --- форма -------------------------------------------------------------- */

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.field__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 14px 15px;
  border-radius: var(--radius-control);
  border: 1px solid var(--ink-150);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: 16px;  /* меньше 16px — iOS зумит страницу при фокусе и не возвращает */
  transition: border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(98, 105, 187, 0.18);
}

.field--invalid input,
.field--invalid textarea {
  border-color: var(--error);
}

.field__hint {
  font-size: 12px;
  color: var(--ink-700);
}

.field__error {
  font-size: 12px;
  color: var(--error);
}

/* --- сводка ------------------------------------------------------------- */

.summary {
  border-radius: var(--radius-feature);
  background: var(--ink);
  color: var(--paper);
  padding: 18px 20px;
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.summary h3 {
  color: var(--paper);
  font-size: 22px;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: #d9d6ce;
}

.summary__row strong {
  color: #fff;
  font-weight: 600;
  text-align: right;
}

.summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 12px;
  margin-top: 2px;
}

.summary__total span {
  font-size: 13px;
  color: #d9d6ce;
}

.summary__total strong {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  transition: transform 0.16s var(--ease-out), opacity 0.16s var(--ease-out);
}

.button:active {
  transform: scale(0.98);
}

.button--ghost {
  background: transparent;
  border-color: var(--ink-150);
  color: var(--ink);
}

.button--quiet {
  background: var(--paper-raised);
  border-color: var(--ink-150);
  color: var(--ink);
  min-height: 42px;
  font-size: 13px;
  width: auto;
  padding: 0 16px;
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* --- заказы -------------------------------------------------------------- */

.order {
  border-radius: var(--radius-card);
  background: var(--paper-raised);
  border: 1px solid var(--ink-150);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.order + .order {
  margin-top: 12px;
}

.order__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order__id {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-700);
}

.order__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
}

.badge {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--lavender-150);
  color: var(--lavender);
}

.badge--done {
  background: var(--stem-100);
  color: var(--success);
}

.badge--cancelled {
  background: #f2efe9;
  color: var(--ink-700);
}

.badge--wait {
  background: var(--coral-100);
  color: #b8452a;
}

.track {
  display: flex;
  gap: 6px;
  margin: 14px 0 10px;
}

.track__step {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--ink-150);
}

.track__step.is-done {
  background: var(--lavender);
}

.order__lines {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-700);
}

.order__lines span strong {
  color: var(--ink);
  font-weight: 600;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.empty img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  opacity: 0.85;
}

/* --- таббар --------------------------------------------------------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  /* Колонок может быть 4 или 5 — у менеджера появляется «Панель». */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--ink-150);
}

.tab {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 7px 2px;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  font-size: 11px;
  color: var(--ink-700);
  transition: color 0.16s var(--ease-out), background 0.16s var(--ease-out);
}

.tab__icon {
  font-size: 17px;
  line-height: 1;
}

.tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--lavender-150);
}

/* --- шторка ---------------------------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 26, 0.42);
  animation: fade 0.2s var(--ease-out) both;
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius-feature) var(--radius-feature) 0 0;
  padding: 22px 18px calc(26px + var(--safe-bottom));
  animation: slide 0.3s var(--ease-out) both;
  -webkit-overflow-scrolling: touch;
}

.sheet__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ink-150);
  background: var(--paper-raised);
  font-size: 19px;
  line-height: 1;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes slide {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
}

/* --- тост ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 18px);
  transform: translateX(-50%);
  z-index: 80;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  box-shadow: var(--shadow-lift);
  animation: rise 0.24s var(--ease-out) both;
  max-width: calc(100% - 32px);
  text-align: center;
}

/* --- детали букета ----------------------------------------------------------- */

.detail__media {
  border-radius: var(--radius-feature);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 16px;
  background: var(--lavender-150);
}

.detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail__price {
  font-family: var(--font-display);
  font-size: 30px;
  margin-top: 6px;
}

.stack {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.rows {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-700);
}

.rows div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.rows strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 360px) {
  .grid {
    gap: 10px;
  }

  h1 {
    font-size: 30px;
  }
}

/* --- админская панель ------------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.tile {
  border-radius: var(--radius-card);
  background: var(--paper-raised);
  border: 1px solid var(--ink-150);
  padding: 12px 12px 13px;
  display: grid;
  gap: 2px;
}

.tile--accent {
  background: var(--lavender-150);
  border-color: transparent;
}

.tile__value {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.05;
}

/* Сумма длиннее счётчика: тем же кеглем «24 550 ₽» переносило рубль на вторую строку. */
.tile__value--money {
  font-size: 17px;
  padding-top: 4px;
}

.tile__label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-700);
}

.admin-order__client {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-order__client a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ink-150);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}

.admin-order__when {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--stem-100);
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
}

.admin-order__when--soon {
  background: var(--coral-100);
  color: #b8452a;
}


/* Два входа с главной сайта (.bouquet-path): быстрый заказ и индивидуальный букет.
   Цвета и структура — оттуда же, кегль — по шкале мини-аппа: карточка в 390 px
   высотой, как на сайте, увела бы витрину под сгиб. */
.entries {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.entry {
  display: grid;
  gap: 12px;
  padding: 16px 16px 14px;
  text-align: left;
  border: 1px solid rgb(28 28 26 / 8%);
  border-radius: var(--radius-card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.entry--quick {
  background: var(--lavender-300);
}

.entry--individual {
  background: var(--stem-100);
}

.entry__head,
.entry__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.entry__foot {
  border-top: 1px solid rgb(28 28 26 / 12%);
  padding-top: 12px;
}

.entry__num {
  font-family: var(--font-display);
  font-size: 24px;
  color: rgb(28 28 26 / 38%);
}

.entry__title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
}

.entry__lead {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-700);
}

.entry__note {
  font-size: 13px;
  font-weight: 600;
}

.entry__action {
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(28 28 26 / 22%);
}

.entry:active {
  transform: scale(0.995);
}

.look + .look {
  margin-top: 16px;
}

.look__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.look__note {
  font-size: 12px;
  color: var(--ink-700);
  margin-top: 8px;
}
