:root {
  --bg: #fbf7f2;
  --card: #ffffff;
  --ink: #2a2320;
  --muted: #8a807a;
  --accent: #e8562a;
  --accent-dark: #c8431d;
  --accent-soft: #fff0ea;
  --border: #eee3da;
  --shadow: 0 6px 24px rgba(60, 40, 30, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* --- Шапка --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 242, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { font-size: 30px; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.brand__tag { font-size: 12.5px; color: var(--muted); }
.brand__phone { color: var(--muted); font-size: 14px; margin-left: 6px; }

/* Крупная, заметная корзина */
/* Корзина в шапке — без фона, чистая иконка, заметно оживает при добавлении */
.cart-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  position: relative;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.cart-btn:hover { background: var(--accent-soft); }
.cart-btn__ico {
  position: relative;
  width: 30px;
  height: 30px;
  color: var(--muted);          /* пустая — спокойная серая */
  transition: color 0.25s ease;
}
.cart-btn__ico svg { width: 30px; height: 30px; display: block; }
.cart-btn.has-items .cart-btn__ico { color: var(--accent); } /* есть товары — фирменная оранжевая */
.cart-btn.has-items .cart-btn__text { color: var(--ink); }

.cart-btn__count {
  position: absolute;
  top: -8px;
  right: -9px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(232, 86, 42, 0.5);
  font-variant-numeric: tabular-nums;
}
.cart-btn__count[hidden] { display: none; }

.cart-btn__sum {
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cart-btn__sum:empty { display: none; } /* пусто — не показываем «0 ₽» */

/* Корзинка «подпрыгивает и качается», бейдж — пружинит: видно, что пополняется */
.cart-btn.bump .cart-btn__ico { animation: cart-jiggle 0.5s ease; }
.cart-btn.bump .cart-btn__count { animation: qty-pop 0.4s ease; }
@keyframes cart-jiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-13deg) scale(1.14); }
  50% { transform: rotate(10deg) scale(1.14); }
  78% { transform: rotate(-4deg) scale(1.06); }
}

/* Лёгкий «+1», взлетающий над корзиной при добавлении */
.fly-plus {
  position: absolute;
  left: 50%;
  top: -2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
  animation: fly-up 0.7s ease forwards;
}
@keyframes fly-up {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(1); }
}

/* «Подскок» для mobile-bar (сам селектор — в мобильной секции ниже) */
@keyframes bump {
  0% { transform: scale(1); }
  30% { transform: scale(1.06); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-btn.bump .cart-btn__ico,
  .cart-btn.bump .cart-btn__count,
  .fly-plus { animation: none; }
  .fly-plus { display: none; }
}

/* --- Каталог --- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }

/* Плашка «Повторить прошлый заказ» */
.repeat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}
.repeat__icon { font-size: 28px; }
.repeat__info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 180px; }
.repeat__items { color: var(--muted); font-size: 14px; }
.btn--repeat { border-radius: 999px; padding: 12px 20px; white-space: nowrap; }
.page-title { font-size: 32px; margin: 8px 0 20px; letter-spacing: -0.5px; }
.section-title { font-size: 24px; margin: 40px 0 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* десктоп: три товара в ряд — и пиццы, и напитки */
  gap: 36px 30px;
}
@media (max-width: 880px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .grid--drinks { grid-template-columns: repeat(2, 1fr); } /* напитки компактнее — парой */
}

/* «Воздушная» карточка: без рамки, крупная круглая картинка, всё по центру */
.card {
  background: transparent;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.card__thumb {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 130px;
  position: relative;
  filter: drop-shadow(0 18px 22px rgba(60, 40, 30, 0.16));
  transition: transform 0.25s ease;
}
.card:hover .card__thumb { transform: scale(1.05) rotate(2deg); }
.card--drink .card__thumb { font-size: 110px; }
.card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%; /* фото пиццы — круглое, как в больших сетях */
}
.card__badge {
  position: absolute;
  top: 5%;
  left: 0;
  z-index: 2;
  background: #ff4d9e;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  transform: rotate(-8deg);
  box-shadow: 0 4px 12px rgba(255, 77, 158, 0.45);
}
.card__body { padding: 16px 6px 0; display: flex; flex-direction: column; flex: 1; align-items: center; }
.card__name { font-size: 20px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.2px; }
.card__desc { color: var(--muted); font-size: 14px; line-height: 1.4; margin: 0 0 16px; flex: 1; max-width: 280px; }

.btn {
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 10px;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: scale(0.97); }
/* Кнопка-пилюля «В корзину · 490 ₽» на всю ширину карточки */
.card__control {
  width: 100%;
  margin-top: auto;
  display: flex;
  justify-content: center;
}
/* Главная конверсионная кнопка: градиент + «жидкое стекло» + мягкое переливание */
.btn--pill {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 250px;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: linear-gradient(135deg, #ff8a4d 0%, var(--accent) 55%, #d94a1f 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 20px rgba(232, 86, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 6px rgba(160, 45, 10, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
/* стеклянный блик в верхней половине */
.btn--pill::before {
  content: "";
  position: absolute;
  inset: 2px 10px auto 10px;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}
/* мягкая искра, изредка пробегающая по кнопке */
.btn--pill::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 38%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  animation: pill-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pill-shine {
  0% { left: -60%; }
  55% { left: 135%; }
  100% { left: 135%; }
}
.btn--pill:hover {
  background: linear-gradient(135deg, #ff9a5f 0%, #ef5f2f 55%, #de5024 100%);
  transform: translateY(-2px);
  box-shadow:
    0 13px 30px rgba(232, 86, 42, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(160, 45, 10, 0.25);
}
.btn--pill:active { transform: translateY(0) scale(0.96); }
.pill-price { font-weight: 900; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .btn--pill::after,
  .btn--order::after,
  .mobile-bar::after { animation: none; opacity: 0; }
}

/* Счётчик «− N шт · сумма +» вместо пилюли, когда товар в корзине */
.qty--card {
  width: 100%;
  max-width: 260px;
  justify-content: space-between;
  background: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(60, 40, 30, 0.14);
}
.qty--card button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 700;
}
/* минус — скромный, вспомогательный */
.qty--card [data-dec] {
  background: var(--accent-soft);
  color: var(--accent);
}
.qty--card [data-dec]:hover:not(:disabled) {
  background: #ffdccc;
  color: var(--accent-dark);
  transform: scale(1.06);
}
/* плюсик — главная кнопка: сочный градиент и тёплое свечение, хочется нажать */
.qty--card [data-add] {
  background: linear-gradient(135deg, #ff8a4d, var(--accent));
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 86, 42, 0.45);
}
.qty--card [data-add]:hover {
  background: linear-gradient(135deg, #ff9a63, var(--accent));
  box-shadow: 0 9px 24px rgba(232, 86, 42, 0.55);
  transform: scale(1.12);
}
.qty--card [data-add]:active { transform: scale(0.9); }
.qty--card span {
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  animation: qty-pop 0.25s ease; /* число «подпрыгивает» при изменении */
}
@keyframes qty-pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Товар из стоп-листа: серый, купить нельзя */
.card--stopped .card__thumb { filter: grayscale(1); opacity: 0.55; }
.card--stopped .card__name { color: var(--muted); }
.oos { color: var(--muted); font-weight: 700; font-size: 14px; }
.cart-item__oos { color: var(--accent-dark); font-size: 12px; font-weight: 600; margin-top: 2px; }
.qty button:disabled { opacity: 0.35; cursor: default; }

/* --- Корзина (панель) --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 15, 0.4);
  z-index: 30;
}
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 100%;
  background: var(--bg);
  z-index: 40;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.cart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-panel__head h2 { margin: 0; font-size: 22px; }
.icon-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
}
.icon-btn:hover { background: var(--border); }
.cart-panel__body { overflow-y: auto; padding: 12px 20px; flex: 1; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item__emoji {
  font-size: 30px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 12px;
  flex-shrink: 0;
}
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-weight: 700; font-size: 15px; }
.cart-item__price { color: var(--muted); font-size: 13px; }
.qty {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--accent-soft);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s, color 0.15s;
}
.qty button:hover:not(:disabled) { background: var(--accent); color: #fff; transform: scale(1.08); }
.qty button:active:not(:disabled) { transform: scale(0.9); }
.qty span { min-width: 20px; text-align: center; font-weight: 700; }

/* Блок «Добавить напиток?» в корзине */
.upsell { padding: 14px 0 6px; }
.upsell__title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.upsell__row { display: flex; gap: 10px; }
.upsell__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.upsell__item:hover { border-color: var(--accent); }
.upsell__item:active { transform: scale(0.96); }
.upsell__emoji { font-size: 28px; }
.upsell__name { font-size: 12px; color: var(--ink); line-height: 1.2; text-align: center; }
.upsell__price { font-size: 13px; font-weight: 800; color: var(--accent); }

.checkout {
  padding: 8px 20px 20px;
  border-top: 1px solid var(--border);
  overflow-y: auto; /* на низких экранах форма прокручивается, а не обрезается */
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 800;
  margin: 8px 0 6px;
}
.delivery-note { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.checkout label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.checkout input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
.checkout input:focus { outline: 2px solid var(--accent); border-color: transparent; }
/* «Заказать» — финальная кнопка: тот же премиум-характер, что у «В корзину» */
.btn--order {
  width: 100%;
  padding: 15px;
  font-size: 17px;
  margin-top: 6px;
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a4d 0%, var(--accent) 55%, #d94a1f 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 20px rgba(232, 86, 42, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 6px rgba(160, 45, 10, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn--order::before {
  content: "";
  position: absolute;
  inset: 2px 10px auto 10px;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn--order::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 38%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  animation: pill-shine 3.6s ease-in-out infinite;
  animation-delay: 1.8s; /* вразнобой с кнопками карточек */
  pointer-events: none;
}
.btn--order:hover {
  background: linear-gradient(135deg, #ff9a5f 0%, #ef5f2f 55%, #de5024 100%);
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(232, 86, 42, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 6px rgba(160, 45, 10, 0.25);
}
.btn--order:active { transform: scale(0.98); }
.btn--order:disabled { opacity: 0.7; transform: none; }
.form-error { color: var(--accent-dark); font-size: 14px; margin: 10px 0 0; }

/* Салют после заказа */
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none; /* не мешает нажимать кнопки под ним */
  overflow: hidden;
  z-index: 5;
}
.confetti span {
  position: absolute;
  top: -36px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(560deg); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; } /* уважение к настройке «меньше анимаций» */
}

.cart-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.cart-empty .btn { margin-top: 16px; padding: 12px 26px; border-radius: 999px; }
.cart-success { text-align: center; padding: 44px 20px 20px; color: var(--muted); }
.cart-empty__emoji, .cart-success__emoji { font-size: 56px; margin-bottom: 10px; }
.cart-success h3 { color: var(--ink); font-size: 22px; margin: 6px 0; }
.cart-success .btn { margin-top: 16px; padding: 12px 28px; }

/* Чек на экране «Заказ принят» */
.success-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px auto 10px;
  max-width: 320px;
  text-align: left;
}
.success-summary__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--ink);
  padding: 3px 0;
}
.success-summary__line--total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 800;
  font-size: 15px;
}
.muted { color: var(--muted); }

[hidden] { display: none !important; }

/* Плавающая корзина внизу экрана — только на телефоне */
.mobile-bar {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 25;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(135deg, #ff8a4d 0%, var(--accent) 55%, #d94a1f 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 17px;
  font-weight: 800;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow:
    0 10px 30px rgba(232, 86, 42, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 6px rgba(160, 45, 10, 0.25);
}
.mobile-bar::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 38%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  animation: pill-shine 3.6s ease-in-out infinite;
  animation-delay: 0.9s;
  pointer-events: none;
}
.mobile-bar__count {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 2px 11px;
  font-variant-numeric: tabular-nums;
}
.mobile-bar__total { font-variant-numeric: tabular-nums; }
.mobile-bar.bump { animation: bump 0.4s ease; }

@media (max-width: 640px) {
  .mobile-bar:not([hidden]) { display: flex; }
  .container { padding-bottom: 120px; } /* нижние карточки не прячутся под панелью */
}

@media (max-width: 520px) {
  .cart-btn__text { display: none; }
  .brand__phone { display: none; }
  .page-title { font-size: 26px; }
}
