/* ==========================================================================
   RedBeans — стили
   Цвета берутся из config.yaml (переменные --milk, --gray, --graphite, --red)
   ========================================================================== */

:root {
  /* производные оттенки (--milk-2, --line, --muted, --red-dark, --milk-NN)
     рассчитываются из фирменных цветов при сборке и подставляются в <head> */
  --font-head: "Onder", "Montserrat", "Arial Black", system-ui, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* широкие поля слева и справа — контента немного, он не должен «растекаться» */
  --gutter: clamp(20px, 6vw, 112px);
  --maxw: 1200px;
  --radius: 6px;
  --header-h: 84px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--milk);
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;           /* запасной вариант для старых браузеров */
  overflow-x: clip;             /* ничто не может растянуть страницу вбок */
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
.nowrap { white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--graphite); color: var(--milk);
  border-radius: var(--radius); text-decoration: none; transition: top .2s;
}
.skip:focus { top: 12px; }

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

/* ---------------------------------------------------------------- типографика */
.h2, .h3, .hero-title, .logo-text {
  font-family: var(--font-head);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
  /* ONDER — широкий шрифт с высокими буквами: при line-height ~1
     вторая строка заезжала на первую. 1.2 — с запасом. */
  line-height: 1.8;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: manual;
}
.h2 { font-size: clamp(28px, 4.2vw, 30px); margin-bottom: 28px; }
.h3 { font-size: clamp(22px, 2.6vw, 24px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: lowercase;
  color: var(--red);
}
.eyebrow .bean { width: 18px; height: 14px; flex: none; }
.eyebrow-light { color: var(--milk); }
.eyebrow-light .bean { fill: var(--red); }

.bean { fill: var(--red); }

.lead { font-size: clamp(16px, 1.25vw, 18px); color: var(--muted); }
.lead + .lead { margin-top: 16px; }
.lead-first { color: var(--graphite); font-weight: 500; }

/* ---------------------------------------------------------------- кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--red); color: var(--milk); }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border-color: var(--milk-70); color: var(--milk); }
.btn-ghost:hover { background: var(--milk); color: var(--graphite); border-color: var(--milk); }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- шапка */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--milk-92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 30px -22px rgba(0,0,0,.35); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: var(--header-h);
  transition: min-height .3s var(--ease);
}
.site-header.is-scrolled .header-inner { min-height: 66px; }

.logo { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
/* логотип-надпись очень вытянутый (~11:1), поэтому задаём высоту букв, а не картинки целиком */
.logo img { height: 24px; width: auto; max-width: 100%; transition: height .3s var(--ease); }
.site-header.is-scrolled .logo img { height: 20px; }
.logo-header { min-width: 0; flex: 0 1 auto; }
.logo-text { font-size: 30px; }

.header-right, .footer-right {
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); min-width: 0;
}
.contacts { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); }
.contact {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-size: 14px; line-height: 1.3;
}
.contact .ico { color: var(--red); }
.contact b { display: block; font-weight: 700; }
.contact small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.contact .sep { font-style: normal; margin: 0 6px; color: var(--gray); }
a.contact:hover b { color: var(--red); }

.status { font-weight: 500; }
.status::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: var(--gray);
}
.status.is-open { color: #2f6b3a; }
.status.is-open::before { background: #3c9a4f; box-shadow: 0 0 0 3px rgba(60,154,79,.18); }
.status.is-closed { color: var(--red); }
.status.is-closed::before { background: var(--red); }

/* иконки соцсетей */
.socials { display: flex; align-items: center; gap: 10px; flex: none; }
.social {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--graphite); border: 1.5px solid var(--graphite);
  transition: background-color .2s, color .2s, border-color .2s;
}
.social:hover, .social:focus-visible { background: var(--red); border-color: var(--red); color: var(--milk); }
.ico-fill { width: 20px; height: 20px; fill: currentColor; flex: none; }
.social-telegram .ico-fill { margin-left: -2px; }
.social-vk .ico-fill { width: 22px; height: 22px; }

/* по мере сужения экрана в шапке остаётся только главное
   (полные контакты всегда есть в блоке «Как нас найти» и в подвале) */
@media (max-width: 1320px) { .contacts-header .contact:first-child small { display: none; } }
@media (max-width: 1240px) { .contacts-header .contact-phone { display: none; } }
@media (max-width: 960px)  { .contacts-header .contact:first-child { display: none; } }
@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .logo-header img, .site-header.is-scrolled .logo-header img { height: auto; width: min(170px, 42vw); }
  .site-header.is-scrolled .header-inner { min-height: 58px; }
  .contacts-header { gap: 0; }
  .contacts-header .contact:first-child { display: none; }
  .contacts-header .contact .ico { display: none; }
  .contacts-header .contact b { display: none; }
  .contacts-header .contact small { margin: 0; font-size: 13px; }
  .header-right { gap: 12px; }
  .socials-header { gap: 6px; }
  .socials-header .social { width: 34px; height: 34px; border-width: 1px; }
  .socials-header .ico-fill { width: 17px; height: 17px; }
}
@media (max-width: 480px) {
  .contacts-header { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; isolation: isolate;
  min-height: clamp(520px, calc(100vh - var(--header-h)), 860px);
  min-height: clamp(520px, calc(100svh - var(--header-h)), 860px);
  display: flex; align-items: flex-end;
  color: var(--milk);
  overflow: hidden;
  background: var(--graphite);
}
.hero-img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);
  animation: heroZoom 14s var(--ease) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(20,19,18,.15) 0%, rgba(20,19,18,.05) 35%, rgba(20,19,18,.78) 100%),
    linear-gradient(90deg, rgba(20,19,18,.55) 0%, rgba(20,19,18,0) 65%);
}
.hero-content { padding-top: 120px; padding-bottom: clamp(56px, 9vh, 104px); }
.hero-title {
  font-size: clamp(36px, 7vw, 80px);
  max-width: 100%;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 22px; max-width: 46ch;
  font-size: clamp(16px, 1.5vw, 20px); line-height: 1.55;
  color: var(--milk-88);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-scroll {
  position: absolute; right: var(--gutter); bottom: 36px;
  width: 28px; height: 46px; border: 1.5px solid var(--milk-60);
  border-radius: 20px;
}
.hero-scroll span {
  position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--milk);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }
@media (max-width: 720px) { .hero-scroll { display: none; } }

/* ---------------------------------------------------------------- секции */
.section { padding: clamp(80px, 11vw, 150px) 0; }

/* about */
.about-grid {
  display: grid; gap: clamp(40px, 6vw, 96px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) { .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.about-media { position: relative; }
.about-media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius);
}
@media (max-width: 959px) { .about-media img { aspect-ratio: 4 / 3; } }
.about-bean {
  position: absolute; width: 92px; height: 70px; right: -22px; bottom: -26px;
  filter: drop-shadow(0 12px 24px rgba(159,34,32,.25));
}
@media (max-width: 720px) { .about-bean { width: 64px; height: 48px; right: 14px; bottom: -20px; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.tags li {
  padding: 7px 14px; border: 1px solid var(--gray); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: border-color .2s, color .2s;
}
.tags li:hover { border-color: var(--red); color: var(--red); }

/* ---------------------------------------------------------------- меню */
.menu { padding-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); }
.menu-head { padding-bottom: clamp(24px, 3vw, 40px); }
.menu-intro { margin-top: -8px; }
.menu-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.menu-nav a {
  padding: 10px 18px; border-radius: 999px; background: var(--graphite); color: var(--milk);
  font-size: 14px; font-weight: 700; text-decoration: none; transition: background-color .2s;
}
.menu-nav a:hover { background: var(--red); }

.menu-section { padding: clamp(44px, 6vw, 80px) 0; }
.menu-section-alt { background: var(--milk-2); }
.menu-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 30px;
}
.menu-section-title { max-width: 1020px; min-width: 820px; }
.menu-num { display: block; font-weight: 700; font-size: 13px; letter-spacing: .14em; color: var(--red); margin-bottom: 8px; }
.menu-desc { margin-top: 12px; color: var(--muted); }

.slider-controls { display: flex; gap: 10px; flex: none; }
.slider-btn {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--graphite); background: transparent; cursor: pointer;
  transition: background-color .2s, color .2s, opacity .2s, border-color .2s;
}
.slider-btn:hover:not(:disabled) { background: var(--graphite); color: var(--milk); }
.slider-btn:disabled { opacity: .25; cursor: default; }
.slider-controls.is-hidden { display: none; }
@media (max-width: 720px) { .slider-controls { display: none; } }

.slider { position: relative; min-width: 0; }
/* Лента занимает ровно ширину контента (как текст над ней) и никогда
   не выходит за поля страницы. Лишние карточки прокручиваются внутри. */
.slider-track {
  --cols: 4;
  --gap: clamp(14px, 2vw, 24px);
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--gap) * (var(--cols) - 1)) / var(--cols));
  gap: var(--gap);
  width: 100%; max-width: 100%; min-width: 0;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 6px 0 10px;
}
@media (max-width: 1100px) { .slider-track { --cols: 3; } }
@media (max-width: 760px)  { .slider-track { --cols: 2; } }
/* на телефоне видна одна карточка и край следующей — понятно, что можно листать */
@media (max-width: 520px)  { .slider-track { grid-auto-columns: 78%; } }
.slider-track::-webkit-scrollbar { display: none; }
.slider-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.slider-track.is-dragging .card-btn { pointer-events: none; }

.card { scroll-snap-align: start; min-width: 0; }
.card-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.card-media {
  display: block; overflow: hidden; border-radius: var(--radius); background: var(--gray);
  aspect-ratio: 4 / 5;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
  user-select: none; -webkit-user-drag: none;
}
.card-btn:hover .card-media img, .card-btn:focus-visible .card-media img { transform: scale(1.05); }
.card-body { display: block; padding: 16px 2px 0; }
.card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-title { font-weight: 700; font-size: 17px; line-height: 1.3; min-width: 0; overflow-wrap: break-word; }
.card-price { font-weight: 700; color: var(--red); white-space: nowrap; }
.card-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.5;
}

.slider-progress { height: 2px; margin-top: 24px; background: var(--line); border-radius: 2px; overflow: hidden; }
.slider-progress span { display: block; height: 100%; width: 30%; background: var(--red); border-radius: 2px; transform-origin: left; transition: width .2s; }
.slider.no-scroll .slider-progress { display: none; }

/* ---------------------------------------------------------------- визит */
.visit { background: var(--milk); border-top: 1px solid var(--line); }
.visit-head { margin-bottom: clamp(32px, 4vw, 52px); }
.visit-grid {
  display: grid; gap: clamp(20px, 3vw, 32px);
  grid-template-columns: 1fr;
}
@media (min-width: 960px) { .visit-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }

.widget-frame {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--milk-2); border: 1px solid var(--line);
}
.widget-map .widget-frame { height: clamp(340px, 42vw, 480px); }
.widget-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.widget-credit {
  position: absolute; left: 8px; top: 4px; z-index: 1;
  color: #eee; font-size: 12px; text-decoration: none;
}
.widget-credit-2 { top: 18px; }
.widget-credit-3 { top: 32px; }

.widget-frame-reviews { height: 800px; max-height: 80vh; min-height: 560px; background: #fff; }
.widget-reviews-link {
  position: absolute; left: 0; bottom: 8px; width: 100%; padding: 0 16px;
  text-align: center; color: #b3b3b3; font-size: 10px; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: "YS Text", sans-serif;
}

.visit-info {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px;
  margin-top: 22px; padding: 22px 24px;
  background: var(--graphite); color: var(--milk); border-radius: var(--radius);
}
.contacts-visit { flex-wrap: wrap; gap: 18px 28px; }
.contacts-visit .contact small { color: var(--milk-65); }
.contacts-visit .contact .sep { color: var(--milk-40); }
.contacts-visit .status.is-open { color: #8fd49c; }
.contacts-visit .status.is-closed { color: #f19b98; }
.btn-route { min-height: 48px; }

/* ---------------------------------------------------------------- подвал */
.site-footer { background: var(--milk); border-top: 1px solid var(--line); padding-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.logo-footer img { height: 26px; }
@media (max-width: 720px) { .logo-footer img { height: auto; width: min(220px, 60vw); } }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  margin-top: 32px; padding-top: 20px; padding-bottom: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--red); }
.footer-right { flex-wrap: wrap; }
@media (max-width: 720px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-right { flex-direction: column; align-items: flex-start; gap: 20px; }
  .contacts-footer { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ---------------------------------------------------------------- попап */
.lightbox {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 10px;
  background: var(--milk); color: var(--graphite);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.55);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(28,27,26,.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lightbox[open] { animation: lbIn .35s var(--ease); }
@keyframes lbIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
/* minmax(0, …) — колонки не растягиваются под широкое фото или длинное
   слово; текст переносится, а не уезжает вправо */
.lightbox-inner {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
}
.lightbox-media { position: relative; background: var(--graphite); min-height: 320px; min-width: 0; overflow: hidden; }
.lightbox-media img {
  width: 100%; height: 100%;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  object-fit: cover;
}
.lightbox-body {
  min-width: 0;
  padding: clamp(28px, 4vw, 52px);
  padding-right: clamp(28px, 4vw, 60px);
  overflow-x: hidden; overflow-y: auto;
  align-self: center;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
}
.lightbox-body .eyebrow { margin-bottom: 14px; }
.lightbox-body .eyebrow:empty { display: none; }
.lightbox-body .h3 {
  font-size: clamp(10px, 2.2vw, 14px);
  overflow-wrap: anywhere;
  padding-right: 36px; /* не залезать под крестик */
}
.lightbox-price { margin-top: 14px; font-weight: 700; font-size: 20px; color: var(--red); }
.lightbox-price:empty { display: none; }
.lightbox-desc { margin-top: 16px; color: var(--muted); font-size: 16px; overflow-wrap: break-word; }
.lightbox-count { margin-top: 28px; font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.lightbox-close {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--milk); color: var(--graphite);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.lightbox-close:hover { background: var(--red); color: var(--milk); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--milk-88); color: var(--graphite);
  transition: background-color .2s, color .2s;
}
.lightbox-nav:hover { background: var(--red); color: var(--milk); }
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }
.lightbox-nav[hidden] { display: none; }
@media (max-width: 760px) {
  .lightbox-inner { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; overflow-y: auto; }
  .lightbox-media { min-height: 0; }
  .lightbox-media img { aspect-ratio: 1 / 1; height: auto; max-height: 58vh; max-height: 58dvh; }
  .lightbox-body { align-self: start; padding: 24px 22px 28px; max-height: none; overflow: visible; }
  .lightbox-body .h3 { padding-right: 0; }
}
body.lb-open { overflow: hidden; }

/* ---------------------------------------------------------------- появление */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
