:root {
  --yellow: #f9b004;
  --yellow-soft: #fff3cc;
  --blue: #138eff;
  --blue-dark: #0876dc;
  --red: #f20934;
  --brown: #2b0d0d;
  --brown-soft: #6f5752;
  --paper: #fff8ea;
  --surface: #ffffff;
  --line: #ead7bd;
  --shadow: 0 18px 45px rgba(43, 13, 13, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--brown);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.page-shell {
  min-height: 100vh;
}

.constructor-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  gap: 48px;
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 54px 16px 34px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 760px;
  color: var(--brown);
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy h1::after {
  content: "";
  display: block;
  width: min(100%, 360px);
  height: 12px;
  margin-top: 22px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 28px, transparent 28px 42px);
  border-radius: 999px;
}

.hero-copy p {
  max-width: 650px;
  margin: 26px 0 0;
  color: var(--brown);
  font-size: clamp(18px, 2.1vw, 26px);
  line-height: 1.25;
}

.hero-media {
  position: relative;
  min-height: 360px;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 14% 2% 6% 10%;
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: 12px 14px 0 var(--blue);
}

.hero-media img {
  position: relative;
  z-index: 1;
  width: min(100%, 530px);
  margin-left: auto;
  object-fit: contain;
}

.constructor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: start;
  gap: 28px;
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 24px 16px 72px;
}

.builder-column {
  display: grid;
  gap: 28px;
}

.section-block {
  padding: 26px;
  background: var(--surface);
  border: 1px solid rgba(234, 215, 189, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(43, 13, 13, 0.08);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2,
.summary-panel h2,
.order-form h2 {
  margin: 0;
  color: var(--brown);
  font-size: clamp(24px, 2.6vw, 40px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0;
}

.section-heading span {
  max-width: 300px;
  color: var(--brown-soft);
  font-size: 14px;
  text-align: right;
}

.egg-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.egg-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  min-height: 164px;
  gap: 14px;
  padding: 18px;
  background: var(--yellow-soft);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--brown);
  text-align: left;
  cursor: pointer;
}

.egg-card:nth-child(2) {
  background: #ecf6ff;
}

.egg-card:nth-child(3) {
  background: #ffe9ee;
}

.egg-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(19, 142, 255, 0.16);
}

.egg-card img {
  width: 96px;
  height: 126px;
  object-fit: contain;
}

.egg-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 800;
}

.egg-card span {
  display: block;
  margin-top: 8px;
  color: var(--brown-soft);
  font-size: 14px;
}

.egg-card small {
  display: block;
  margin-top: 8px;
  color: var(--brown-soft);
  font-size: 12px;
  font-weight: 700;
}

.egg-card em {
  display: block;
  margin-top: 12px;
  color: var(--red);
  font-size: 22px;
  font-style: normal;
  font-weight: 800;
}

.segmented,
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segment-button,
.category-button,
.preset-button {
  min-height: 44px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brown);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.segment-button.is-selected,
.category-button.is-selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.variant-note {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: #fff8ea;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--brown);
  font-weight: 700;
}

.reset-button {
  min-height: 40px;
  width: 100%;
  margin: 12px 0 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brown);
  font-weight: 800;
  cursor: pointer;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.preset-button {
  display: block;
  min-height: 112px;
  padding: 16px;
  text-align: left;
}

.preset-button strong {
  display: block;
  font-size: 17px;
  line-height: 1.15;
}

.preset-button span {
  display: block;
  margin-top: 8px;
  color: var(--brown-soft);
  font-size: 13px;
  font-weight: 400;
}

.category-tabs {
  margin-bottom: 18px;
}

.fillings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.filling-card {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.filling-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.filling-card.is-disabled {
  opacity: 0.48;
}

.filling-image {
  display: grid;
  place-items: center;
  height: 180px;
  background: #fff3cc;
}

.filling-card:nth-child(3n + 2) .filling-image {
  background: #eaf5ff;
}

.filling-card:nth-child(3n + 3) .filling-image {
  background: #ffe9ee;
}

.filling-image img {
  width: 86%;
  height: 150px;
  object-fit: contain;
}

.filling-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.filling-category {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filling-body h3 {
  margin: 8px 0 0;
  color: var(--brown);
  font-size: 19px;
  line-height: 1.12;
  font-weight: 800;
}

.filling-body p {
  margin: 10px 0 0;
  color: var(--brown-soft);
  font-size: 14px;
}

.filling-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.filling-meta strong {
  color: var(--red);
  font-size: 22px;
  line-height: 1;
}

.filling-meta span {
  color: var(--brown-soft);
  font-size: 13px;
}

.qty-control {
  display: grid;
  grid-template-columns: 40px 44px 40px;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.qty-control button {
  width: 40px;
  height: 40px;
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.qty-control button:disabled {
  background: #c8c0b6;
  cursor: not-allowed;
}

.qty-control output {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  background: #fff8ea;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

.summary-panel {
  position: relative;
}

.summary-sticky {
  position: sticky;
  top: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-product {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.summary-product img {
  width: 90px;
  height: 116px;
  object-fit: contain;
}

.summary-product h2 {
  font-size: 26px;
}

.summary-product p {
  margin: 7px 0 0;
  color: var(--brown-soft);
  font-size: 15px;
}

.capacity-box {
  margin-top: 18px;
  padding: 16px;
  background: #fff8ea;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.capacity-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.capacity-top span,
.capacity-top strong {
  font-size: 13px;
}

.capacity-top strong {
  color: var(--blue);
  text-align: right;
}

.capacity-box.is-over .capacity-top strong {
  color: var(--red);
}

.capacity-track {
  height: 12px;
  background: #ead7bd;
  border-radius: 999px;
  overflow: hidden;
}

.capacity-fill {
  width: 0;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width 0.2s ease, background 0.2s ease;
}

.capacity-box.is-over .capacity-fill {
  background: var(--red);
}

.summary-lines {
  display: grid;
  gap: 10px;
  min-height: 42px;
  margin-top: 18px;
}

.summary-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  color: var(--brown);
  font-size: 14px;
}

.summary-line span {
  color: var(--brown-soft);
}

.summary-line button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffe9ee;
  color: var(--red);
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.empty-summary {
  color: var(--brown-soft);
  font-size: 14px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brown);
  outline: none;
}

textarea {
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(19, 142, 255, 0.14);
}

.delivery-quote-status,
.custom-gift-hint,
.delivery-map-preview {
  margin-top: 10px;
  padding: 12px 14px;
  background: #fff8ea;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--brown);
  font-size: 13px;
  font-weight: 700;
}

.delivery-quote-status.is-manual {
  background: #ffe9ee;
  border-color: #ffc8d2;
  color: #8a0018;
}

.city-picker {
  position: relative;
}

.city-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.city-suggestions button,
.point-option {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--brown);
  text-align: left;
  cursor: pointer;
}

.city-suggestions button:hover,
.point-option:hover,
.point-option.is-selected {
  background: #ecf6ff;
}

.city-suggestions span,
.point-option span,
.custom-gift-hint span,
.delivery-map-preview span,
.delivery-map-preview small {
  color: var(--brown-soft);
  font-size: 12px;
}

.delivery-point-picker {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  max-height: 280px;
  overflow-y: auto;
}

.delivery-map-preview {
  display: grid;
  gap: 4px;
  min-height: 88px;
}

.custom-gift-hint {
  display: grid;
  gap: 4px;
}

.order-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.order-form h2,
.delivery-section h2,
.contact-section h2 {
  margin: 0;
  font-size: 24px;
}

.delivery-section {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.delivery-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.delivery-section-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--brown-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.delivery-section .field-label {
  margin: 0 0 -4px;
}

.delivery-extra,
.custom-gift-form,
.contact-section {
  display: grid;
  gap: 12px;
}

.delivery-extra label,
.custom-gift-form label {
  display: grid;
  gap: 7px;
  color: var(--brown);
  font-size: 14px;
  font-weight: 800;
}

.delivery-extra label[hidden],
.delivery-point-picker[hidden],
.delivery-map-preview[hidden],
.city-suggestions[hidden],
.custom-gift-hint[hidden],
.custom-gift-form label[hidden],
.custom-gift-form[hidden] {
  display: none !important;
}

.delivery-extra span,
.custom-gift-form span {
  color: var(--brown-soft);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
}

.totals {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.totals span {
  color: var(--brown-soft);
}

.totals strong {
  white-space: nowrap;
}

.grand-total {
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.grand-total strong {
  color: var(--red);
  font-size: 32px;
  line-height: 1;
}

.contact-section {
  padding-top: 4px;
}

.custom-gift-form {
  padding: 14px;
  background: #fff8ea;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.custom-gift-form h3 {
  margin: 0;
  font-size: 18px;
}

.privacy-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--brown-soft);
  font-size: 12px;
  cursor: pointer;
}

.privacy-line input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 22px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.primary-button {
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.primary-button:disabled {
  background: #c8c0b6;
  cursor: not-allowed;
}

.secondary-button {
  background: #23a455;
}

.order-status {
  margin-top: 18px;
  padding: 16px;
  background: #eef8f1;
  border: 1px solid #b9dfc3;
  border-radius: var(--radius);
}

.order-status.is-error {
  background: #fff0f3;
  border-color: #f3b4c0;
}

.order-status h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.2;
}

.order-status p {
  margin: 0 0 12px;
  color: var(--brown-soft);
  font-size: 14px;
}

.status-actions {
  display: grid;
  gap: 10px;
}

.mobile-checkout-bar {
  display: none;
}

@media (max-width: 1160px) {
  .constructor-layout {
    grid-template-columns: 1fr;
  }

  .summary-sticky {
    position: static;
  }

  .fillings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 82px;
  }

  .constructor-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 36px;
  }

  .hero-media {
    min-height: 260px;
  }

  .hero-media img {
    margin: 0 auto;
    max-height: 320px;
  }

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

  .section-heading span {
    max-width: none;
    text-align: left;
  }

  .egg-options,
  .preset-list,
  .fillings-grid {
    grid-template-columns: 1fr;
  }

  .egg-card {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .egg-card img {
    width: 86px;
    height: 112px;
  }

  .mobile-checkout-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 28px rgba(43, 13, 13, 0.14);
  }

  .mobile-checkout-bar span {
    display: block;
    color: var(--brown-soft);
    font-size: 12px;
  }

  .mobile-checkout-bar strong {
    color: var(--red);
    font-size: 21px;
    line-height: 1;
  }

  .mobile-checkout-bar button {
    min-width: 132px;
    min-height: 46px;
    padding: 10px 16px;
    background: var(--blue);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
  }
}

@media (max-width: 520px) {
  .constructor-layout {
    padding-right: 10px;
    padding-left: 10px;
  }

  .section-block,
  .summary-sticky {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-copy p {
    font-size: 18px;
  }

  .summary-product {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .summary-product img {
    width: 72px;
    height: 94px;
  }

  .grand-total strong {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
