/* ═══════════════════════════════════════════════════════════════════════════
   CART ICON IN HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.hero-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 10px;
  border: 1px solid rgba(70, 58, 38, 0.18);
  border-radius: 12px;
  background: #fff;
  color: #1f1d1a;
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.hero-cart-btn:hover {
  border-color: #e07020;
  color: #e07020;
  box-shadow: 0 4px 14px rgba(224, 112, 32, .18);
}
.hero-cart-btn__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5913d, #d56b1a);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(213, 107, 26, .35);
}
.hero-cart-btn__badge[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL (общий контейнер для корзины и заказа)
   ═══════════════════════════════════════════════════════════════════════════ */
.bd-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: flex-start;   /* flex-start + margin:auto на child = центрирование + скролл когда высокий */
  justify-content: center;
  padding: 38px 24px 24px;   /* доп. отступ сверху — место для кнопки × которая торчит выше */
  overflow-y: auto;          /* скролл на враппере, а не на модале */
}
.bd-modal-wrap.is-open { display: flex; }

.bd-modal-overlay {
  position: fixed;           /* fixed, чтобы не скроллился вместе с контентом */
  inset: 0;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(2px);
  animation: bdFade .18s ease;
}

.bd-modal {
  position: relative;
  width: 100%;
  max-width: 600px;
  overflow: visible;         /* нет обрезания — кнопка × свободно торчит наружу */
  padding: 28px 32px 32px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 14, 8, .35);
  animation: bdRise .22s ease;
  margin: auto;              /* центрирует когда контент короче viewport */
  flex-shrink: 0;            /* не сжимается flex-контейнером */
}

@keyframes bdFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes bdRise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }

.bd-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5913d, #d56b1a);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(213, 107, 26, .35);
  transition: transform .12s;
}
.bd-modal__close:hover { transform: scale(1.05); }

.bd-modal__title {
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: #1a1510;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CART MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.bd-cart__items {
  display: grid;
  gap: 14px;
  padding: 6px 0 18px;
  border-bottom: 1px solid #ede8e0;
}

.bd-cart__empty {
  padding: 28px 0;
  color: #847b6f;
  text-align: center;
  font-size: 15px;
}

.bd-cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 14px;
  align-items: center;
}
.bd-cart-item__img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3ede3;
}
.bd-cart-item__info { min-width: 0; }
.bd-cart-item__name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1510;
  line-height: 1.3;
}
.bd-cart-item__price-line {
  margin: 0;
  color: #847b6f;
  font-size: 13px;
}
.bd-cart-item__price-line strong {
  color: #d56b1a;
  font-weight: 700;
}
.bd-cart-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ede8e0;
  border-radius: 999px;
  background: #fff;
}
.bd-cart-item__qty-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #1a1510;
  font-size: 16px;
  cursor: pointer;
  transition: background .12s;
}
.bd-cart-item__qty-btn:hover { background: #f5f2ec; }
.bd-cart-item__qty-val {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}
.bd-cart-item__remove {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f5f2ec;
  color: #847b6f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.bd-cart-item__remove:hover { background: #fde5d3; color: #d56b1a; }

.bd-cart__total {
  text-align: center;
  padding: 18px 0 22px;
  font-size: 14px;
  color: #847b6f;
}
.bd-cart__total strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 800;
  color: #1a1510;
}

.bd-cart__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.bd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .15s, opacity .12s;
}
.bd-btn--primary {
  background: linear-gradient(180deg, #f5913d, #d56b1a);
  color: #fff;
  box-shadow: 0 6px 16px rgba(213, 107, 26, .25);
}
.bd-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(213, 107, 26, .35); }
.bd-btn--secondary {
  background: #fff;
  color: #d56b1a;
  border: 2px solid #f5913d;
}
.bd-btn--secondary:hover { background: #fff5ed; }
.bd-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════════════
   ORDER MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.bd-order__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
}
.bd-order__step {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ede8e0;
  color: #b6ac9c;
  font-weight: 700;
  font-size: 14px;
  transition: background .2s, color .2s;
}
.bd-order__step.is-active {
  background: linear-gradient(180deg, #f5913d, #d56b1a);
  color: #fff;
  box-shadow: 0 4px 10px rgba(213, 107, 26, .3);
}
.bd-order__step.is-done {
  background: #cde0c0;
  color: #4f6e3d;
}
.bd-order__step-line {
  flex: 0 0 200px;
  max-width: 240px;
  height: 2px;
  background: #ede8e0;
  position: relative;
}
.bd-order__step-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f5913d, #d56b1a);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.bd-order__step-line.is-active::after { transform: scaleX(1); }

.bd-order__page { display: none; }
.bd-order__page.is-active { display: block; animation: bdFade .25s ease; }

.bd-field {
  margin-bottom: 16px;
}
.bd-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #1a1510;
}
.bd-field__wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #ede8e0;
  border-radius: 12px;
  background: #fafaf6;
  transition: border-color .15s, background .15s;
}
.bd-field__wrap:focus-within {
  border-color: #f5913d;
  background: #fff;
}
.bd-field__icon {
  margin: 0 8px 0 14px;
  flex-shrink: 0;
  color: #b6ac9c;
}
.bd-field__icon--top { align-self: flex-start; margin-top: 14px; }
.bd-field__input {
  flex: 1;
  height: 48px;
  padding: 0 14px 0 4px;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: #1a1510;
  outline: none;
}
.bd-field__input--textarea {
  height: auto;
  padding: 14px 14px 14px 4px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.bd-order__submit {
  display: block;
  width: 100%;
  margin: 18px 0 14px;
}

.bd-order__agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #5d544a;
  cursor: pointer;
  text-align: center;
  justify-content: center;
}
.bd-order__agree input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #d56b1a;
  flex-shrink: 0;
  cursor: pointer;
}
.bd-order__agree-link { color: #d56b1a; text-decoration: underline; }

.bd-order__summary {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #ede8e0;
  border-radius: 14px;
  background: #fafaf6;
}
.bd-order__summary h3 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #1a1510;
}
.bd-order__summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
  color: #4d453d;
}
.bd-order__summary-item span:last-child { font-weight: 600; color: #1a1510; }
.bd-order__summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #ede8e0;
  font-size: 16px;
}
.bd-order__summary-total strong { color: #d56b1a; font-size: 18px; }
.bd-order__summary-contacts {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #ede8e0;
}
.bd-order__summary-contacts p {
  margin: 4px 0;
  font-size: 14px;
  color: #4d453d;
}
.bd-order__summary-contacts strong { color: #1a1510; }

.bd-order__success {
  text-align: center;
  padding: 12px 0 8px;
}
.bd-order__success svg { display: block; margin: 0 auto 16px; }
.bd-order__success h3 {
  margin: 0 0 8px;
  font-size: 22px;
  text-transform: uppercase;
  color: #1a1510;
}
.bd-order__success p {
  margin: 0 0 22px;
  color: #5d544a;
  font-size: 15px;
}

.bd-order__error {
  margin-top: 8px;
  color: #c33a3a;
  font-size: 13px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .bd-modal-wrap { padding: 30px 12px 16px; }
  .bd-modal { padding: 22px 18px 22px; border-radius: 16px; }
  .bd-modal__close { top: -12px; right: -8px; }
  .bd-cart-item { grid-template-columns: 50px 1fr; row-gap: 8px; }
  .bd-cart-item__qty { grid-column: 2; }
  .bd-cart-item__remove { grid-column: 2; justify-self: end; margin-top: -38px; }
  .bd-cart__actions { grid-template-columns: 1fr; }
  .bd-order__step-line { flex: 1; }
}
