/* ============================================================
   ROLL WAY — меню
   ============================================================ */

:root {
  --cream: #f7f1e6;
  --cream-2: #f2eadc;
  --card: #fbf7ef;
  --ink: #1a2a38;
  --ink-2: #5a6b76;
  --red: #c8342b;
  --red-2: #a82820;
  --line: #e2d7c4;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page: clamp(1rem, 4vw, 3.25rem);
  --max: 1180px;
  --r: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* [hidden] мусить перемагати будь-який display у класах */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* щоб заголовки секцій не ховалися під липкою панеллю категорій */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}
p {
  margin: 0;
}

::selection {
  background: var(--red);
  color: #fff;
}

.block {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(2rem, 4.5vw, 3.4rem) var(--page);
}

.grid,
.cats {
  min-width: 0;
}
.card,
.row,
.cat {
  min-width: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.head {
  position: relative;
  z-index: 5;
  padding: clamp(1rem, 2.4vw, 1.6rem) var(--page) 0;
}
.head__in {
  max-width: var(--max);
  margin-inline: auto;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-right: auto;
  min-width: 0;
}
.brand__mark {
  width: clamp(100px,8vw,220px);
  height: auto;
  flex: none;
}
.brand__txt {
  display: flex;
  flex-direction: column;
}
.brand__name {
  font-size: clamp(1.4rem, 3.2vw, 2.05rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand__sub {
  margin-top: 0.3rem;
  font-size: clamp(0.78rem, 1.4vw, 0.98rem);
  font-weight: 500;
  color: var(--ink-2);
}

.head__contact {
  text-align: right;
  flex: none;
}
.phone {
  display: block;
  font-size: clamp(0.95rem, 1.9vw, 1.18rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.2s;
}
.phone:hover {
  color: var(--red);
}
.hours {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  margin-top: 0.2rem;
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
}
.hours svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(0.5rem, 2vw, 1.5rem) var(--page) clamp(1rem, 3vw, 2rem);
  overflow: clip;
}

.hero__in {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: clamp(320px, 38vw, 520px);
}

.hero__copy {
  position: relative;
  z-index: 3;
  max-width: min(46%, 34rem);
}

.hero__title {
  font-size: clamp(1.85rem, 5.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.08;
}
.hero__title span {
  display: block;
}
.hero__title .t2 {
  color: var(--red);
}

.hero__rule {
  width: clamp(80px, 10vw, 120px);
  height: auto;
  margin: clamp(0.9rem, 2vw, 1.5rem) 0;
}
.hero__rule path {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.hero__lede {
  max-width: 38ch;
  font-size: clamp(0.9rem, 1.7vw, 1.02rem);
  color: var(--ink-2);
  font-weight: 500;
}

.hero__shot {
  position: absolute;
  z-index: 1;
  /* прибитий до верху й правого краю вікна, поза padding секції */
  top: 0;
  right: 0;
  width: clamp(340px, 54vw, 1040px);
  margin: 0;
  pointer-events: none;
}
.hero__shot img {
  width: 100%;
  height: auto;
  /* у банера широкі порожні поля — прибираємо їх */
  clip-path: inset(6% 0 4% 4%);
}

/* ============================================================
   SECTION TITLES  — «— КАТЕГОРІЇ —» с линиями
   ============================================================ */
.rule-title {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.6rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
  font-size: clamp(0.95rem, 1.9vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.13em;
  text-align: center;
}
.rule-title::before,
.rule-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.rule-title > span {
  flex: none;
}

/* красные штрихи по бокам заголовка */
.rule-title--mark > span {
  position: relative;
}
.rule-title--mark > span::before,
.rule-title--mark > span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 7px;
  background: var(--red);
  clip-path: polygon(0 45%, 78% 0, 68% 45%, 100% 42%, 22% 100%, 32% 52%);
}
.rule-title--mark > span::before {
  right: 100%;
  margin-right: 0.85rem;
  transform: translateY(-50%);
}
.rule-title--mark > span::after {
  left: 100%;
  margin-left: 0.85rem;
  transform: translateY(-50%) scaleX(-1);
}

@media (max-width: 520px) {
  .rule-title--mark > span::before,
  .rule-title--mark > span::after {
    display: none;
  }
}

/* ============================================================
   КАТЕГОРІЇ
   ============================================================ */
/* заголовок «КАТЕГОРІЇ» — без нижнего отступа, панель идёт сразу за ним */
.cats-head {
  padding-bottom: 0;
}
.cats-head .rule-title {
  margin-bottom: 0;
}

/* Обгортка тримає висоту розгорнутої панелі. Без неї стиснення
   вкорочувало сторінку, маркер повертався в кадр і панель дрижала. */
.cats-wrap {
  position: relative;
}

.cats-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  pointer-events: none;
}

/* липкая панель категорий */
.cats-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* сжатое состояние — навешивается из JS */
.cats-bar.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 18px rgba(26, 42, 56, 0.07);
}

.cats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.6rem, 2vw, 1.4rem);
  padding-block: clamp(1.1rem, 2.4vw, 1.8rem);
  transition: padding-block 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-stuck .cats {
  padding-block: 0.5rem;
}
@media (max-width: 860px) {
  .cats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem;
  border-radius: var(--r);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cat:hover {
  transform: translateY(-5px);
}

.cat__ph {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 118px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  overflow: hidden;
  transition:
    border-color 0.28s,
    box-shadow 0.28s;
}
.cat:hover .cat__ph {
  border-color: var(--red);
  box-shadow: 0 10px 22px rgba(200, 52, 43, 0.16);
}
.cat__ph img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}
.cat__name {
  font-size: clamp(0.68rem, 1.4vw, 0.82rem);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-align: center;
  transition: font-size 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- сжатый вид липкой панели ---- */
.is-stuck .cat {
  flex-direction: row;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.25rem;
}
.is-stuck .cat__ph {
  width: clamp(30px, 4.4vw, 40px);
  max-width: none;
}
.is-stuck .cat__name {
  font-size: clamp(0.6rem, 1.1vw, 0.7rem);
}
.is-stuck .cat:hover {
  transform: none;
}

/* на узких экранах в сжатом виде круги лишние — оставляем только подписи */
@media (max-width: 700px) {
  .is-stuck .cat__ph {
    display: none;
  }
  .is-stuck .cat {
    padding: 0.4rem 0.2rem;
  }
}

/* ============================================================
   GRIDS
   ============================================================ */
.grid {
  display: grid;
  gap: clamp(0.7rem, 1.6vw, 1.15rem);
}
.grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1000px) {
  .grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .grid--5,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- карточка товара ---- */
.card {
  display: flex;
  flex-direction: column;
  padding: clamp(0.55rem, 1.2vw, 0.8rem);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.28s,
    border-color 0.28s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: #d6c6ac;
  box-shadow: 0 16px 30px rgba(26, 42, 56, 0.13);
}

.card__ph {
  position: relative;
  aspect-ratio: 4/3;
  margin-bottom: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream-2);
}
.card__ph img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card__ph img {
  transform: scale(1.06);
}

.card__name {
  font-size: clamp(0.82rem, 1.5vw, 0.95rem);
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-bottom: 0.3rem;
}
.card__gram {
  font-size: clamp(0.74rem, 1.3vw, 0.84rem);
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 0.55rem;
}
.card__price {
  margin-top: auto;
  font-size: clamp(1rem, 1.9vw, 1.2rem);
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.01em;
}

/* ---- горизонтальная карточка (напої / соуси) ---- */
.grid--row {
  gap: clamp(0.8rem, 2vw, 1.6rem);
}

.row {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
  padding: 0.5rem;
  border-radius: var(--r);
  transition: background 0.25s;
}
.row:hover {
  background: var(--card);
}

.row__ph {
  flex: none;
  width: clamp(58px, 7.5vw, 86px);
  aspect-ratio: 3/4;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.row__ph img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.row:hover .row__ph img {
  transform: scale(1.07);
}

.row__txt {
  min-width: 0;
}
.row .card__name {
  margin-bottom: 0.22rem;
}
.row .card__gram {
  margin-bottom: 0.32rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  background: var(--cream-2);
  padding: clamp(1rem, 2.4vw, 1.5rem) var(--page);
}
.foot__in {
  max-width: var(--max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.foot__mark {
  width: 34px;
  height: auto;
  flex: none;
}
.foot__copy {
  margin-right: auto;
  font-size: clamp(0.76rem, 1.4vw, 0.88rem);
  color: var(--ink-2);
  font-weight: 500;
}

.foot__soc {
  display: flex;
  gap: 0.55rem;
  flex: none;
}
.foot__soc a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  transition:
    background 0.25s,
    border-color 0.25s,
    color 0.25s,
    transform 0.25s;
}
.foot__soc a:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-2px);
}
.foot__soc svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   FAB — «Замовити» (мобильный)
   ============================================================ */
.fab {
  position: fixed;
  z-index: 30;
  right: clamp(0.8rem, 3vw, 1.4rem);
  bottom: clamp(0.8rem, 3vw, 1.4rem);
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  background: var(--red);
  color: #fff;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(200, 52, 43, 0.36);
  transition:
    background 0.25s,
    transform 0.25s;
}
.fab:hover {
  background: var(--red-2);
}
.fab:active {
  transform: scale(0.97);
}
.fab svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: none;
}
@media (max-width: 720px) {
  .fab {
    display: inline-flex;
  }
}

/* ============================================================
   RESPONSIVE — HERO
   ============================================================ */
@media (max-width: 820px) {
  .hero__in {
    min-height: 0;
    gap: clamp(1rem, 3vw, 1.6rem);
  }
  /* повертаємо банер у потік — поверх тексту він нечитабельний */
  .hero__shot {
    position: static;
    order: -1;
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
  }
  .hero__shot img {
    clip-path: inset(6% 0 4% 4%);
  }
  .hero__copy {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .head__in {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
  .head__contact {
    text-align: left;
  }
  .hours {
    justify-content: flex-start;
  }
  .foot__in {
    flex-wrap: wrap;
  }
  .foot__copy {
    order: 3;
    width: 100%;
  }
}

/* ============================================================
   ЗАГЛУШКИ (поки немає фото в assets/)
   ============================================================ */
/* ============================================================
   ПРЕЛОАДЕР
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.6rem;
  background: var(--cream);
  transition: opacity 0.45s ease, visibility 0.45s;
}
.loader__mark img {
  width: clamp(72px, 11vw, 100px);
  height: auto;
  animation: breathe 1.9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.94); opacity: 0.72; }
}

.loader__bar {
  width: clamp(120px, 22vw, 180px);
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.loader__bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  animation: slide 1.15s cubic-bezier(0.6, 0.05, 0.35, 0.95) infinite;
}
@keyframes slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* прибираємо прелоадер, коли все готове */
.is-ready .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* контент показуємо тільки готовим — без стрибків */
.loading > body > *:not(.loader) {
  opacity: 0;
}
.is-ready > body > *:not(.loader) {
  opacity: 1;
  transition: opacity 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .loader__mark img,
  .loader__bar i { animation: none; }
  .loader { transition: none; }
}

/* ============================================================
   АКЦІЯ
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  background: var(--red);
  color: #fff;
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.card__ph .badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(200, 52, 43, 0.3);
}
.card__old {
  margin-left: 0.45rem;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration-thickness: 1px;
}

/* у рядкових картках бейдж стоїть біля ціни */
.row .card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.row .card__old { margin-left: 0; }
.row .badge { align-self: center; }

/* ============================================================
   ПОПАП СТРАВИ
   ============================================================ */
.card,
.row {
  cursor: pointer;
}
.card:focus-visible,
.row:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.dish {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 3vw, 1.5rem);
}
.dish__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 42, 56, 0.5);
  backdrop-filter: blur(3px);
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; } }

.dish__box {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 26px 60px rgba(26, 42, 56, 0.32);
  animation: dishIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* на широких екранах — фото злива, текст справа */
@media (min-width: 720px) {
  .dish__box:has(.dish__ph:not(:empty)) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .dish__box:has(.dish__ph:not(:empty)) .dish__ph {
    height: 100%;
    aspect-ratio: auto;
    border-radius: 20px 0 0 20px;
  }
  .dish__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
@keyframes dishIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

.dish__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(247, 241, 230, 0.92);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.dish__close:hover { background: var(--red); color: #fff; }

.dish__ph {
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--cream-2);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}
.dish__ph img { width: 100%; height: 100%; object-fit: cover; }
.dish__ph:empty { display: none; }

.dish__body { padding: clamp(1.1rem, 3vw, 1.6rem); }

/* у flex-колонці бейдж не мусить розтягуватись на всю ширину */
.dish__body .badge { align-self: flex-start; }

.dish__name {
  font-size: clamp(1.25rem, 3.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-top: 0.5rem;
}
.dish__gram {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}
.dish__text {
  margin-top: 0.9rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.dish__text:empty { display: none; }

.dish__foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.dish__price {
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  font-weight: 800;
  color: var(--red);
  margin-right: auto;
}
.dish__price .card__old { font-size: 0.62em; }

.btn-order {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  background: var(--red);
  color: #fff;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
}
.btn-order:hover { background: var(--red-2); transform: translateY(-1px); }
.btn-order svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex: none;
}

/* повідомлення, якщо меню не завантажилось */
.menu-error {
  text-align: center;
  color: var(--ink-2);
  font-weight: 600;
  padding-block: clamp(3rem, 8vw, 5rem);
}

/* немає фото — просто спокійний фон, без рамок і підписів */
.is-empty {
  background: var(--cream-2);
}
.cat__ph.is-empty {
  border-radius: 50%;
}
.hero__shot.is-empty {
  aspect-ratio: 4/3;
  border-radius: var(--r);
}
.hero__shot.is-empty::after {
  font-size: 0.85rem;
}

.is-missing {
  display: none;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .fab {
    display: none;
  }
  body {
    background: #fff;
  }
  .card {
    break-inside: avoid;
  }
}
