/* Сайт Qatty Tätti. Меню — из web-menu/menu.css (токены из ios-menu Tokens.swift), дальше — страницы заказа. */

@font-face { font-family: Onest; src: url(/menu/fonts/onest_regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Onest; src: url(/menu/fonts/onest_medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: Onest; src: url(/menu/fonts/onest_semibold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: Onest; src: url(/menu/fonts/onest_bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Onest; src: url(/menu/fonts/onest_extrabold.ttf); font-weight: 800; font-display: swap; }
@font-face { font-family: Unbounded; src: url(/menu/fonts/unbounded_semibold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: Unbounded; src: url(/menu/fonts/unbounded_bold.ttf); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --ink: #1B1F12;
  --green: #465325;
  --green-deep: #2E3818;
  --green-black: #22290F;
  --lime: #C6E85B;
  --lime-hover: #D5F075;
  --white: #FFFFFF;
  --white-soft: rgba(255, 255, 255, .70);
  --white-faint: rgba(255, 255, 255, .12);
  --glass: rgba(255, 255, 255, .14);
  --glass-strong: rgba(255, 255, 255, .24);
  --stripe-dark: #DDE2C8;
  --stripe-light: #E8EBD8;
  --radius-tile: 22px;
  --screen: 20px;
  --head: Unbounded, "Segoe UI", system-ui, sans-serif;
  --body: Onest, "Segoe UI", system-ui, sans-serif;
  --tile: 78px;
  --peak: 1.34;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--green-black);
  color: var(--white);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
img, video { display: block; }

.brand { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: -.03em; }
.caps { font-weight: 700; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; }
.hit {
  display: inline-block; align-self: flex-start;
  background: var(--lime); color: var(--ink);
  font-weight: 700; font-size: 10px; letter-spacing: 1.1px;
  padding: 4px 10px; border-radius: 999px;
}
.pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--white-faint);
  white-space: nowrap;
}
.pill small { font-weight: 500; font-size: 13px; color: var(--white-soft); }
.pill b { font-weight: 700; font-size: 14px; }

/* полосатая заглушка, если у товара нет ни фото, ни ролика */
.striped {
  background: repeating-linear-gradient(45deg, var(--stripe-dark) 0 9px, var(--stripe-light) 9px 18px);
}

/* медиа: фото снизу, ролик поверх него проявляется, когда пошёл */
.media { position: relative; overflow: hidden; background: var(--green); }
.media > img, .media > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.media > video { opacity: 0; transition: opacity .35s ease; }
.media > video.playing { opacity: 1; }

/* галерея карточки: слайды фото/видео со свайпом, точки снизу, стрелки — на ноутбуке */
.gal { position: absolute; inset: 0; overflow: hidden; background: var(--green); }
.gal-track {
  display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.gal-slide > img, .gal-slide > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gal-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gal-dots button {
  pointer-events: auto; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(255,255,255,.55); box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: width .2s ease, background .2s ease;
}
.gal-dots button.on { width: 22px; background: #fff; }
.gal-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); display: none;
  width: 42px; height: 42px; border-radius: 50%; place-items: center;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.2); color: #fff; font-size: 26px; line-height: 1;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: opacity .2s;
}
.gal-arrow.prev { left: 14px; }
.gal-arrow.next { right: 14px; }
.gal-arrow:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .gal:not(.single) .gal-arrow { display: grid; } }

/* ═══════════════════ ТЕЛЕФОН: как iOS-приложение ═══════════════════ */

.m { position: fixed; inset: 0; overflow: hidden; }

.m-stage { position: absolute; inset: 0; transition: opacity .35s ease, transform .35s ease; }
.m-stage.leaving { opacity: 0; transform: scale(1.04); }

.pager {
  position: absolute; inset: 0;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pager::-webkit-scrollbar { display: none; }
.page { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.page > .media { position: absolute; inset: 0; }
/* фото в ленте телефона — целиком (4:3 на высоком экране иначе режется и товар «в упор»):
   чуть увеличенное фото в верхней части, под ним размытая копия того же фото вместо полос */
.page.photo::before {
  content: ""; position: absolute; inset: -60px;
  background: var(--bg) center / cover no-repeat;
  filter: blur(32px) brightness(.82) saturate(1.1);
}
.page.photo > .media { background: transparent; }
/* своё вертикальное фото для телефона — просто на весь экран */
.page.photo.tall::before { content: none; }
.page.photo.tall > .media > img { object-fit: cover; object-position: 50% 35%; transform: none; -webkit-mask-image: none; mask-image: none; }
.page.photo > .media > img {
  object-fit: contain; object-position: 50% 34%; transform: scale(1.16); transform-origin: 50% 34%;
  /* края фото растворяются в размытом фоне — без видимых полос сверху и снизу */
  -webkit-mask-image: linear-gradient(to bottom, transparent 16%, #000 27%, #000 47%, transparent 62%);
  mask-image: linear-gradient(to bottom, transparent 16%, #000 27%, #000 47%, transparent 62%);
}
.page::after {
  /* градиенты под шапку и подпись */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 160px),
    linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.45) 210px, rgba(0,0,0,0) 380px);
}

/* Ken Burns — медленный наезд камеры на фото активной страницы */
@keyframes kenburns {
  from { transform: scale(1) translate(10px, -8px); }
  to   { transform: scale(1.14) translate(-14px, 10px); }
}
.page.active.photo > img { animation: kenburns 9s ease-in-out infinite alternate; }

.m-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) var(--screen) 0;
  pointer-events: none;
}
.chip {
  background: var(--lime); color: var(--ink);
  padding: 7px 12px; border-radius: 999px;
  animation: pop .3s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.9); } }

.m-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding-bottom: calc(env(safe-area-inset-bottom) + 4px);
  pointer-events: none;
}

.m-info { position: relative; padding: 0 var(--screen); min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.m-info-inner { display: flex; flex-direction: column; gap: 8px; animation: rise .4s cubic-bezier(.2,.9,.3,1.15); }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.m-info h1 {
  margin: 0; font-family: var(--head); font-weight: 700;
  font-size: clamp(22px, 7.6vw, 30px); letter-spacing: -.03em; line-height: 1.12;
}
.m-info p { margin: 0; font-size: 15px; color: var(--white-soft); line-height: 1.35; }
.m-info .sizes { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.more {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px; height: 34px;
  padding: 0 10px 0 12px; border-radius: 999px;
  background: var(--glass); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font-weight: 600; font-size: 13px;
}
.more:active { transform: scale(.97); }

.counter {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 12px; color: var(--white-soft); font-variant-numeric: tabular-nums;
}
.dots { display: flex; gap: 4px; }
.dots i { width: 5px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.35); transition: width .25s, background .25s; }
.dots i.on { width: 14px; background: var(--lime); }

/* рулетка категорий */
.roulette {
  pointer-events: auto;
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
  padding: calc(var(--tile) * (var(--peak) - 1) + 8px) calc(50% - var(--tile) / 2) 8px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  perspective: 600px;
  margin-top: 8px;
}
.roulette::-webkit-scrollbar { display: none; }
.tile {
  flex: 0 0 var(--tile); width: var(--tile);
  scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}
.tile .media {
  width: var(--tile); height: var(--tile); border-radius: var(--radius-tile);
  box-shadow: 0 6px 12px rgba(0,0,0,.25);
  outline: 1px solid var(--white-faint); outline-offset: -1px;
  transition: box-shadow .3s, outline-color .3s;
}
.tile span {
  width: calc(var(--tile) + 10px); text-align: center;
  font-weight: 500; font-size: 11px; color: var(--white-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile.on .media { outline: 3px solid var(--lime); outline-offset: -3px; box-shadow: 0 6px 28px rgba(0,0,0,.45); }
.tile.on span { color: var(--lime); font-weight: 700; }

/* ═══════════════════ НОУТБУК: категории слева, большие карточки справа ═══════════════════ */

.d { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }

.d-side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 28px 18px 20px 24px;
  border-right: 1px solid var(--white-faint);
  background: var(--green-black);
}
.d-side .brand { font-size: 22px; }
.d-side .sub { margin: 4px 0 22px; color: var(--white-soft); font-size: 14px; }
.d-nav { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: none; margin-right: -8px; padding-right: 8px; }
.d-cat {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px;
  flex: none; padding: 10px 12px 10px 10px; border-radius: 20px;
  background: none; border: 1px solid transparent; text-align: left;
  transition: background .2s, border-color .2s;
}
.d-cat:hover { background: var(--white-faint); }
.d-cat .media { width: 64px; height: 64px; border-radius: 16px; }
.d-cat b { font-weight: 600; font-size: 15px; line-height: 1.2; }
.d-cat small { font-weight: 600; font-size: 12px; color: var(--white-soft); font-variant-numeric: tabular-nums; }
.d-cat.on { background: var(--green-deep); border-color: var(--lime); }
.d-cat.on b { color: var(--lime); }
.d-cat.on .media { outline: 2px solid var(--lime); outline-offset: -2px; }

.d-main { padding: 28px 40px 80px; min-width: 0; }
.d-sec { scroll-margin-top: 24px; padding-bottom: 40px; }
.d-sec h2 {
  margin: 0 0 20px; font-family: var(--head); font-weight: 700;
  font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -.05em; line-height: 1;
}
.d-sec h2 small { font-family: var(--body); font-weight: 600; font-size: 14px; letter-spacing: 0; color: var(--white-soft); margin-left: 12px; vertical-align: middle; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* тематическая подборка («Осень»): иллюстрация во всю ширину, заголовок слева на спокойной части */
.d-banner { position: relative; margin: 0 0 20px; border-radius: 20px; overflow: hidden; height: clamp(150px, 16vw, 220px); background: var(--green-deep); }
.d-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 55%; }
.d-banner div {
  position: absolute; inset: 0 55% 0 0; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 0 clamp(20px, 4vw, 56px); background: linear-gradient(90deg, rgba(20, 14, 6, .62), rgba(20, 14, 6, 0));
}
.d-banner b { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 2.4vw, 36px); letter-spacing: -.04em; line-height: 1.02; color: #FFF6E6; }
.d-banner span { font-size: 15px; line-height: 1.4; color: rgba(255, 246, 230, .88); max-width: 34ch; }

.card {
  display: flex; flex-direction: column; text-align: left;
  background: var(--green-deep); border: 1px solid var(--white-faint); border-radius: 26px;
  padding: 0; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(198,232,91,.5); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.card:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.card .media { aspect-ratio: 4 / 5; }
.card .media > img { transition: transform .6s ease; }
.card:hover .media > img { transform: scale(1.05); }
.card .badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; }
.card .play {
  position: absolute; right: 14px; top: 14px;
  background: rgba(0,0,0,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 999px; padding: 5px 10px; font-weight: 600; font-size: 12px;
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.card-body h3 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 19px; letter-spacing: -.03em; line-height: 1.2; }
.card-body p { margin: 0; color: var(--white-soft); font-size: 14px; line-height: 1.35; }
.card-body .sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.card-body .pill { padding: 6px 10px; }
.card-body .pill small { font-size: 12px; }
.card-body .pill b { font-size: 13px; }

/* ═══════════════════ карточка товара ═══════════════════ */

.sheet { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8,10,4,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  width: min(1080px, calc(100vw - 64px)); height: min(720px, calc(100vh - 64px));
  background: var(--green-deep); border-radius: 30px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: sheetIn .4s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(40px) scale(.97); } }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 16px;
}
.sheet-media { position: relative; }
.sheet-media .media { position: absolute; inset: 0; }
.sheet-body { overflow-y: auto; padding: 36px 32px 32px; display: flex; flex-direction: column; gap: 12px; }
.sheet-body h2 { margin: 0; font-family: var(--head); font-weight: 700; font-size: 34px; letter-spacing: -.04em; line-height: 1.08; padding-right: 36px; }
.sheet-body > p { margin: 0; color: var(--white-soft); font-size: 16px; line-height: 1.45; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--white-soft); font-size: 13px; font-weight: 600; }
.sizes-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.size {
  display: flex; flex-direction: column; gap: 2px; min-width: 110px;
  padding: 12px 16px; border-radius: 18px; text-align: left;
  background: var(--glass); border: 1px solid var(--white-faint);
  transition: background .2s, border-color .2s;
}
.size small { color: var(--white-soft); font-size: 13px; font-weight: 500; }
.size b { font-size: 17px; font-weight: 700; }
.size.on { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.size.on small { color: rgba(27,31,18,.65); }
.block-title { margin: 14px 0 0; color: var(--white-soft); }
.kbju { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kbju div { background: var(--glass); border-radius: 16px; padding: 10px 12px; }
.kbju b { display: block; font-size: 18px; font-weight: 700; }
.kbju small { color: var(--white-soft); font-size: 12px; }
.ingredients { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ingredients li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--white-faint); font-size: 15px; }
.ingredients li span { color: var(--white-soft); }

/* на телефоне карточка — на весь экран: ролик сверху, текст снизу */
@media (max-width: 899px) {
  .sheet { place-items: stretch; }
  .sheet-card {
    width: 100vw; height: 100dvh; border-radius: 0;
    grid-template-columns: 1fr; grid-template-rows: 58dvh auto;
    overflow-y: auto;
    animation-name: sheetUp;
  }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .sheet-close { position: fixed; top: calc(env(safe-area-inset-top) + 12px); right: 16px; }
  .sheet-media { position: sticky; top: 0; }
  .sheet-body {
    position: relative; overflow: visible;
    margin-top: -28px; border-radius: 28px 28px 0 0; background: var(--green-deep);
    padding: 24px var(--screen) calc(env(safe-area-inset-bottom) + 28px);
  }
  .sheet-body h2 { font-size: 28px; }
}

.empty { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 20px; gap: 8px; }
.empty h1 { font-family: var(--head); margin: 0; font-size: 22px; }
.empty p { margin: 0; color: var(--white-soft); }

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