/* =========================================================
   checkout.css — GHOSTFRAME Checkout
   Light / neutral theme
   ========================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-primary, 'Inter', 'DM Sans', 'Helvetica Neue', system-ui, sans-serif);
  background: #f5f4f0;
  color: #111;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Lang toggle ── */
.lang-toggle { display: flex; gap: 4px; align-items: center; }
.lang-btn {
  background: none; border: none;
  color: rgba(0,0,0,0.35);
  font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer;
  font-family: inherit; font-weight: 400;
  transition: color .2s;
}
.lang-btn.active { color: #111; font-weight: 700; }
.lang-sep { color: rgba(0,0,0,0.2); font-size: 10px; }

/* ── Processing overlay (stays dark) ── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; flex-direction: column; gap: 24px;
}
.overlay.show { display: flex; }
.spinner {
  width: 28px; height: 28px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay p {
  font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
  font-weight: 400;
}

/* ── Main layout ── */
.checkout-main {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--nav-height, 60px) + 56px) 24px 100px;
}

/* ══════════════════════════════════════════════════════════
   STEPPER
══════════════════════════════════════════════════════════ */
.stepper { margin-bottom: 56px; }

.stepper-track {
  display: flex;
  align-items: center;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: #f5f4f0;
  transition: border-color .3s, background .3s;
}

.step-num {
  font-size: 10px; font-weight: 700;
  color: rgba(0,0,0,0.3);
  transition: opacity .3s;
}

.step-check {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 8px;
  opacity: 0; transition: opacity .3s;
  color: #000;
}

.step-line {
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.12);
  margin-bottom: 22px;
  transition: background .3s;
}

.step-label {
  font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.3);
  font-weight: 400; white-space: nowrap;
  transition: color .3s;
}

/* Active */
.step.active .step-circle { border-color: rgba(0,0,0,0.5); }
.step.active .step-num    { color: #111; }
.step.active .step-label  { color: rgba(0,0,0,0.75); font-weight: 600; }

/* Completed */
.step.completed .step-circle   { border-color: #111; background: #111; }
.step.completed .step-num      { opacity: 0; }
.step.completed .step-check    { opacity: 1; color: #f5f4f0; }
.step.completed .step-label    { color: rgba(0,0,0,0.45); }
.step.completed + .step-line   { background: rgba(0,0,0,0.3); }

/* ══════════════════════════════════════════════════════════
   PANELS (static HTML — shown when checkout.js doesn't run)
══════════════════════════════════════════════════════════ */
.checkout-panel { display: none; }
.checkout-panel.active {
  display: block;
  animation: panelIn .25s ease;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-title {
  font-size: 18px; font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* ── Order Review ── */
.order-items {
  border: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.order-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.order-item:last-child { border-bottom: none; }

.order-item-info { flex: 1; }
.order-item-name { font-size: 13px; font-weight: 600; }
.order-item-meta { font-size: 11px; color: rgba(0,0,0,0.45); margin-top: 3px; }
.order-item-qty  { font-size: 12px; color: rgba(0,0,0,0.45); }
.order-item-price { font-size: 13px; font-weight: 700; min-width: 80px; text-align: right; }

.empty-cart {
  padding: 40px 24px; color: rgba(0,0,0,0.4);
  font-size: 13px; text-align: center;
}

/* Order summary */
.order-summary {
  border: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 36px;
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 13px; color: rgba(0,0,0,0.55);
}
.summary-row:last-child { border-bottom: none; }
.summary-row--total {
  font-size: 15px; font-weight: 700; color: #111;
}

/* ── Forms ── */
.checkout-form {
  display: flex; flex-direction: column; gap: 24px;
  margin-bottom: 36px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(0,0,0,0.45);
}

.form-input {
  width: 100%; height: 44px; padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  border-radius: 0;
  color: #111;
  font-family: inherit; font-size: 14px; font-weight: 400;
  outline: none;
  transition: border-color .2s;
  appearance: none;
}
.form-input:focus { border-bottom-color: rgba(0,0,0,0.6); }
.form-input.invalid { border-bottom-color: #c62828; }
.form-input::placeholder { color: rgba(0,0,0,0.25); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(0,0,0,0.35)'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center;
  background-size: 8px; padding-right: 24px; cursor: pointer;
  background-color: transparent;
  color: rgba(0,0,0,0.8);
}
.form-select option { background: #fff; color: #111; }

.form-error {
  font-size: 11px; color: #c62828; min-height: 14px; font-weight: 400;
}

.secure-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: rgba(0,0,0,0.35);
  letter-spacing: .03em; margin-top: 8px;
}
.secure-note svg { flex-shrink: 0; color: rgba(0,0,0,0.35); }

/* ── Confirm ── */
.confirm-summary {
  border: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 24px;
}
.confirm-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.confirm-section:last-child { border-bottom: none; }
.confirm-label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(0,0,0,0.35); margin-bottom: 8px;
}
.confirm-value { font-size: 13px; color: rgba(0,0,0,0.6); line-height: 1.6; }
.confirm-total { font-size: 16px; font-weight: 700; color: #111; }

.terms-note {
  font-size: 11px; color: rgba(0,0,0,0.35);
  margin-bottom: 32px; line-height: 1.6;
}
.terms-note a { color: rgba(0,0,0,0.55); text-decoration: underline; }

/* ── Panel actions ── */
.panel-actions { display: flex; justify-content: flex-end; }
.panel-actions--split { justify-content: space-between; }

.btn-next, .btn-place {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 32px; height: 48px;
  background: #111; color: #f5f4f0;
  font-family: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  border: none; border-radius: 0; cursor: pointer;
  transition: opacity .2s;
}
.btn-next:hover, .btn-place:hover { opacity: .8; }
.btn-next:disabled, .btn-place:disabled {
  background: rgba(0,0,0,0.15); color: rgba(0,0,0,0.3); cursor: not-allowed;
}

.btn-back {
  display: inline-flex; align-items: center;
  padding: 0 20px; height: 48px;
  background: transparent; color: rgba(0,0,0,0.45);
  font-family: inherit; font-size: 11px; font-weight: 400;
  letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid rgba(0,0,0,0.2); border-radius: 0;
  cursor: pointer; transition: color .2s, border-color .2s;
}
.btn-back:hover { color: #111; border-color: rgba(0,0,0,0.5); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .checkout-main { padding: calc(var(--nav-height-mobile, 52px) + 36px) 20px 80px; }
  .form-row { grid-template-columns: 1fr; }
  .step-label { display: none; }
  .stepper { margin-bottom: 36px; }
}

/* ══════════════════════════════════════════════════════════
   CHECKOUT.JS RENDERED LAYOUT
   checkout.js replaces #main content with .panel-bag + .panel-form
══════════════════════════════════════════════════════════ */

/* Two-column layout on wide screens */
#main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--nav-height, 60px) + 56px) 40px 100px;
}

@media (max-width: 800px) {
  #main {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: calc(var(--nav-height-mobile, 52px) + 36px) 20px 80px;
  }
}

/* ── Panel headings ── */
.panel-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.4);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* ── Bag items ── */
.bag-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.bag-item:first-of-type { border-top: 1px solid rgba(0,0,0,0.07); }

.bag-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #e8e7e3;
  flex-shrink: 0;
}

.bag-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bag-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  letter-spacing: -.01em;
}

.bag-item-meta {
  font-size: 12px;
  color: rgba(0,0,0,0.4);
}

/* Qty controls */
.qty-ctrl {
  display: flex;
  align-items: center;
  margin-top: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  width: fit-content;
}

.qty-btn {
  background: transparent;
  border: none;
  color: rgba(0,0,0,0.5);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  width: 32px;
  height: 28px;
  cursor: pointer;
  transition: color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.qty-btn:hover { color: #111; background: rgba(0,0,0,0.05); }

.qty-val {
  font-size: 12px;
  font-weight: 600;
  color: #111;
  width: 28px;
  text-align: center;
  padding: 0 2px;
}

.remove-btn {
  background: none;
  border: none;
  color: rgba(0,0,0,0.25);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  margin-top: 6px;
  transition: color .15s;
  width: fit-content;
}
.remove-btn:hover { color: #c62828; }

/* Price column */
.bag-item-price-col {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.bag-item-price {
  font-size: 13px;
  font-weight: 700;
  color: #111;
}

/* ── Totals ── */
.totals {
  margin-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 16px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.total-row .label {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
}

.total-row .value {
  font-size: 12px;
  color: rgba(0,0,0,0.65);
}

.total-row.grand {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.total-row.grand .label {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.total-row.grand .value {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

/* ── Benefits ── */
.benefits {
  margin-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.benefit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.benefit-label {
  font-size: 11px;
  color: rgba(0,0,0,0.45);
  letter-spacing: .03em;
}

.benefit-plus {
  font-size: 12px;
  color: rgba(0,0,0,0.25);
}

/* ── Form panel ── */
.panel-form {
  display: flex;
  flex-direction: column;
}

/* Form fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.45);
}

.form-field input {
  width: 100%;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  border-radius: 0;
  color: #111;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  outline: none;
  transition: border-color .2s;
  appearance: none;
}
.form-field input:focus { border-bottom-color: rgba(0,0,0,0.6); }
.form-field input::placeholder { color: rgba(0,0,0,0.25); }

/* City + postal two-column row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* Section header */
.form-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.35);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

/* ── Payment ── */
.pay-section {
  margin-top: 8px;
  margin-bottom: 24px;
}

.pay-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.45);
  margin-bottom: 12px;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  cursor: pointer;
}

.pay-option input[type="radio"] {
  accent-color: #111;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.pay-option label {
  font-size: 13px;
  color: rgba(0,0,0,0.7);
  cursor: pointer;
}

/* ── Submit button ── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: #111;
  color: #f5f4f0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 4px;
}
.btn-submit:hover { opacity: .8; }
.btn-submit:disabled {
  background: rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.3);
  cursor: not-allowed;
}

/* ── Error message ── */
.error-msg {
  font-size: 12px;
  color: #c62828;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height .25s, margin .25s;
}
.error-msg.show {
  max-height: 60px;
  margin-bottom: 16px;
}

/* ── Empty state ── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  gap: 12px;
}

.empty-state h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #111;
}

.empty-state p {
  font-size: 13px;
  color: rgba(0,0,0,0.4);
}

.empty-state a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  height: 44px;
  background: #111;
  color: #f5f4f0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  margin-top: 8px;
  transition: opacity .2s;
}
.empty-state a:hover { opacity: .8; }
