:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --yellow: #ffb703;
  --dark: #1d1a16;
  --cream: #fff8ee;
  --text: #3a332c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--dark);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.header__inner { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
.logo {
  color: var(--yellow); font-weight: 800; font-size: 1.25rem;
  text-decoration: none; white-space: nowrap;
}
.nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: #f1e9dc; text-decoration: none; font-weight: 600; transition: color .2s; }
.nav a:hover { color: var(--yellow); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff; font-weight: 700;
  padding: 14px 30px;
  border: none; border-radius: 50px;
  text-decoration: none; cursor: pointer;
  font-size: 1rem;
  transition: transform .15s, background .2s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(230,57,70,.35);
}
.btn:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn--small { padding: 9px 20px; font-size: .9rem; }
.btn--ghost {
  background: transparent; color: var(--yellow);
  border: 2px solid var(--yellow); box-shadow: none;
}
.btn--ghost:hover { background: var(--yellow); color: var(--dark); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #e63946 0%, #ff6b35 60%, #ffb703 100%);
  color: #fff;
  overflow: hidden;
}
.hero__inner { display: flex; align-items: center; gap: 30px; padding: 70px 20px; }
.hero__text { flex: 1; }
.hero__badge {
  display: inline-block; background: rgba(0,0,0,.25);
  padding: 6px 16px; border-radius: 30px;
  font-size: .9rem; font-weight: 700; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; margin-bottom: 16px; }
.hero p { font-size: 1.15rem; max-width: 520px; margin-bottom: 28px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__pizza {
  font-size: clamp(140px, 22vw, 260px);
  animation: spin 22s linear infinite;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,.35));
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Features */
.features { padding: 50px 0; background: #fff; }
.features__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.feature { text-align: center; padding: 20px; }
.feature span { font-size: 2.6rem; display: block; margin-bottom: 8px; }
.feature h3 { color: var(--red); margin-bottom: 6px; }
.feature p { font-size: .95rem; color: #7a7168; }

/* Menu */
.menu { padding: 70px 0; }
.section-title {
  text-align: center; font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--dark); margin-bottom: 30px;
}
.menu__tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.tab {
  background: #fff; color: var(--dark); border: 2px solid var(--dark);
  padding: 9px 22px; border-radius: 40px;
  font-weight: 700; cursor: pointer; font-size: .95rem;
  transition: all .2s;
}
.tab:hover, .tab.active { background: var(--dark); color: var(--yellow); }
.menu__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }

.card {
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  animation: pop .35s ease both;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(0,0,0,.14); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.card__img {
  font-size: 4.5rem; text-align: center; padding: 26px 0;
  background: linear-gradient(145deg, #ffe8d6, #ffd7ba);
}
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { color: var(--dark); font-size: 1.15rem; margin-bottom: 6px; }
.card__body p { font-size: .9rem; color: #7a7168; flex: 1; margin-bottom: 14px; }
.card__bottom { display: flex; align-items: center; justify-content: space-between; }
.card__price { font-weight: 800; font-size: 1.3rem; color: var(--red); }
.card__price small { font-size: .8rem; color: #9a9188; font-weight: 600; }
.tag {
  position: absolute; background: var(--yellow); color: var(--dark);
  font-size: .75rem; font-weight: 800; padding: 3px 10px;
  border-radius: 20px; margin: 10px 0 0 12px;
}
.card__img { position: relative; }

/* Кнопки в разделе «Наше меню» — чёрный шрифт */
.menu .card .btn { color: var(--dark); }

/* About */
.about { background: #fff; padding: 70px 0; }
.about__inner { display: flex; align-items: center; gap: 40px; }
.about__emoji { font-size: clamp(100px, 16vw, 180px); animation: flicker 1.6s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.08) rotate(4deg); } }
.about__text { flex: 1; }
.about__text .section-title { text-align: left; }
.about__text p { margin-bottom: 14px; }
.about__list { list-style: none; display: grid; gap: 8px; font-weight: 600; color: var(--dark); }

/* Delivery */
.delivery { padding: 70px 0; }
.delivery__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.delivery__card {
  background: var(--dark); color: #f1e9dc;
  border-radius: 18px; padding: 28px;
  border-bottom: 5px solid var(--yellow);
  transition: transform .2s;
}
.delivery__card:hover { transform: translateY(-5px); }
.delivery__card h3 { color: var(--yellow); margin-bottom: 10px; font-size: 1.2rem; }
.delivery__card p { font-size: .95rem; margin-bottom: 14px; }
.delivery__card strong { color: var(--yellow); }

/* Reviews */
.reviews { background: #fff; padding: 70px 0; }
.reviews__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.review {
  background: var(--cream); border-left: 5px solid var(--red);
  padding: 24px; border-radius: 0 14px 14px 0;
}
.review p { font-style: italic; margin-bottom: 12px; }
.review cite { color: var(--red); font-weight: 700; font-style: normal; }

/* CTA */
.cta { background: linear-gradient(135deg, var(--red), #ff6b35); color: #fff; padding: 60px 0; text-align: center; }
.cta h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 10px; }
.cta p { margin-bottom: 24px; font-size: 1.1rem; }
.cta .btn { background: var(--dark); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.cta .btn:hover { background: #000; }

/* Footer */
.footer { background: var(--dark); color: #c9bfae; padding: 44px 0; }
.footer__inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer h4 { color: var(--yellow); margin-bottom: 8px; }
.footer .logo { display: inline-block; margin-bottom: 8px; }

/* Menu page */
.hero--page .hero__inner { padding-top: 46px; padding-bottom: 46px; }
.hero--page .hero__pizza { font-size: clamp(110px, 16vw, 190px); }
.menu__note {
  text-align: center; margin-top: 40px; font-weight: 700;
  color: var(--dark); background: #fff;
  padding: 18px; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* ===== Корзина ===== */
.cart-trigger {
  display: flex; align-items: center; gap: 7px;
  background: var(--yellow); color: var(--dark);
  border: none; border-radius: 40px;
  padding: 9px 16px; font-size: .95rem; font-weight: 800;
  cursor: pointer; transition: transform .15s, box-shadow .2s;
}
.cart-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255,183,3,.45); }
.cart-trigger__count {
  background: var(--red); color: #fff;
  min-width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem;
}
.cart-trigger.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.22); } }

.cart-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-panel {
  position: absolute; top: 0; right: 0;
  width: min(420px, 92vw); height: 100%;
  background: var(--cream);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,.3);
}
.cart-overlay.open .cart-panel { transform: translateX(0); }
.cart-panel__head {
  background: var(--dark); color: var(--yellow);
  padding: 18px 20px; display: flex;
  align-items: center; justify-content: space-between;
}
.cart-panel__head h2 { font-size: 1.2rem; }
.cart-close {
  background: none; border: none; color: var(--yellow);
  font-size: 1.7rem; line-height: 1; cursor: pointer;
}
.cart-items { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start; }
.cart-item {
  background: #fff; border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.07);
  animation: pop .3s ease both;
}
.cart-item__emoji { font-size: 2rem; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__info h4 { color: var(--dark); font-size: .98rem; }
.cart-item__info span { color: var(--red); font-weight: 800; font-size: .9rem; }
.cart-item__qty { display: flex; align-items: center; gap: 8px; }
.cart-item__qty button {
  width: 28px; height: 28px; border: 2px solid var(--dark);
  background: #fff; border-radius: 50%;
  font-weight: 800; cursor: pointer; font-size: 1rem;
  line-height: 1; transition: all .15s;
}
.cart-item__qty button:hover { background: var(--dark); color: var(--yellow); }
.cart-item__qty b { min-width: 18px; text-align: center; }
.cart-empty { text-align: center; color: #7a7168; padding: 40px 10px; }
.cart-empty span { display: block; font-size: 3.2rem; margin-bottom: 10px; }
.cart-panel__foot {
  background: #fff; padding: 16px 20px 20px;
  border-top: 2px dashed #e5d9c8;
}
.cart-total {
  display: flex; justify-content: space-between;
  font-weight: 800; font-size: 1.15rem;
  color: var(--dark); margin-bottom: 14px;
}
.cart-total b { color: var(--red); }
.cart-panel__foot .btn { width: 100%; text-align: center; }
.cart-panel__foot .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ===== Диалог оформления заказа ===== */
.checkout-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.checkout-overlay.open { opacity: 1; visibility: visible; }
.checkout-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: 92vh; overflow-y: auto;
  background: var(--cream);
  border-radius: 20px;
  padding: 26px 26px 28px;
  transform: translateY(16px) scale(.97);
  transition: transform .25s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.checkout-overlay.open .checkout-modal { transform: none; }
.checkout-modal h2 { color: var(--dark); font-size: 1.35rem; margin-bottom: 16px; }
.checkout-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: #9a9188;
  font-size: 1.8rem; line-height: 1; cursor: pointer;
  transition: color .2s;
}
.checkout-close:hover { color: var(--red); }
.checkout-summary {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--dark); color: #f1e9dc;
  padding: 12px 16px; border-radius: 12px;
  font-weight: 700; font-size: .95rem; margin-bottom: 18px;
}
.checkout-summary b { color: var(--yellow); font-size: 1.1rem; }
.field { display: block; margin-bottom: 14px; font-weight: 700; font-size: .92rem; color: var(--dark); }
.field input, .field textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 11px 14px; border: 2px solid #e2d5c2; border-radius: 12px;
  font: inherit; font-weight: 600; background: #fff; color: var(--text);
  transition: border-color .2s; box-sizing: border-box;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field input.bad, .field textarea.bad { border-color: var(--red); background: #fff0f1; }
.co-methods { display: flex; gap: 10px; margin-top: 6px; }
.co-methods label {
  flex: 1; text-align: center; padding: 10px 6px;
  background: #fff; border: 2px solid #e2d5c2; border-radius: 12px;
  cursor: pointer; font-weight: 700; font-size: .9rem;
  transition: all .2s; user-select: none;
}
.co-methods label.active { border-color: var(--red); background: #ffeef0; color: var(--red-dark); }
.co-methods input { position: absolute; opacity: 0; pointer-events: none; }
.field-error { color: var(--red-dark); font-weight: 700; font-size: .9rem; min-height: 1.2em; margin-bottom: 10px; }
.co-submit { width: 100%; }
.co-back {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; cursor: pointer;
  color: #7a7168; font-weight: 700; font-size: .9rem; font-family: inherit;
}
.co-back:hover { color: var(--dark); text-decoration: underline; }
.checkout-done { text-align: center; padding: 10px 0 4px; }
.checkout-done .done-icon { font-size: 3.6rem; display: block; margin-bottom: 8px; animation: bump .5s ease; }
.checkout-done h2 { margin-bottom: 8px; }
.done-num {
  display: inline-block; background: var(--yellow); color: var(--dark);
  font-weight: 800; padding: 6px 18px; border-radius: 30px;
  margin: 8px 0 14px; font-size: 1.05rem;
}
.checkout-done p { color: #7a7168; margin-bottom: 8px; font-size: .95rem; }
.checkout-done .done-sum { color: var(--dark); font-weight: 800; font-size: 1.1rem; margin-bottom: 20px; }

/* ===== Промо-блок конструктора ===== */
.promo-builder { background: linear-gradient(135deg, #6a040f 0%, #d00000 100%); color: #fff; padding: 50px 0; }
.promo-builder__inner { display: flex; align-items: center; gap: 26px; }
.promo-builder__text { flex: 1; }
.promo-builder h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 8px; }
.promo-builder p { margin-bottom: 20px; max-width: 540px; opacity: .92; }
.promo-builder .btn { background: var(--yellow); color: var(--dark); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.promo-builder .btn:hover { background: #ffc93c; }
.promo-builder__emoji { font-size: clamp(80px, 12vw, 130px); animation: flicker 1.8s ease-in-out infinite alternate; }

/* ===== Бронь столика ===== */
.booking { background: var(--dark); color: #f1e9dc; padding: 70px 0; }
.booking .section-title { color: var(--yellow); }
.booking__inner { max-width: 760px; }
.booking__text { text-align: center; margin-bottom: 30px; }
.booking__text p { opacity: .85; }
.booking__row { display: flex; gap: 14px; flex-wrap: wrap; }
.booking__row .field { flex: 1; min-width: 150px; }
.booking .field { color: var(--yellow); }
.booking .field input, .booking .field select, .booking .field textarea {
  background: #2b2721; border-color: #453f36; color: #f1e9dc;
}
.booking .field input:focus, .booking .field select:focus { border-color: var(--yellow); }
.booking .field-error { color: #ff8fa3; }
.booking__done {
  text-align: center; background: #2b2721;
  border-radius: 20px; padding: 34px 24px;
}
.booking__done h3 { color: var(--yellow); font-size: 1.3rem; margin-bottom: 6px; }
.booking__done p { opacity: .85; margin-bottom: 16px; }
.booking__done .done-icon { font-size: 3.4rem; display: block; margin-bottom: 8px; }

/* ===== Корзина: промокод и итог ===== */
.cart-discount {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  color: #157347; font-weight: 800; font-size: .95rem; margin-bottom: 8px;
}
.cart-discount[hidden] { display: none; }
.cart-discount button {
  background: none; border: none; color: #157347;
  font-size: 1rem; cursor: pointer; font-weight: 800;
}
.cart-discount button:hover { color: var(--red-dark); }
.cart-pay {
  display: flex; justify-content: space-between;
  font-weight: 800; font-size: 1.2rem;
  color: var(--dark); margin-bottom: 14px;
}
.cart-pay b { color: var(--red); }
.cart-promo { display: flex; gap: 8px; margin-bottom: 14px; }
.cart-promo input {
  flex: 1; min-width: 0; padding: 10px 14px;
  border: 2px solid #e2d5c2; border-radius: 12px;
  font: inherit; font-weight: 700; text-transform: uppercase;
  background: #fff; color: var(--text);
}
.cart-promo input:focus { outline: none; border-color: var(--red); }
.cart-promo input.bad { border-color: var(--red); background: #fff0f1; }
.cart-promo__btn {
  padding: 10px 18px; border: none; border-radius: 12px;
  background: var(--dark); color: var(--yellow);
  font-weight: 800; cursor: pointer; transition: background .2s;
}
.cart-promo__btn:hover { background: #000; }

/* ===== Конструктор пиццы ===== */
.builder { padding: 56px 0 70px; }
.builder__grid { display: grid; grid-template-columns: 1fr 340px; gap: 34px; align-items: start; }
.opt-group { margin-bottom: 26px; }
.opt-group h3 {
  color: var(--dark); font-size: 1.05rem; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.opt-row { display: flex; flex-wrap: wrap; gap: 10px; }
.opt {
  background: #fff; border: 2px solid #e2d5c2; border-radius: 40px;
  padding: 9px 18px; font-weight: 700; font-size: .92rem;
  cursor: pointer; color: var(--text); font-family: inherit;
  transition: all .18s;
}
.opt:hover { border-color: var(--red); }
.opt.active { background: var(--dark); border-color: var(--dark); color: var(--yellow); }
.opt:disabled { opacity: .4; cursor: not-allowed; }
.opt small { font-weight: 800; color: var(--red); }
.opt.active small { color: var(--yellow); }
.builder__counter { font-size: .9rem; color: #7a7168; font-weight: 700; margin-top: 10px; }

.builder__side {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 12px 34px rgba(0,0,0,.1);
  position: sticky; top: 86px; text-align: center;
}
.pizza-stage {
  width: 210px; height: 210px; margin: 0 auto 16px;
  border-radius: 50%; position: relative;
  background:
    radial-gradient(circle at 35% 30%, #ffe08a 0%, #f5b942 55%, #e09b1d 100%);
  box-shadow: inset 0 0 0 14px #e8b04b, 0 14px 30px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s ease;
}
.pizza-stage.pop { transform: scale(1.06); }
.pizza-stage__base { font-size: 3.4rem; }
.pizza-stage__tops {
  position: absolute; inset: 0; font-size: 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px; padding: 34px; line-height: 1;
}
.builder__summary {
  text-align: left; background: var(--cream); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 16px; font-size: .9rem;
  color: var(--text); min-height: 74px;
}
.builder__summary b { color: var(--dark); }
.builder__price {
  font-size: 1.9rem; font-weight: 800; color: var(--red);
  margin-bottom: 16px;
}
.builder__price small { font-size: .85rem; color: #9a9188; font-weight: 700; }
.builder__side .btn { width: 100%; }

@media (max-width: 860px) {
  .builder__grid { grid-template-columns: 1fr; }
  .builder__side { position: static; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: -80px; transform: translateX(-50%);
  background: var(--dark); color: var(--yellow);
  padding: 14px 26px; border-radius: 40px;
  font-weight: 700; z-index: 100;
  transition: bottom .35s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.toast.show { bottom: 28px; }

@media (max-width: 720px) {
  .nav { display: none; }
  .hero__inner, .about__inner { flex-direction: column; text-align: center; }
  .about__text .section-title { text-align: center; }
  .hero__pizza { animation-duration: 40s; }
}
