/* «Ваша кофейня» — общий пример сайта для кофейни.
   Материал — крафтовый стакан навынос: фон страницы как крафт-бумага пакета,
   тёмная крышка, на стакане имя гостя маркером бариста.
   Главное на странице — конструктор стакана; всё вокруг него спокойное.
   Шрифты: Rubik Mono One — как штамп на пакете с зерном (только заголовки),
   Onest — текст, Caveat — маркер бариста.

   Отступы — по сетке 8 px. */

:root {
  --kraft: #DCC29E;        /* фон страницы */
  --kraft-deep: #B98F5E;   /* гильза стакана, линии */
  --cup: #CFA978;          /* сам стакан */
  --esp: #23160E;          /* текст, крышка, тёмные блоки — 10:1 на крафте */
  --esp-soft: #5E4A39;     /* второстепенный текст — 4,9:1 на крафте */
  --foam: #FFFBF5;         /* карточки, конструктор */
  --matcha: #3E6B2F;       /* кнопки действия — белый текст 6,3:1 */
  --matcha-light: #DDE8CF;
  --marker: #15100C;

  --font-display: "Rubik Mono One", "Arial Black", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;

  --radius: 20px;
  --radius-sm: 12px;
  --gutter: 16px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  /* Мобильные браузеры рисуют поверх нажатой кнопки или ссылки синий
     прямоугольник — он режет глаз и спорит с собственным откликом кнопки
     (как в «Моих финансах»). Рамка фокуса для клавиатуры остаётся. */
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--kraft);
  /* волокна крафт-бумаги */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--esp);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body.sheet-open { overflow: hidden; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
p { margin: 0; }
img { display: block; max-width: 100%; }
small { font-size: 0.8em; opacity: 0.72; }

:focus-visible { outline: 2px solid var(--esp); outline-offset: 3px; }

/* у моноширинного Rubik Mono One пробел шириной в целую букву — подтягиваем слова */
.hero__title, .section-title, .builder__price, .find__address, .brand__name,
.order-bar__total, .total span:last-child, .sheet__title, .site-footer__brand { word-spacing: -0.4em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.btn:active { transform: scale(0.97); }
.btn--matcha { background: var(--matcha); color: #fff; }
.btn--matcha:hover { background: #335A26; }
.btn--esp { background: var(--esp); color: var(--foam); }
.btn--line { border-color: var(--esp); background: transparent; }
.btn--line:hover { background: var(--foam); }
.btn--wide { width: 100%; }
.btn__icon { width: 20px; height: 20px; flex-shrink: 0; }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Демо-полоска и шапка ---------- */

.demo-strip {
  padding: 8px var(--gutter);
  background: var(--esp);
  color: rgba(255, 251, 245, 0.82);
  font-size: 12.5px;
  text-align: center;
}

.demo-strip a { color: var(--matcha-light); font-weight: 600; text-underline-offset: 3px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--gutter);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__name { font-family: var(--font-display); font-size: 12px; line-height: 1.2; text-transform: uppercase; }

.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--esp-soft); text-align: right; }
.status__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #8C7A68; }
.status.is-open .status__dot { background: var(--matcha); box-shadow: 0 0 0 3px rgba(62, 107, 47, 0.22); }

/* ---------- Первый экран ---------- */

.hero {
  display: grid;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--gutter) 56px;
}

.eyebrow { font-size: 13px; color: var(--esp-soft); }

.hero__title {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 8.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.hero__lead { max-width: 30em; margin-top: 16px; font-size: 17px; line-height: 1.55; }
.hero__skip { display: inline-block; margin-top: 20px; font-weight: 600; text-underline-offset: 4px; }

/* ---------- Конструктор стакана ---------- */

.builder {
  padding: 20px 16px 16px;
  border-radius: 28px;
  background: var(--foam);
  box-shadow: 0 24px 48px -28px rgba(35, 22, 14, 0.55);
}

.builder__title { margin: 0 0 4px; font-size: 20px; font-weight: 700; text-align: center; }

.builder__cup {
  display: grid;
  justify-items: center;
  margin: 0 -16px 8px;
  padding: 8px 0 12px;
  /* стойка, на которой стоит стакан */
  background: linear-gradient(transparent 82%, rgba(185, 143, 94, 0.18) 82%);
}

.cup { width: 200px; height: auto; overflow: visible; }
.cup.is-added { animation: cup-hop 0.5s ease; }

@keyframes cup-hop {
  30% { transform: translateY(-14px) rotate(-3deg); }
  60% { transform: translateY(0) rotate(1.5deg); }
}

.cup__all { transform-origin: 100px 258px; transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.cup__shadow { fill: rgba(35, 22, 14, 0.14); }
.cup__body { fill: var(--cup); }
.cup__sleeve { fill: var(--kraft-deep); }
.cup__rim, .cup__lid { fill: var(--esp); }
.cup__hole { fill: #4A3526; }
.cup__logo { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.06em; fill: var(--foam); }
.cup__name { font-family: var(--font-hand); font-weight: 700; font-size: 34px; fill: var(--marker); }
.cup__name.is-empty { fill-opacity: 0.32; }
.cup__code { font-family: var(--font-hand); font-weight: 600; font-size: 22px; fill: var(--marker); }

.builder__size { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--esp-soft); }

.opt { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.opt legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 600; color: var(--esp-soft); }
.opt[hidden] { display: none; }
.opt__list { display: flex; flex-wrap: wrap; gap: 6px; }

.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid rgba(35, 22, 14, 0.28);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.chip:hover span { border-color: var(--esp); }
.chip input:checked + span { border-color: var(--esp); background: var(--esp); color: var(--foam); }
.chip input:focus-visible + span { outline: 2px solid var(--matcha); outline-offset: 2px; }

.field { display: block; margin-top: 16px; }
.field__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--esp-soft); }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid rgba(35, 22, 14, 0.28);
  border-radius: var(--radius-sm);
  background: #fff;
}
.field input::placeholder { color: #8C7A68; }
.field input:focus-visible { outline: 2px solid var(--matcha); outline-offset: 1px; border-color: var(--esp); }

.builder__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.5px dashed rgba(35, 22, 14, 0.25);
}
.builder__price { font-family: var(--font-display); font-size: 24px; }
.builder__foot .btn { flex: 1; max-width: 240px; }

/* ---------- Заголовки разделов ---------- */

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 6vw, 40px);
  line-height: 1.1;
  text-transform: uppercase;
}
.section-lead { max-width: 36em; margin-top: 12px; color: var(--esp-soft); }

/* ---------- Меню ---------- */

.menu { max-width: 1200px; margin: 0 auto; padding: 24px var(--gutter) 56px; }
.category { margin-top: 32px; }
.category__title { margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.food { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.food-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--foam);
}
.food-card__photo { width: 104px; height: 104px; border-radius: 14px; object-fit: cover; background: var(--matcha-light); }
.food-card__body { display: flex; flex-direction: column; min-width: 0; }
.food-card__name { font-weight: 700; }
.food-card__desc { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--esp-soft); }
.food-card__row, .cake-card__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }

.add {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--esp);
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.add:hover { background: var(--esp); color: var(--foam); }

.stepper { display: flex; align-items: center; height: 44px; border-radius: 999px; background: var(--matcha); color: #fff; }
.stepper button { width: 40px; height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; border-radius: 999px; }
.stepper button:hover { background: rgba(255, 255, 255, 0.15); }
.stepper__qty { min-width: 20px; text-align: center; font-weight: 700; }

/* ---------- Торты: тёмная полоса, как крышка стакана ---------- */

.cakes {
  padding: 56px var(--gutter);
  background: var(--esp);
  color: var(--foam);
}
.cakes__head, .cakes__list { max-width: 1200px; margin-left: auto; margin-right: auto; }
.cakes .section-lead { color: rgba(255, 251, 245, 0.75); }
.cakes :focus-visible { outline-color: var(--foam); }

.cakes__list { display: grid; gap: 12px; margin-top: 24px; padding: 0; list-style: none; }
.cake-card { overflow: hidden; border-radius: var(--radius); background: var(--foam); color: var(--esp); }
.cake-card__photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.cake-card__body { padding: 14px 16px 16px; }
.cake-card__name { font-weight: 700; font-size: 18px; }
.cake-card__desc { margin-top: 2px; font-size: 14px; color: var(--esp-soft); }

/* ---------- Как нас найти ---------- */

.find { max-width: 1200px; margin: 0 auto; padding: 56px var(--gutter) 48px; }
.find__grid { display: grid; gap: 12px; margin-top: 24px; }
.find__card { padding: 24px; border-radius: var(--radius); background: var(--foam); }
.find__address { font-family: var(--font-display); font-size: 22px; line-height: 1.15; text-transform: uppercase; }
.find__line { margin-top: 8px; color: var(--esp-soft); }
.find__line--hours { color: var(--esp); font-weight: 600; }
.find__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.find__actions .btn { min-height: 48px; padding: 0 18px; font-size: 15px; }
.find__hint { margin-top: 16px; font-size: 13.5px; color: var(--esp-soft); }
.find__rating { display: flex; flex-direction: column; justify-content: center; }
.find__score { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }

/* ---------- Для владельца: это пример ---------- */

.pitch {
  max-width: 1200px;
  margin: 0 auto 64px;
  padding: 32px 24px;
  border: 2px dashed var(--esp);
  border-radius: var(--radius);
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(1200px - 2 * var(--gutter));
}
.pitch__eyebrow { margin-bottom: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--matcha); }
.pitch__list { display: grid; gap: 10px; margin: 20px 0 24px; padding: 0; list-style: none; }
.pitch__list li { position: relative; padding-left: 28px; }
.pitch__list li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; color: var(--matcha); }
.pitch__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pitch__more { font-weight: 600; text-underline-offset: 3px; }
.pitch__who { margin-top: 12px; font-size: 14px; color: var(--esp-soft); }
.pitch__who:empty { display: none; }

/* ---------- Подвал ---------- */

.site-footer { padding: 32px var(--gutter) 112px; border-top: 1px solid rgba(35, 22, 14, 0.2); font-size: 13.5px; color: var(--esp-soft); text-align: center; }
.site-footer__brand { margin-bottom: 4px; font-family: var(--font-display); font-size: 14px; color: var(--esp); }
.site-footer__note { margin-top: 8px; font-size: 12.5px; }
.credits { max-width: 640px; margin: 12px auto 0; font-size: 12px; }
.credits summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.credits ul { margin: 8px 0 0; padding: 0; list-style: none; text-align: left; }
.credits li { margin-top: 4px; }

/* ---------- Полоса заказа и панель ---------- */

.order-bar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(560px, calc(100% - 2 * var(--gutter)));
  min-height: 60px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--esp);
  color: var(--foam);
  font-weight: 600;
  cursor: pointer;
  transform: translateX(-50%);
  box-shadow: 0 16px 32px -12px rgba(35, 22, 14, 0.6);
}
.order-bar[hidden] { display: none; }
.order-bar__total { font-family: var(--font-display); font-size: 18px; }
.order-bar.is-bumped { animation: bump 0.35s ease; }
@keyframes bump { 40% { transform: translateX(-50%) scale(1.04); } }
.order-bar:focus-visible { outline-color: var(--esp); outline-offset: 4px; }

.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(35, 22, 14, 0.5); }
.backdrop[hidden] { display: none; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--foam);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.sheet[hidden] { display: none; }
.sheet.is-open { transform: none; opacity: 1; }

.sheet__head { display: flex; align-items: center; gap: 8px; }
.sheet__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 22px; text-transform: uppercase; }
.sheet__title:focus { outline: none; }
.sheet__close { margin-left: auto; width: 44px; height: 44px; border: 1.5px solid rgba(35, 22, 14, 0.28); border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; }

.lines { margin: 16px 0 0; padding: 0; list-style: none; }
.line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 0;
  border-bottom: 1.5px dashed rgba(35, 22, 14, 0.2);
}
.line__name { grid-column: 1 / -1; font-weight: 500; }
.line__qty { display: flex; align-items: center; gap: 10px; }
.line__qty button { width: 36px; height: 36px; border: 1.5px solid rgba(35, 22, 14, 0.28); border-radius: 50%; background: transparent; font-size: 18px; cursor: pointer; }
.line__sum { font-weight: 700; font-variant-numeric: tabular-nums; }

.total { display: flex; justify-content: space-between; margin-top: 16px; font-weight: 700; font-size: 18px; }
.total span:last-child { font-family: var(--font-display); font-weight: 400; }

.cake-when { margin-top: 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--matcha-light); }
.cake-when[hidden] { display: none; }
.cake-when__note { font-size: 14px; }
.cake-when__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.sheet__closed, .sheet__need { margin-top: 16px; font-size: 14px; }
.sheet__need { font-weight: 600; color: #8A2E14; }
.sheet .btn--wide { margin-top: 16px; min-height: 56px; }
.sheet__hint { margin-top: 8px; font-size: 13px; color: var(--esp-soft); text-align: center; }
.sheet__clear { display: block; margin: 12px auto 0; min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--esp-soft); text-decoration: underline; cursor: pointer; }

/* ---------- Планшет ---------- */

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .food { grid-template-columns: 1fr 1fr; }
  .cakes__list { grid-template-columns: repeat(3, 1fr); }
  .find__grid { grid-template-columns: 1.6fr 1fr; }
  .pitch { padding: 48px; }
}

/* ---------- Компьютер: текст слева, стакан справа ---------- */

@media (min-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 440px;
    align-items: start;
    gap: 64px;
    padding: 32px var(--gutter) 80px;
  }
  /* конструктор высокий — текст остаётся на виду, пока его листают */
  .hero__text { position: sticky; top: 48px; padding-top: 72px; }
  .food { grid-template-columns: repeat(3, 1fr); }
  .food-card { grid-template-columns: 1fr; padding: 0; overflow: hidden; }
  .food-card__photo { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
  .food-card__body { padding: 0 16px 16px; }

  .sheet {
    left: auto;
    top: 0;
    width: 420px;
    max-height: none;
    border-radius: 24px 0 0 24px;
    transform: translateX(24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
