/* =========  AntCake  =========
   Палитра взята с фото: светлая стена и стол, малиновый «красный бархат»,
   шоколад для текста, сталь решётки для остывания. */
:root {
  --wall: #EDEFF1;
  --paper: #FFFFFF;
  --cocoa: #2B1B16;
  --cocoa-soft: #6B5A54;
  --berry: #A3143A;
  --berry-deep: #7E0D2B;
  --berry-wash: #F7E4E9;
  --steel: #B4BAC0;
  --radius-photo: 6px;
  --display: "Yeseva One", Georgia, serif;
  --body: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--cocoa);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 400; margin: 0; }
h1, h2 { font-family: var(--display); letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; border-radius: 4px; }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(237, 239, 241, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(43, 27, 22, .08);
}
.logo {
  font-family: var(--display); font-size: 26px; line-height: 1;
  text-decoration: none; color: var(--berry);
}
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a, .top-phone { text-decoration: none; font-weight: 500; font-size: 15px; }
.top-nav a:hover, .top-phone:hover { color: var(--berry); }
.top-phone { white-space: nowrap; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 24px;
  border-radius: 999px; font: 600 16px/1 var(--body);
  text-decoration: none; cursor: pointer; border: 2px solid var(--berry);
  transition: background .15s, color .15s;
}
.btn-main { background: var(--berry); color: #fff; }
.btn-main:hover { background: var(--berry-deep); border-color: var(--berry-deep); }
.btn-ghost { background: transparent; color: var(--berry); }
.btn-ghost:hover { background: var(--berry-wash); }

/* ---------- Первый экран ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas: "text rack" "facts facts";
  gap: 40px clamp(24px, 5vw, 72px);
  padding: clamp(32px, 6vw, 80px) clamp(16px, 4vw, 48px) 48px;
  max-width: 1240px; margin: 0 auto;
}
.hero-text { grid-area: text; align-self: center; }
.hero h1 { font-size: clamp(40px, 5.2vw, 66px); line-height: 1.02; color: var(--cocoa); }
.hero-lead { font-size: 19px; color: var(--cocoa-soft); max-width: 30em; margin: 22px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Решётка для остывания: на ней стоят торты */
.rack {
  grid-area: rack; position: relative;
  min-height: 420px;
  border-radius: 18px;
  background-color: #F6F7F8;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 21px, var(--steel) 21px 23px),
    repeating-linear-gradient(0deg, transparent 0 21px, var(--steel) 21px 23px);
  box-shadow: inset 0 0 0 10px #F6F7F8, inset 0 0 0 12px var(--steel);
}
.rack-img {
  position: absolute; object-fit: cover;
  border-radius: var(--radius-photo);
  border: 6px solid var(--paper);
  box-shadow: 0 18px 30px -18px rgba(43, 27, 22, .55);
}
.r1 { width: 52%; aspect-ratio: 1; left: 6%; top: 8%; transform: rotate(-3deg); }
.r2 { width: 46%; aspect-ratio: 4/3; right: 5%; top: 4%; transform: rotate(2.5deg); }
.r3 { width: 44%; aspect-ratio: 1; right: 12%; bottom: 6%; transform: rotate(-1.5deg); }

.facts {
  grid-area: facts; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: rgba(43, 27, 22, .1); border-radius: 14px; overflow: hidden;
}
.facts li { background: var(--paper); padding: 18px 20px; }
.facts strong { display: block; font-weight: 600; font-size: 17px; }
.facts span { color: var(--cocoa-soft); font-size: 15px; }

/* ---------- Меню ---------- */
.menu { background: var(--paper); padding: 64px clamp(16px, 4vw, 48px) 72px; }
.menu > * { max-width: 920px; margin-left: auto; margin-right: auto; }
.menu-head h2, .order h2, .contacts h2 { font-size: clamp(34px, 4.5vw, 52px); line-height: 1.05; }
.menu-note { color: var(--cocoa-soft); margin: 12px 0 28px; max-width: 36em; }

.tabs {
  position: sticky; top: 60px; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; background: var(--paper);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid rgba(43, 27, 22, .18); background: var(--paper);
  font: 500 15px/1 var(--body); color: var(--cocoa); text-decoration: none; white-space: nowrap;
}
.tab:hover { border-color: var(--berry); color: var(--berry); }
.tab[aria-current="true"] { background: var(--cocoa); border-color: var(--cocoa); color: #fff; }

.menu-section { padding-top: 36px; }
.menu-section h3 {
  font-family: var(--display); font-size: 30px; margin-bottom: 6px;
}
.section-hint { color: var(--cocoa-soft); font-size: 15px; margin: 0 0 8px; }

.item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 4px 18px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid rgba(43, 27, 22, .1);
}
.item-photo {
  grid-row: span 2; width: 84px; height: 84px; padding: 0; border: 0;
  border-radius: var(--radius-photo); overflow: hidden; cursor: zoom-in; background: var(--wall);
}
.item-photo img { width: 100%; height: 100%; object-fit: cover; }
.item-photo.empty {
  cursor: default;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 9px, var(--steel) 9px 10px),
    repeating-linear-gradient(0deg, transparent 0 9px, var(--steel) 9px 10px);
  opacity: .55;
}
.item-name { margin: 4px 0 0; font-weight: 600; font-size: 18px; line-height: 1.3; }
.item-price { text-align: right; white-space: nowrap; }
.item-price b { font: 600 20px/1.2 var(--body); color: var(--berry); font-variant-numeric: tabular-nums; }
.item-price small { display: block; color: var(--cocoa-soft); font-size: 13px; }
.item-desc { grid-column: 2 / 4; margin: 0; color: var(--cocoa-soft); font-size: 15px; max-width: 46em; }
.item-note { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--berry-deep); background: var(--berry-wash); padding: 2px 8px; border-radius: 999px; }
.price-ask { font-weight: 500; font-size: 15px; color: var(--berry); }

/* Подсказка по весу */
.calc {
  margin: 14px 0 6px; padding: 16px 18px; border-radius: 12px;
  background: var(--wall); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.calc label { font-weight: 500; }
.calc input {
  width: 84px; min-height: 44px; padding: 0 10px; font: 600 18px var(--body);
  border: 1.5px solid rgba(43, 27, 22, .25); border-radius: 10px; background: #fff; color: var(--cocoa);
}
.calc output { color: var(--cocoa); }
.calc output b { color: var(--berry); }

.menu-loading, .menu-error { color: var(--cocoa-soft); padding: 24px 0; }

/* ---------- Как заказать ---------- */
.order { padding: 72px clamp(16px, 4vw, 48px); max-width: 1240px; margin: 0 auto; }
.steps {
  list-style: none; counter-reset: step; padding: 0; margin: 32px 0 36px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.steps li { counter-increment: step; position: relative; padding-top: 64px; }
.steps li::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  font: 44px/1 var(--display); color: var(--berry);
}
.steps h3 { font-weight: 600; font-size: 19px; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--cocoa-soft); }

/* ---------- Контакты ---------- */
.contacts {
  background: var(--cocoa); color: #F3ECE9;
  padding: 72px clamp(16px, 4vw, 48px);
}
.contacts > * { max-width: 920px; margin-left: auto; margin-right: auto; }
.contacts h2 { color: #fff; }
.contacts-name { margin: 10px auto 26px; color: #CDBFBA; }
.contact-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.contact-list a {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .3);
  text-decoration: none; font-weight: 500;
}
.contact-list a:hover { background: rgba(255, 255, 255, .1); }
.contact-list li:first-child a { background: #fff; color: var(--cocoa); border-color: #fff; font-weight: 600; }
.contacts-area { color: #CDBFBA; margin-top: 22px; }

.foot { background: var(--cocoa); color: #9C8C86; text-align: center; font-size: 14px; padding: 0 16px 100px; }
.foot p { margin: 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); max-width: 920px; margin: 0 auto; }

/* Нижняя панель на телефоне */
.dock { display: none; }

/* Фото крупно */
.photo-dialog {
  border: 0; padding: 0; border-radius: 14px; max-width: min(92vw, 720px);
  background: var(--paper); color: var(--cocoa);
}
.photo-dialog::backdrop { background: rgba(43, 27, 22, .7); }
.photo-dialog img { width: 100%; max-height: 75vh; object-fit: contain; background: var(--wall); }
.photo-dialog p { margin: 0; padding: 14px 18px; font-weight: 600; }
.photo-close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.9);
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--cocoa);
}

/* ---------- Планшет ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "text" "rack" "facts"; }
  .rack { min-height: 340px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .steps li { padding-top: 0; padding-left: 52px; }
  .steps li::before { font-size: 36px; }
}

/* ---------- Телефон ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top-nav { display: none; }
  .top-phone { margin-left: auto; font-size: 14px; }
  .hero { padding-top: 28px; gap: 28px; }
  .hero-lead { font-size: 17px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .rack { min-height: 270px; }
  .tabs { top: 56px; }
  .item { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 2px 12px; }
  .item-photo { width: 68px; height: 68px; }
  .item-name { font-size: 16px; }
  .item-price b { font-size: 18px; }
  .item-desc { grid-column: 1 / 4; margin-top: 6px; }
  .item-photo { grid-row: auto; }
  .dock {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid rgba(43, 27, 22, .1);
  }
  .dock .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
