/* ============================================================
   TONGRAAL — Cart & Checkout Page
   ============================================================ */

.cart-page { min-height: 100vh; background: var(--bg); }

/* ── Page layout ── */
.cart-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 5rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2.5rem;
  align-items: start;
}

/* ── Back + breadcrumb ── */
.cart-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13px;
  color: var(--ink-mute);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.cart-back:hover { color: var(--ink); }
.cart-back svg { width: 14px; height: 14px; stroke-width: 2; }

/* ── Section headings ── */
.cart-heading {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.cart-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 2rem;
}

/* ── Step progress bar ── */
.checkout-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-mute);
  flex: 1;
  position: relative;
}

.checkout-step.active { color: var(--accent); }
.checkout-step.done { color: var(--olive); }

.checkout-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checkout-step.active .checkout-step__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.checkout-step.done .checkout-step__num {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}

.checkout-step__label { white-space: nowrap; }

.checkout-step__line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 0.5rem;
  max-width: 3rem;
}

/* ── Step panels ── */
.checkout-panel { display: none; }
.checkout-panel.active { display: block; }

/* ============================================================
   STEP 1 — Cart items
   ============================================================ */
.cart-shop-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.cart-shop-group__head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.cart-shop-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-shop-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.cart-shop-shipping {
  font-size: 12px;
  color: var(--olive);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.cart-shop-shipping svg { width: 12px; height: 12px; stroke-width: 2; }

/* Cart item row */
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: start;
  transition: background 0.15s;
}
.cart-item:last-child { border-bottom: 0; }
.cart-item:hover { background: rgba(246,242,234,0.5); }

.cart-item__img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item__body { min-width: 0; }

.cart-item__shop {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 3px;
}

.cart-item__name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 4px;
}

.cart-item__variant {
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 0.5rem;
}

.cart-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.cart-item__qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 14px;
  transition: background 0.15s;
}
.cart-item__qty-btn:hover { background: var(--bg); color: var(--ink); }

.cart-item__qty-val {
  width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 4px;
  line-height: 28px;
}

.cart-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cart-item__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.cart-item__remove {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-mute);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.15s;
  padding: 0;
}
.cart-item__remove:hover { color: #C44A4A; }
.cart-item__remove svg { width: 12px; height: 12px; stroke-width: 2; }

/* Empty cart */
.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.cart-empty__icon { font-size: 3rem; margin-bottom: 1rem; }
.cart-empty__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.cart-empty__sub { font-size: 13.5px; color: var(--ink-mute); margin-bottom: 1.5rem; }
.cart-empty__btn {
  display: inline-block;
  padding: 0.7rem 1.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.cart-empty__btn:hover { background: var(--accent-deep); }

/* Cart notes */
.cart-note {
  margin-top: 0.5rem;
}
.cart-note__toggle {
  background: none;
  border: 0;
  font-size: 12.5px;
  color: var(--accent);
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  font-family: var(--sans);
}
.cart-note__toggle svg { width: 12px; height: 12px; stroke-width: 2; }
.cart-note__area {
  padding: 0 1.25rem 1rem;
  display: none;
}
.cart-note__area.visible { display: block; }
.cart-note__textarea {
  width: 100%;
  min-height: 70px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cart-note__textarea:focus { border-color: var(--accent); }

/* ============================================================
   STEP 2 — Shipping address
   ============================================================ */
.checkout-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.checkout-form-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.checkout-form-title svg { width: 14px; height: 14px; color: var(--olive); stroke-width: 2; }

.checkout-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

.checkout-field-grid--wide {
  grid-template-columns: 2fr 1fr;
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.checkout-field--full { grid-column: 1 / -1; }

.checkout-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.checkout-input,
.checkout-select {
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--ink);
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.checkout-input:focus,
.checkout-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,106,74,0.08);
}
.checkout-input::placeholder { color: var(--ink-mute); }

/* Save address checkbox */
.checkout-save-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.checkout-save-row input { accent-color: var(--accent); }

/* Saved addresses */
.saved-addresses {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.saved-addr-card {
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.saved-addr-card.selected {
  border-color: var(--accent);
  background: rgba(196,106,74,0.04);
}

.saved-addr-radio {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.saved-addr-card.selected .saved-addr-radio {
  border-color: var(--accent);
  background: var(--accent);
}
.saved-addr-card.selected .saved-addr-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}

.saved-addr-label { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.saved-addr-text { font-size: 12px; color: var(--ink-mute); line-height: 1.5; }

.new-addr-toggle {
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  width: 100%;
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s;
  margin-bottom: 1rem;
}
.new-addr-toggle:hover { border-color: var(--accent); background: rgba(196,106,74,0.03); }
.new-addr-toggle svg { width: 13px; height: 13px; stroke-width: 2; }

/* ============================================================
   STEP 3 — Payment
   ============================================================ */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}

.pay-method {
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.pay-method.selected {
  border-color: var(--accent);
  background: rgba(196,106,74,0.04);
}

.pay-method__radio {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pay-method.selected .pay-method__radio {
  border-color: var(--accent);
  background: var(--accent);
}
.pay-method.selected .pay-method__radio::after {
  content: '';
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
}

.pay-method__icon { font-size: 1.25rem; flex-shrink: 0; }

.pay-method__label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pay-method__desc { font-size: 11.5px; color: var(--ink-mute); margin-top: 1px; }

.pay-method__logos {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}

.card-logo {
  height: 20px;
  padding: 2px 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
}

/* Card form */
.card-form {
  display: none;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 0.75rem;
  padding: 1.25rem;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.card-form.visible { display: flex; }

.card-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.card-input-wrap {
  position: relative;
}
.card-input-wrap svg {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-mute);
  stroke-width: 1.5;
}

/* ── Security badge ── */
.checkout-security {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11.5px;
  color: var(--ink-mute);
  padding: 0.75rem 1rem;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 0.875rem;
}
.checkout-security svg { width: 14px; height: 14px; color: var(--olive); stroke-width: 2; }

/* ============================================================
   ORDER SUMMARY — Right column (all steps)
   ============================================================ */
.order-summary {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.order-summary__head {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-summary__toggle {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  border: 0;
  background: none;
  font-family: var(--sans);
  text-transform: none;
  letter-spacing: 0;
}

/* Summary items */
.summary-items {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.summary-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.summary-item__img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}

.summary-item__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-item__name {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}

.summary-item__variant { font-size: 11.5px; color: var(--ink-mute); }

.summary-item__price { font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* Summary totals */
.summary-totals {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
}

.summary-row--total {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  padding-top: 0.625rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.summary-row--savings { color: var(--olive); }

/* Promo code */
.summary-promo {
  padding: 0 1.25rem 1rem;
  display: flex;
  gap: 0.5rem;
}

.promo-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink);
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s;
}
.promo-input:focus { border-color: var(--accent); }
.promo-input::placeholder { color: var(--ink-mute); }

.promo-apply {
  padding: 0.55rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s;
}
.promo-apply:hover { border-color: var(--accent); color: var(--accent); }

/* CTA button */
.summary-cta {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.summary-cta-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.01em;
}
.summary-cta-btn:hover { background: var(--accent-deep); }
.summary-cta-btn:active { transform: scale(0.99); }

.summary-cta-note {
  text-align: center;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 0.625rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.summary-cta-note svg { width: 11px; height: 11px; color: var(--olive); stroke-width: 2; }

/* Shop shipping breakdown */
.summary-shipping-detail {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.summary-shipping-detail strong { color: var(--ink); font-weight: 600; }

/* ── Order confirmation overlay ── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43,36,32,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
.confirm-overlay.visible { display: flex; }

.confirm-card {
  background: var(--card);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  animation: popIn 0.35s ease;
  border: 1px solid var(--border);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-icon { font-size: 3.5rem; margin-bottom: 1.25rem; }

.confirm-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.confirm-sub {
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.confirm-order-num {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 1.75rem;
}

.confirm-shops {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.confirm-shop-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink);
}

.confirm-shop-row svg { width: 14px; height: 14px; color: var(--olive); stroke-width: 2; flex-shrink: 0; }

.confirm-actions {
  display: flex;
  gap: 0.75rem;
}

.confirm-btn {
  flex: 1;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-btn--primary {
  background: var(--accent);
  color: #fff;
  border: 0;
}
.confirm-btn--primary:hover { background: var(--accent-deep); }

.confirm-btn--secondary {
  background: none;
  color: var(--ink-soft);
  border: 1.5px solid var(--border);
}
.confirm-btn--secondary:hover { border-color: var(--hair); background: var(--bg); }

/* ── Nav bar override for this page ── */
.cart-nav-count { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem var(--gutter) 4rem;
  }
  .order-summary { position: static; }
  .checkout-field-grid { grid-template-columns: 1fr; }
  .checkout-field-grid--wide { grid-template-columns: 1fr; }
}
