/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.constructor-hero {
  background: var(--clr-dark);
  padding: 9rem var(--px) 4rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.constructor-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--clr-cream);
}

.constructor-hero .deco-ball {
  position: absolute;
  border-radius: 50%;
  background: var(--clr-red);
  pointer-events: none;
}

.ch-b1 { width: 260px; height: 260px; left: -80px;  top: -60px; opacity: .13; }
.ch-b2 { width: 120px; height: 120px; right: 5%;    top: 20%;   opacity: .18; animation: cfloat 6s ease-in-out infinite; }
.ch-b3 { width: 55px;  height: 55px;  right: 12%;   top: 10%;   opacity: .12; animation: cfloat 4s ease-in-out 1s infinite; }
.ch-b4 { width: 30px;  height: 30px;  left: 18%;    bottom: 25%;opacity: .15; }
.ch-b5 { width: 180px; height: 180px; right: -50px; bottom: -40px; opacity: .1; }

@keyframes cfloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.constructor-hero-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--clr-red-light);
  margin-bottom: .9rem;
}

.constructor-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--clr-white);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.constructor-hero h1 em {
  font-style: italic;
  color: var(--clr-red-light);
}

.constructor-hero p {
  color: rgba(255, 255, 255, .6);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   ПРОГРЕСС-БАР ШАГОВ
   ═══════════════════════════════════════════════ */
.constructor-steps-bar {
  background: var(--clr-cream);
  padding: 2.5rem var(--px) 0;
  position: sticky;
  top: 72px;
  z-index: 90;
  border-bottom: 1px solid var(--clr-cream-2);
}

.steps-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding-bottom: 0;
}

.step-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  position: relative;
  padding-bottom: 1.2rem;
  cursor: pointer;
  transition: opacity var(--transition);
}

.step-bar-item::before {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--clr-cream-2);
  transition: background var(--transition);
  z-index: 0;
}

.step-bar-item:last-child::before { display: none; }
.step-bar-item.completed::before  { background: var(--clr-red); }

.step-bar-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--clr-cream-2);
  background: var(--clr-cream);
  color: var(--clr-text-muted);
  font-weight: 700;
  font-size: .88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all var(--transition);
}

.step-bar-item.active .step-bar-num {
  background: var(--clr-red);
  border-color: var(--clr-red);
  color: var(--clr-white);
  box-shadow: 0 0 0 5px rgba(192, 57, 43, .15);
}

.step-bar-item.completed .step-bar-num {
  background: var(--clr-red);
  border-color: var(--clr-red);
  color: var(--clr-white);
}

.step-bar-item.completed .step-bar-num::after {
  content: '✓';
  font-size: 1rem;
}

.step-bar-item.completed .step-bar-num-text { display: none; }

.step-bar-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  text-align: center;
  transition: color var(--transition);
  white-space: nowrap;
}

.step-bar-item.active .step-bar-label    { color: var(--clr-red); }
.step-bar-item.completed .step-bar-label { color: var(--clr-dark); }

.step-bar-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--clr-red);
  border-radius: 2px 2px 0 0;
}

/* ═══════════════════════════════════════════════
   ОСНОВНОЙ LAYOUT
   ═══════════════════════════════════════════════ */
.constructor-body {
  background: var(--clr-cream);
  padding: 3rem var(--px) 5rem;
}

.constructor-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2.5rem;
  align-items: start;
}

.constructor-viz {
  position: sticky;
  top: 160px;
}

.viz-canvas-wrap {
  background: #0e0e0e;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1 / 1.2;
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.cake-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.tier {
  position: relative;
  margin: 0 auto -4px;
  align-self: center;
}

.tier-coat { position: absolute; inset: 0; }

.tier-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .15) 0%, transparent 50%);
  pointer-events: none;
}

.tier-cut { box-shadow: inset 2px 0 4px rgba(0, 0, 0, .15); }

/* ═══════════════════════════════════════════════
   СВОДКА
   ═══════════════════════════════════════════════ */
.viz-summary {
  overflow-anchor: none;
  margin-top: 1.2rem;
  background: var(--clr-white);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-cream-2);
  min-height: 80px;
}

.viz-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  gap: .5rem;
}

.viz-summary-row .label { color: var(--clr-text-muted); font-weight: 500; }
.viz-summary-row .value { color: var(--clr-dark);       font-weight: 600; text-align: right; }

.viz-summary-empty {
  font-size: .85rem;
  color: var(--clr-text-muted);
  font-style: italic;
  text-align: center;
  padding: .3rem 0;
}

/* ═══════════════════════════════════════════════
   ШАГИ КОНСТРУКТОРА
   ═══════════════════════════════════════════════ */
.constructor-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cstep {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cstep.active {
  border-color: rgba(192, 57, 43, .25);
  box-shadow: 0 8px 32px rgba(192, 57, 43, .1);
}

.cstep.locked { opacity: .5; pointer-events: none; }

.cstep-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem 1.5rem;
  cursor: pointer;
  user-select: none;
}

.cstep-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--clr-cream-2);
  color: var(--clr-text-muted);
  font-weight: 700;
  font-size: .82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.cstep.active .cstep-num,
.cstep.done   .cstep-num {
  background: var(--clr-red);
  color: var(--clr-white);
}

.cstep-head-text { flex: 1; }

.cstep-head-text h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-dark);
  line-height: 1.2;
}

.cstep-head-text .cstep-selection {
  font-size: .8rem;
  color: var(--clr-text-muted);
  margin-top: .2rem;
}

.cstep.done .cstep-head-text .cstep-selection { color: var(--clr-red); }

.cstep-chevron {
  width: 20px;
  height: 20px;
  color: var(--clr-text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.cstep.active .cstep-chevron {
  transform: rotate(180deg);
  color: var(--clr-red);
}

.cstep-body {
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cstep.active .cstep-body { max-height: 2000px; }

.cstep-body-inner {
  padding: 0 1.5rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.cstep-body-inner::-webkit-scrollbar       { width: 6px; }
.cstep-body-inner::-webkit-scrollbar-track { background: transparent; }
.cstep-body-inner::-webkit-scrollbar-thumb {
  background: rgba(192, 57, 43, .25);
  border-radius: 3px;
}
.cstep-body-inner::-webkit-scrollbar-thumb:hover {
  background: rgba(192, 57, 43, .45);
}

/* ═══════════════════════════════════════════════
   ШАГ 1: ЯРУСЫ
   ═══════════════════════════════════════════════ */
.tier-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tier-option {
  border: 2px solid var(--clr-cream-2);
  border-radius: var(--radius-md);
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--clr-cream);
}

.tier-option:hover {
  border-color: rgba(192, 57, 43, .35);
  background: var(--clr-white);
}

.tier-option.selected {
  border-color: var(--clr-red);
  background: var(--clr-white);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}

.tier-option .tier-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: .6rem;
  line-height: 1;
  transition: transform var(--transition);
}

.tier-option .tier-img {
  width: 80px;
  height: 70px;
  object-fit: contain;
  display: block;
  margin: 0 auto .6rem;
  transition: transform var(--transition);
}

.tier-option:hover .tier-img,
.tier-option.selected .tier-img {
  transform: scale(1.08);
}

.tier-option .tier-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-dark);
}

.tier-option .tier-weight {
  font-size: .78rem;
  color: var(--clr-text-muted);
  margin-top: .25rem;
}

.tier-option .tier-check {
  position: absolute;
  top: .6rem;
  right: .6rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--clr-red);
  color: var(--clr-white);
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.5);
  transition: all var(--transition);
}

.tier-option.selected .tier-check {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════════════
   ВЕС
   ═══════════════════════════════════════════════ */
.weight-picker { margin-top: 1.2rem; }

.weight-label {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--clr-dark);
  margin-bottom: .6rem;
}

.weight-options {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.weight-opt {
  padding: .45rem .85rem;
  border: 2px solid var(--clr-cream-2);
  border-radius: var(--radius-sm, 8px);
  font-size: .82rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--clr-cream);
  user-select: none;
}

.weight-opt:hover {
  border-color: rgba(192, 57, 43, .35);
  color: var(--clr-dark);
  background: var(--clr-white);
}

.weight-opt.selected {
  border-color: var(--clr-red);
  color: var(--clr-red);
  background: var(--clr-white);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}

/* ═══════════════════════════════════════════════
   ШАГ 2: НАЧИНКИ
   ═══════════════════════════════════════════════ */
.tier-filling-block { margin-bottom: 1.2rem; }
.tier-filling-block:last-child { margin-bottom: 0; }

.tier-filling-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-red);
  margin-bottom: .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.tier-filling-label span {
  flex: 1;
  height: 1px;
  background: var(--clr-cream-2);
}

.fillings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .75rem;
}

.filling-opt {
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition);
}

.filling-opt:hover { transform: translateY(-4px); }

.filling-opt-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-cream-2);
  border: 2.5px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: .4rem;
}

.filling-opt-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}

.filling-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  border-radius: var(--radius-md);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  aspect-ratio: 1;
  transition: transform .4s ease;
}

.filling-opt:hover .filling-opt-img img,
.filling-opt:hover .filling-placeholder {
  transform: scale(1.08);
}

.filling-opt.selected .filling-opt-img {
  border-color: var(--clr-red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .2);
}

.filling-opt-name {
  font-size: .72rem;
  line-height: 1.3;
  color: var(--clr-text-muted);
  font-weight: 500;
}

.filling-opt.selected .filling-opt-name {
  color: var(--clr-red);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   ШАГ 3: ПОКРЫТИЯ
   ═══════════════════════════════════════════════ */
.coating-cat-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin: 1rem 0 .7rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.coating-cat-label span {
  flex: 1;
  height: 1px;
  background: var(--clr-cream-2);
}

.coating-cat-label:first-child { margin-top: 0; }

.coatings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .65rem;
}

.coating-opt {
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition);
}

.coating-opt:hover { transform: translateY(-4px); }

.coating-opt-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-cream-2);
  border: 2.5px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: .35rem;
}

.coating-opt-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .4s ease;
  display: block;
}

.coating-opt:hover .coating-opt-img img { transform: scale(1.07); }

.coating-opt.selected .coating-opt-img {
  border-color: var(--clr-red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .2);
}

.coating-opt-name {
  font-size: .68rem;
  line-height: 1.3;
  color: var(--clr-text-muted);
  font-weight: 500;
}

.coating-opt.selected .coating-opt-name {
  color: var(--clr-red);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   ШАГ 5: ПРОМОКОД И СЕРТИФИКАТ
   ═══════════════════════════════════════════════ */
.promo-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.promo-input-row { display: flex; gap: .6rem; }

.promo-input-row input {
  flex: 1;
  padding: .75rem 1rem;
  border: 2px solid var(--clr-cream-2);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--clr-dark);
  background: var(--clr-cream);
  outline: none;
  transition: border-color var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.promo-input-row input::placeholder {
  text-transform: none;
  letter-spacing: 0;
  color: var(--clr-text-muted);
  opacity: .7;
}

.promo-input-row input:focus   { border-color: var(--clr-red);        background: var(--clr-white); }
.promo-input-row input.valid   { border-color: #27ae60;               background: #f0fff4; }
.promo-input-row input.invalid { border-color: var(--clr-red-light);  background: #fff5f5; }

.promo-apply-btn {
  padding: .75rem 1.2rem;
  background: var(--clr-dark);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.promo-apply-btn:hover {
  background: var(--clr-red);
  transform: translateY(-1px);
}

.promo-apply-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.promo-status {
  font-size: .82rem;
  font-weight: 600;
  min-height: 1.2rem;
  transition: all .2s ease;
}

.promo-status.ok { color: #27ae60; }
.promo-status.err { color: var(--clr-red-light); }

/* ═══════════════════════════════════════════════
   ШАГ 6: ФОРМА ЗАКАЗА
   ═══════════════════════════════════════════════ */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-form input,
.order-form textarea {
  width: 100%;
  padding: .8rem 1.1rem;
  border: 2px solid var(--clr-cream-2);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--clr-dark);
  background: var(--clr-cream);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.order-form input:focus,
.order-form textarea:focus {
  border-color: var(--clr-red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .1);
  background: var(--clr-white);
}

.order-form textarea {
  resize: vertical;
  min-height: 90px;
}

.order-form .form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: .4rem;
}

/* ═══════════════════════════════════════════════
   ШАГ 4: ДЕКОР
   ═══════════════════════════════════════════════ */
.decor-grid {
  overflow-anchor: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.decor-opt {
  border: 2px solid var(--clr-cream-2);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--clr-cream);
  text-align: center;
}

.decor-opt:hover {
  border-color: rgba(192, 57, 43, .35);
  background: var(--clr-white);
}

.decor-opt.selected {
  border-color: var(--clr-red);
  background: var(--clr-white);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}

.decor-opt-name {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--clr-dark);
}

.decor-opt-desc {
  font-size: .75rem;
  color: var(--clr-text-muted);
  margin-top: .25rem;
}

.decor-opt-price {
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-red);
  margin-top: .4rem;
}

.decor-opt.selected .decor-opt-name { color: var(--clr-red); }

/* ═══════════════════════════════════════════════
   БЛОК ЦЕНЫ
   ═══════════════════════════════════════════════ */
.price-block {
  overflow-anchor: none;
  background: var(--clr-dark);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  margin-top: .5rem;
}

.price-block-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  margin-bottom: .6rem;
}

.price-block-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .88rem;
  color: rgba(255, 255, 255, .6);
  padding: .3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  gap: .5rem;
}

.price-block-row:last-of-type { border-bottom: none; }

.price-block-row .price-num {
  font-weight: 600;
  color: var(--clr-white);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.price-block-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.price-block-total .total-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .7);
  font-style: italic;
}

.price-block-total .total-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--clr-white);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.price-block-total .total-price .currency-icon {
  width: 1.3rem;
  height: 1.3rem;
}

.price-block .currency-icon {
  filter: invert(1);
  opacity: .85;
}

.discount-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(39, 174, 96, .15);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, .3);
  border-radius: var(--radius-xl);
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .75rem;
  margin-top: .6rem;
}

/* ═══════════════════════════════════════════════
   КНОПКА ОТПРАВКИ
   ═══════════════════════════════════════════════ */
.submit-btn {
  width: 100%;
  padding: 1.1rem;
  background: var(--clr-red);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: var(--shadow-red);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-top: .5rem;
}

.submit-btn:hover:not(:disabled) {
  background: var(--clr-red-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(192, 57, 43, .45);
}

.submit-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.submit-btn .btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}

.submit-btn.loading .btn-spinner { display: block; }
.submit-btn.loading .btn-text    { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.order-notice {
  font-size: .76rem;
  color: var(--clr-text-muted);
  text-align: center;
  line-height: 1.5;
  margin-top: .5rem;
}

/* ═══════════════════════════════════════════════
   ЧЕКБОКС СОГЛАСИЯ (ИСПРАВЛЕНО: убран пробел)
   ═══════════════════════════════════════════════ */
.privacy-checkbox {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: .8rem 0;
  cursor: pointer;
  user-select: none;
}

.privacy-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.privacy-checkbox-mark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--clr-text-muted);
  border-radius: 4px;
  margin-top: 2px;
  position: relative;
  transition: .18s ease;
  background: var(--clr-white);
}

.privacy-checkbox-mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid var(--clr-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .2s ease;
}

.privacy-checkbox input:checked + .privacy-checkbox-mark {
  background: var(--clr-red);
  border-color: var(--clr-red);
}

.privacy-checkbox input:checked + .privacy-checkbox-mark::after {
  transform: rotate(45deg) scale(1);
}

.privacy-checkbox input:focus-visible + .privacy-checkbox-mark {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .25);
}

.privacy-checkbox-text {
  font-size: .85rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
}

.privacy-checkbox-text a {
  color: var(--clr-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-checkbox-text a:hover { color: var(--clr-red-deep); }

/* ═══════════════════════════════════════════════
   ЭКРАН УСПЕХА
   ═══════════════════════════════════════════════ */
.order-success {
  text-align: center;
  padding: 2.5rem 1.5rem;
  display: none;
}

.order-success.show { display: block; }

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(39, 174, 96, .12);
  border: 2px solid rgba(39, 174, 96, .3);
  color: #27ae60;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  animation: successPop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.order-success h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-dark);
  margin-bottom: .6rem;
}

.order-success p {
  font-size: .92rem;
  color: var(--clr-text-muted);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════
   НАВИГАЦИЯ ШАГОВ
   ═══════════════════════════════════════════════ */
.step-nav {
  display: flex;
  gap: .75rem;
  margin-top: 1.2rem;
  padding-top: .75rem;
  border-top: 1px solid var(--clr-cream-2);
}

.step-nav .btn-prev {
  padding: .75rem 1.4rem;
  background: var(--clr-cream-2);
  color: var(--clr-dark);
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: all var(--transition);
}

.step-nav .btn-prev:hover {
  background: var(--clr-dark);
  color: var(--clr-white);
}

.step-nav .btn-next {
  flex: 1;
  padding: .8rem 1.4rem;
  background: var(--clr-red);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-red);
}

.step-nav .btn-next:hover {
  background: var(--clr-red-deep);
  transform: translateY(-1px);
}

.step-nav .btn-next:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .constructor-inner {
    grid-template-columns: 1fr 380px;
    gap: 2rem;
  }
}

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

  .constructor-viz {
    position: static;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
  }

  .constructor-steps-bar {
    position: static;
    padding-top: 1.5rem;
  }
}

@media (max-width: 600px) {
  .steps-bar-inner {
    overflow-x: auto;
    gap: 0;
  }

  .step-bar-label { display: none; }

  .fillings-grid  { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
  .coatings-grid  { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .tier-picker    { grid-template-columns: 1fr 1fr; }
}

/* MOBILE OVERFLOW FIX */
@media(max-width:768px){
html,body{overflow-x:hidden!important;max-width:100vw}
.constructor-hero{padding:6rem 1rem 3rem}
.constructor-hero h1{font-size:1.8rem}
.constructor-hero p{font-size:.9rem}
.deco-ball{display:none}
.constructor-steps-bar{padding:1rem 0;top:56px}
.steps-bar-inner{overflow-x:visible;flex-wrap:wrap;gap:.25rem;justify-content:center;padding-bottom:.5rem}
.step-bar-item{flex:0 0 auto}
.step-bar-num{width:28px;height:28px;font-size:.7rem}
.step-bar-label{font-size:.65rem}
.constructor-body{padding:1.5rem 1rem 3rem}
.constructor-inner{max-width:100%;grid-template-columns:1fr;gap:1.5rem}
.viz-canvas-wrap{aspect-ratio:1/1;max-height:300px}.cake-scene .tier{max-height:140px!important}
.fillings-grid{grid-template-columns:repeat(3,1fr);gap:.5rem}
.filling-opt-img{overflow:hidden;width:80px;height:80px;border-radius:10px}.filling-opt-img img{width:100%;height:100%;object-fit:cover;transform:scale(1.12)}.filling-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:1.8rem;font-weight:700;color:rgba(0,0,0,.2);border-radius:10px}
.filling-opt-name{font-size:.7rem}
.coatings-grid{grid-template-columns:repeat(3,1fr);gap:.5rem}
.decor-grid{grid-template-columns:1fr;gap:.5rem}
.tier-picker{gap:.75rem}
.tier-img{max-width:120px}
.step-nav{flex-direction:column;gap:.5rem}
.btn-next,.btn-prev{width:100%;text-align:center}
.order-form input,.order-form textarea{font-size:16px}
.privacy-checkbox-text{font-size:.8rem}
.submit-btn{width:100%}
}

/* ═══════════════════════════════════════════════
   АДАПТИВНОСТЬ — МОБИЛЬНАЯ ВЕРСИЯ (ПОЛНЫЙ РЕРАЙТ)
   ═══════════════════════════════════════════════ */

/* Планшет: до 1100px */
@media (max-width: 1100px) {
  .constructor-inner {
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
  }
}

/* Планшет: до 900px — одна колонка */
@media (max-width: 900px) {
  .constructor-inner {
    grid-template-columns: 1fr;
  }

  .constructor-viz {
    position: static;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
  }

  .constructor-steps-bar {
    position: static;
    padding-top: 1.5rem;
  }
}

/* Мобильный: до 768px */
@media (max-width: 768px) {
  /* Предотвращаем горизонтальный скролл */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }

  /* Hero секция */
  .constructor-hero {
    padding: 5rem 1rem 2.5rem;
  }

  .constructor-hero h1 {
    font-size: 1.7rem;
    line-height: 1.2;
  }

  .constructor-hero p {
    font-size: .88rem;
    padding: 0 .5rem;
  }

  .constructor-hero-label {
    font-size: .68rem;
  }

  /* Декоративные шары — убираем */
  .deco-ball {
    display: none;
  }

  /* Прогресс-бар шагов */
  .constructor-steps-bar {
    padding: 1rem 0;
    top: 56px;
  }

  .steps-bar-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: flex-start;
    padding-bottom: .5rem;
    scrollbar-width: none;
  }

  .steps-bar-inner::-webkit-scrollbar { display: none; }

  .step-bar-item {
    flex: 1 0 0;
    min-width: 52px;
  }

  .step-bar-item::before {
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    top: 14px;
  }

  .step-bar-num {
    width: 28px;
    height: 28px;
    font-size: .7rem;
  }

  .step-bar-label {
    font-size: .62rem;
  }

  /* Основной layout */
  .constructor-body {
    padding: 1.5rem 1rem 3rem;
  }

  .constructor-inner {
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Визуализация торта */
  .constructor-viz {
    position: static;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
  }

  .viz-canvas-wrap {
    aspect-ratio: 1 / 1;
    max-height: 300px;
    padding: 1rem;
    margin: 0 auto;
  }

  .viz-summary {
    overflow-anchor: none;
    padding: 1rem;
    font-size: .82rem;
  }

  /* Шаги конструктора */
  .constructor-steps {
    gap: 1rem;
  }

  .cstep-head {
    padding: 1rem 1.2rem;
  }

  .cstep-head-text h3 {
    font-size: .95rem;
  }

  .cstep-body-inner {
    padding: 0 1.2rem 1.2rem;
  }

  /* Шаг 1: Ярусы */
  .tier-picker {
    gap: .75rem;
  }

  .tier-option {
    padding: 1rem .8rem;
  }

  .tier-img {
    max-width: 100px;
    height: auto;
  }

  .tier-title {
    font-size: .9rem;
  }

  .tier-weight {
    font-size: .72rem;
  }

  .weight-opt {
    padding: .4rem .7rem;
    font-size: .78rem;
  }

  /* Шаг 2: Начинки */
  .fillings-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
  }

  .filling-opt-img {
    border-width: 2px;
  }

  .filling-opt-name {
    font-size: .68rem;
  }

  .tier-filling-label {
    font-size: .72rem;
    margin-bottom: .6rem;
  }

  /* Шаг 3: Покрытия */
  .coatings-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
  }

  .coating-opt-name {
    font-size: .65rem;
  }

  .coating-cat-label {
    font-size: .7rem;
    margin: .8rem 0 .5rem;
  }

  /* Шаг 4: Декор */
  .decor-grid {
    overflow-anchor: none;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }

  .decor-opt {
    padding: .8rem;
  }

  .decor-opt-name {
    font-size: .85rem;
  }

  .decor-opt-desc {
    font-size: .68rem;
  }

  .decor-opt-price {
    font-size: .78rem;
  }

  /* Шаг 5: Промокод */
  .promo-input-row {
    flex-direction: column;
    gap: .5rem;
  }

  .promo-input-row input {
    font-size: 16px; /* предотвращает зум на iOS */
    padding: .7rem .9rem;
  }

  .promo-apply-btn {
    width: 100%;
    padding: .7rem;
    font-size: .82rem;
  }

  /* Шаг 6: Форма заказа */
  .order-form input,
  .order-form textarea {
    font-size: 16px; /* предотвращает зум на iOS */
    padding: .7rem .9rem;
  }

  .order-form textarea {
    min-height: 80px;
  }

  .order-form .form-group label {
    font-size: .74rem;
  }

  /* Чекбокс согласия */
  .privacy-checkbox {
    margin: .6rem 0;
  }

  .privacy-checkbox-text {
    font-size: .78rem;
    line-height: 1.4;
  }

  /* Кнопка отправки */
  .submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: .95rem;
  }

  /* Навигация шагов */
  .step-nav {
    flex-direction: column;
    gap: .5rem;
  }

  .btn-next,
  .btn-prev {
    width: 100%;
    text-align: center;
    padding: .75rem 1rem;
  }

  /* Блок цены */
  .price-block {
    padding: 1.2rem 1.4rem;
  }

  .price-block-label {
    font-size: .68rem;
  }

  .price-block-row {
    font-size: .82rem;
  }

  .price-block-total .total-price {
    font-size: 1.5rem;
  }

  /* Экран успеха */
  .order-success {
    padding: 2rem 1rem;
  }

  .order-success h3 {
    font-size: 1.3rem;
  }

  .order-success p {
    font-size: .85rem;
  }

  .success-icon {
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
  }
}

/* Маленькие телефоны: до 480px */
@media (max-width: 480px) {
  .constructor-hero {
    padding: 4.5rem .8rem 2rem;
  }

  .constructor-hero h1 {
    font-size: 1.45rem;
  }

  .constructor-hero p {
    font-size: .82rem;
  }

  .fillings-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
  }

  .coatings-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
  }

  .decor-grid {
    overflow-anchor: none;
    grid-template-columns: 1fr;
  }

  .tier-picker {
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }

  .tier-img {
    max-width: 80px;
  }

  .step-bar-num {
    width: 24px;
    height: 24px;
    font-size: .62rem;
  }

  .step-bar-label {
    font-size: .55rem;
  }

  .cstep-head {
    padding: .8rem 1rem;
  }

  .cstep-body-inner {
    padding: 0 1rem 1rem;
  }

  .price-block {
    padding: 1rem;
  }

  .price-block-total .total-price {
    font-size: 1.3rem;
  }
}

/* Очень маленькие: до 360px */
@media (max-width: 360px) {
  .constructor-hero h1 {
    font-size: 1.3rem;
  }

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

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