/* ==========================================================
   Кофейня «Зерно» — стили
   ========================================================== */

:root {
  /* Палитра */
  --bg: #F6EFE4;          /* основной фон — светлый беж */
  --bg-alt: #EFE3D1;      /* фон чередующихся секций */
  --surface: #FBF7F1;     /* карточки */
  --text: #3A281D;        /* основной текст — тёмный кофе */
  --muted: #7C6555;       /* второстепенный текст */
  --accent: #A8683C;      /* карамель — кнопки, акценты */
  --accent-dark: #8A5230;
  --dark: #3A281D;        /* тёмные блоки и футер */
  --line: #DCCBB4;
  --open: #5E8A4F;
  --closed: #B5543A;

  /* Типографика */
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Размеры */
  --container: 1160px;
  --gutter: 20px;
  --radius: 22px;
  --radius-sm: 14px;
  --section-y: clamp(80px, 12vw, 150px);
  --header-h: 72px;
  --shadow: 0 18px 40px -22px rgba(58, 40, 29, .35);
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

img, iframe { display: block; max-width: 100%; }

a { color: inherit; }

h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 600; }

p { margin: 0 0 1em; }

ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted { color: var(--muted); }

.eyebrow {
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 30px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--small { min-height: 44px; padding: 0 22px; font-size: 15px; }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: transparent; color: var(--accent-dark); border-color: var(--accent); }

.btn--light { background: var(--bg); border-color: var(--bg); color: var(--dark); }
.btn--light:hover { background: #fff; border-color: #fff; }

.btn--outline-light { background: transparent; border-color: rgba(246, 239, 228, .45); color: var(--bg); }
.btn--outline-light:hover { background: transparent; border-color: var(--bg); }

/* ---------- Фото ---------- */
.ph {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  /* тёплый фон, пока фото грузится */
  background: linear-gradient(145deg, #D9BE9C 0%, #B98E66 55%, #8C6343 100%);
}

/* ---------- Плашка концепта ---------- */
.concept-bar {
  padding: 8px var(--gutter);
  background: var(--dark);
  color: rgba(246, 239, 228, .82);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .02em;
  text-align: center;
}

/* ---------- Подсказка для ненастоящих контактов ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent-dark); /* заметно и на светлом, и на тёмном фоне */
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 239, 228, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow .25s;
}
.header.is-scrolled { box-shadow: 0 1px 0 var(--line); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.logo__icon { width: 28px; height: 28px; color: var(--accent); }
.logo--light { color: var(--bg); }
.logo--light .logo__icon { color: #D9B48C; }

.nav { display: flex; align-items: center; gap: 34px; }

.nav__link {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.nav__link:hover::after { transform: scaleX(1); }

.burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform .25s, opacity .25s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: clamp(64px, 9vw, 120px) 0;
  overflow: hidden;
  background: var(--dark); /* пока фото грузится */
  color: var(--bg);
}

/* фоновое фото */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% center;
}

/* затемнение: плотнее слева, где текст, и снизу */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(36, 24, 16, .88) 0%, rgba(36, 24, 16, .7) 45%, rgba(36, 24, 16, .35) 100%),
    linear-gradient(0deg, rgba(36, 24, 16, .5) 0%, transparent 40%);
}

.hero__text { max-width: 720px; }

.hero .eyebrow { color: #E2B88C; }

.hero__title {
  font-family: var(--font-head);
  font-size: clamp(42px, 6.4vw, 88px);
  letter-spacing: -.015em;
  margin-bottom: 28px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .25);
}

.hero__lead {
  max-width: 30em;
  margin-bottom: 40px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: rgba(246, 239, 228, .88);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__status { margin: 32px 0 0; }

/* статус на тёмном фоне — светлее, чтобы читался */
.hero [data-status] { color: rgba(246, 239, 228, .8); }
.hero [data-status].is-open { color: #B5DCA6; }
.hero [data-status].is-open .status-dot { background: #8CC77A; box-shadow: 0 0 0 4px rgba(140, 199, 122, .25); }
.hero [data-status].is-closed { color: #F2B39E; }
.hero [data-status].is-closed .status-dot { background: #E58B6E; }

/* статус «открыто/закрыто» */
[data-status] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}
[data-status].is-open .status-dot { background: var(--open); box-shadow: 0 0 0 4px rgba(94, 138, 79, .18); }
[data-status].is-open { color: var(--open); }
[data-status].is-closed .status-dot { background: var(--closed); }
[data-status].is-closed { color: var(--closed); }

/* ---------- Секции ---------- */
.section { padding: var(--section-y) 0; }

.section__head { max-width: 640px; margin-bottom: 56px; }

.section__title {
  font-family: var(--font-head);
  font-size: clamp(34px, 4.6vw, 58px);
  letter-spacing: -.01em;
  margin-bottom: 24px;
}

.section__lead { color: var(--muted); font-size: 18px; margin: 0; }

/* ---------- О нас ---------- */
.about { background: var(--bg-alt); }

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(48px, 7vw, 100px);
}

.about__media { position: relative; padding-bottom: 60px; padding-right: 60px; }
.ph--tall { aspect-ratio: 4 / 5; }
.ph--small {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  aspect-ratio: 1;
  border: 8px solid var(--bg-alt);
  box-shadow: var(--shadow);
}

.about__text > p { color: var(--muted); font-size: 18px; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
.feature__num {
  display: block;
  font-family: var(--font-head);
  font-size: 52px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 10px;
}
.feature__text { font-size: 15px; line-height: 1.45; color: var(--muted); }

/* ---------- Меню ---------- */
.menu__tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.menu__tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 500 15px/1 var(--font-body);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.tab:hover { border-color: var(--accent); }
.tab.is-active { background: var(--dark); border-color: var(--dark); color: var(--bg); }

.menu__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 72px;
}

.menu-item {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  animation: fade-in .35s ease;
}
.menu-item[hidden] { display: none; }

.menu-item__row { display: flex; align-items: baseline; gap: 12px; }
.menu-item__name { font-family: var(--font-head); font-size: 24px; font-weight: 600; }
.menu-item__dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-5px); min-width: 20px; }
.menu-item__price { font-weight: 700; font-size: 18px; color: var(--accent-dark); white-space: nowrap; }
.menu-item__desc { margin: 6px 0 0; font-size: 15px; color: var(--muted); }

@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

/* Блок «закажите заранее» */
.takeaway {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 72px;
  padding: clamp(32px, 5vw, 56px);
  border-radius: var(--radius);
  background: var(--dark);
  color: var(--bg);
}
.takeaway__title { font-family: var(--font-head); font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }
.takeaway p { margin: 0; color: rgba(246, 239, 228, .75); max-width: 32em; }
.takeaway__actions { display: flex; flex-wrap: wrap; gap: 12px; flex-shrink: 0; }

/* ---------- Отзывы ---------- */
.reviews { background: var(--bg-alt); }

.reviews__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.review {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 36px 32px;
  border-radius: var(--radius);
  background: var(--surface);
}
.review__stars { color: var(--accent); letter-spacing: 3px; margin-bottom: 18px; }
.review__text { flex: 1; margin: 0 0 28px; font-size: 17px; line-height: 1.65; }
.review__author { display: flex; align-items: center; gap: 14px; line-height: 1.35; }
.review__author small { color: var(--muted); font-size: 14px; }

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #E3CDB0;
  color: var(--accent-dark);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
}

/* ---------- Контакты ---------- */
.contacts__inner {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: stretch;
}

.contacts__block { margin-bottom: 32px; }
.contacts__label {
  margin-bottom: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.contacts__address { font-size: 22px; line-height: 1.45; margin: 0; }
.contacts__address .muted { font-size: 16px; }

.hours { margin-bottom: 16px; }
.hours__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.hours__row span:last-child { font-weight: 600; white-space: nowrap; }
.hours__row.is-today { color: var(--accent-dark); }
.hours__row.is-today span:first-child::after { content: " · сегодня"; font-size: 14px; color: var(--muted); }

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

.contacts__map {
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}
.contacts__map iframe {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  filter: sepia(.25) saturate(.9);
}

/* ---------- Футер ---------- */
.footer {
  background: var(--dark);
  color: rgba(246, 239, 228, .8);
  padding: 80px 0 32px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(246, 239, 228, .14);
}

.footer__tagline { margin-top: 16px; max-width: 18em; }

.footer__title {
  margin-bottom: 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #D9B48C;
}

.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
/* кнопки-заглушки в футере выглядят как ссылки */
button.footer__link,
button.social {
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}
button.footer__link { border: 0; color: inherit; text-align: left; }

.footer__link { text-decoration: none; transition: color .2s; }
.footer__link:hover { color: #fff; }
.footer__muted { margin: 0; color: rgba(246, 239, 228, .55); }

.socials { display: flex; gap: 12px; }
.social {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 228, .25);
  color: var(--bg);
  transition: background-color .2s, color .2s, border-color .2s;
}
.social svg { width: 22px; height: 22px; }
.social:hover { background: var(--bg); color: var(--dark); border-color: var(--bg); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  font-size: 14px;
  color: rgba(246, 239, 228, .55);
}
.footer__bottom p { margin: 0; }
.footer__credits a { color: inherit; transition: color .2s; }
.footer__credits a:hover { color: var(--bg); }

/* ---------- Анимация появления ---------- */
/* прячем блоки только если JS загрузился — иначе контент виден сразу */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s 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; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================
   Адаптив
   ========================================================== */

@media (max-width: 1024px) {
  .nav { gap: 24px; }
  .menu__list { column-gap: 48px; }
  .reviews__list { grid-template-columns: 1fr 1fr; }
  .reviews__list .review:last-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --header-h: 64px; }

  /* Мобильное меню */
  .burger { display: block; position: relative; z-index: 2; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0; /* от шапки: backdrop-filter делает её точкой отсчёта */
    height: calc(100dvh - var(--nav-top, var(--header-h)));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 24px var(--gutter) 40px;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__link {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-head);
    font-size: 28px;
  }
  .nav__link::after { display: none; }
  .nav__cta { margin-top: 32px; min-height: 56px; font-size: 16px; }

  .about__inner,
  .contacts__inner { grid-template-columns: 1fr; }

  /* текст на всю ширину — затемнение ровнее */
  .hero::before {
    background:
      linear-gradient(180deg, rgba(36, 24, 16, .6) 0%, rgba(36, 24, 16, .78) 55%, rgba(36, 24, 16, .9) 100%);
  }

  .about__media { max-width: 520px; }

  .menu__list { grid-template-columns: 1fr; }

  .takeaway { flex-direction: column; align-items: flex-start; }

  .contacts__map, .contacts__map iframe { min-height: 340px; }

  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }

  .hero { padding: 56px 0 48px; }
  .hero__actions .btn { flex: 1 1 100%; }

  .section__head { margin-bottom: 40px; }

  .about__media { padding-right: 32px; padding-bottom: 40px; }
  .ph--small { border-width: 6px; }

  .features { grid-template-columns: 1fr; gap: 0; }
  .feature {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
  }
  .feature + .feature { border-top: 1px solid var(--line); }
  .feature__num { width: 48px; margin: 0; font-size: 42px; flex-shrink: 0; }

  .menu__tabs { flex-wrap: wrap; gap: 8px; }
  .tab { padding: 0 16px; font-size: 14px; }

  .menu-item__name { font-size: 21px; }

  .takeaway__actions { width: 100%; }
  .takeaway__actions .btn { flex: 1; }

  /* Отзывы — горизонтальная лента со свайпом */
  .reviews__list {
    display: flex;
    gap: 14px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .reviews__list::-webkit-scrollbar { display: none; }
  .review {
    flex: 0 0 86%;
    scroll-snap-align: center;
    padding: 30px 24px;
  }

  .contacts__address { font-size: 20px; }
  .hours__row { font-size: 16px; }
  .hours__row.is-today span:first-child::after { content: ""; }
  .contacts__actions .btn { flex: 1 1 100%; }

  .footer { padding-top: 64px; }
  .footer__inner { grid-template-columns: 1fr; gap: 36px; }
  .footer__bottom { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
}
