/* =================== 058-hc-cart-sum.css =================== */
/* hc-cart-sum — single source-of-truth for cart Итого sidebar (right column
   on /cart page). Self-contained component: unified card surface, consistent
   gaps, gold accent on title, divided rows, proper button separation, promo
   row with inline submit. Strict: .hc-cart-sum / .hc-cart-sum__*. */

.hc-cart-sum {
  position: sticky;
  top: calc(var(--hc-hdr-h, 72px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 1.8vw, 26px);
  background:
    linear-gradient(180deg, var(--hc-paper, #ffffff) 0%, rgba(252, 246, 234, 0.78) 100%);
  border: 0.5px solid rgba(141, 109, 71, 0.22);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(40, 30, 15, 0.03),
    0 22px 44px -28px rgba(40, 30, 15, 0.18);
  isolation: isolate;
}

/* ─── Title with gold underline ─── */
.hc-cart-sum__title {
  position: relative;
  margin: 0 0 6px;
  padding: 0 0 14px;
  font-family: var(--hc-serif, "Playfair Display", Georgia, serif);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--hc-ink, #1a1714);
}
.hc-cart-sum__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, var(--hc-gold, #d4b896), var(--hc-accent, #8b7355));
  border-radius: 2px;
}

/* ─── Sum rows (label ↔ value) ─── */
.hc-cart-sum__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--hc-sans, "Outfit", sans-serif);
  font-size: 14px;
  color: var(--hc-ink-soft, rgba(26, 23, 20, 0.78));
}
.hc-cart-sum__row > span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--hc-ink, #1a1714);
  text-align: right;
  white-space: nowrap;
}

.hc-cart-sum__row--discount {
  color: var(--hc-success, #3d6b4f);
}
.hc-cart-sum__row--discount > span:last-child {
  color: var(--hc-success, #3d6b4f);
  font-weight: 600;
}

/* Total row: bigger, with dashed divider above */
.hc-cart-sum__row--tot {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 0.5px dashed rgba(141, 109, 71, 0.28);
  font-size: 15px;
  color: var(--hc-ink, #1a1714);
}
.hc-cart-sum__row--tot strong {
  font-family: var(--hc-serif, "Playfair Display", Georgia, serif);
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ─── Installment card (uses .hc-card--gold base, just internal layout) ─── */
/* ─── Note block (Перед оформлением...) — leading shield icon ─── */
.hc-cart-sum__note {
  position: relative;
  padding: 14px 16px 14px 50px;
  background: rgba(212, 184, 150, 0.10);
  border: 0.5px solid rgba(141, 109, 71, 0.18);
  border-radius: 12px;
}
.hc-cart-sum__note::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 16px;
  width: 22px;
  height: 22px;
  background-color: var(--hc-accent-dark, #7a6548);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'><path d='M12 2L4 6v6c0 5 3.5 9 8 10 4.5-1 8-5 8-10V6z'/><path d='M9 12l2 2 4-4'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'><path d='M12 2L4 6v6c0 5 3.5 9 8 10 4.5-1 8-5 8-10V6z'/><path d='M9 12l2 2 4-4'/></svg>") center/contain no-repeat;
}
.hc-cart-sum__note strong {
  display: block;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hc-ink, #1a1714);
}
.hc-cart-sum__note p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ─── Action buttons: explicit separation between B2B and primary CTA ─── */
.hc-cart-sum__b2b {
  margin-top: 6px;
}
.hc-cart-sum__cta {
  margin-top: 4px;
}

/* ─── Progress (свободная доставка) reset margin since parent has gap ─── */
.hc-cart-sum .hc-cart-progress {
  margin-top: 0;
}

/* ─── Promo form: input + inline submit button, dashed divider above ─── */
.hc-cart-sum__promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 0.5px dashed rgba(141, 109, 71, 0.28);
}
.hc-cart-sum__promo-input {
  min-inline-size: 0;
}
.hc-cart-sum__promo .hc-btn {
  white-space: nowrap;
}

/* ─── Mobile: drop sticky + tighten padding ─── */
@media (max-width: 1023px) {
  .hc-cart-sum {
    position: static;
    top: auto;
  }
}
@media (max-width: 640px) {
  .hc-cart-sum {
    padding: 18px;
    gap: 12px;
  }
}
