/* ==========================================================
   Limka Knitters - Checkout page styles
   (loads after style.css, which provides the header, footer,
    buttons and colour variables)
   ========================================================== */

[hidden] { display: none !important; }

/* ---------- Page banner ---------- */
.page-banner {
  background:
    radial-gradient(circle at 90% 0%, rgba(242, 169, 0, 0.18), transparent 45%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 22px 0 28px;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span:last-child { color: #fff; font-weight: 500; }
.page-banner h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); line-height: 1.2; }

.progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.65);
}
.progress li { display: flex; align-items: center; gap: 8px; }
.progress li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.progress li.done { color: rgba(255, 255, 255, 0.9); }
.progress li.done::before { background: var(--accent); border-color: var(--accent); }
.progress li.current { color: #fff; font-weight: 600; }
.progress li.current::before { background: #fff; border-color: #fff; }

/* ---------- Page body ---------- */
.checkout-page { padding-top: 28px; padding-bottom: 64px; }
.cart-loading { text-align: center; color: var(--muted); padding: 60px 0; }

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Form cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.08rem;
  color: var(--brand);
  margin-bottom: 18px;
}
.num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 500;
}
.optional { color: var(--muted); font-weight: 400; }
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease;
}
.field textarea { resize: vertical; }
.field input:focus,
.field textarea:focus { border-color: var(--brand); }
.field.invalid input,
.field.invalid textarea { border-color: #c0392b; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.help { margin-top: 5px; font-size: 0.78rem; color: var(--muted); }
.err { margin-top: 5px; font-size: 0.8rem; color: #c0392b; }

/* ---------- Pickup / delivery choice ---------- */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  position: relative;
  display: block;
  height: 100%;
  padding: 16px 16px 16px 46px;
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.choice-body::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 19px;
  width: 18px;
  height: 18px;
  border: 2px solid #b7c0bb;
  border-radius: 50%;
  background: #fff;
}
.choice input:checked + .choice-body { border-color: var(--brand); background: var(--brand-light); }
.choice input:checked + .choice-body::before {
  border-color: var(--brand);
  background: radial-gradient(circle, var(--brand) 0 45%, #fff 50%);
}
.choice input:focus-visible + .choice-body { outline: 3px solid rgba(15, 76, 58, 0.35); outline-offset: 2px; }
.choice-body strong { display: block; font-size: 0.95rem; }
.choice-body small { display: block; margin: 2px 0 6px; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.choice-body em { font-style: normal; font-weight: 600; font-size: 0.86rem; color: var(--brand); }

/* ---------- Payment ---------- */
.pay-text { font-size: 0.92rem; color: var(--text); margin-bottom: 14px; }
.pay-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-badges span {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.form-error {
  background: #fdecea;
  color: #c0392b;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.notice {
  background: #fff4d6;
  border: 1px solid #f0d98a;
  color: #6f5200;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.notice ul { margin: 6px 0 0 18px; padding: 0; list-style: disc; }

.btn-pay { padding: 15px 20px; font-family: inherit; font-size: 1.02rem; }
.btn-pay:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.fine-print { margin-top: 12px; font-size: 0.76rem; color: var(--muted); text-align: center; }

/* ---------- Summary ---------- */
.summary {
  position: sticky;
  top: 90px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.summary h2 { font-size: 1.1rem; color: var(--brand); margin-bottom: 14px; }

.mini-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.mini-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 0.86rem; }
.mini-item span small { display: block; color: var(--muted); font-size: 0.76rem; }
.mini-item strong { white-space: nowrap; font-weight: 600; }

.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 0.92rem; }
.sum-save { color: var(--brand); }
.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
}
.sum-total strong { font-size: 1.4rem; color: var(--brand); }
.lead-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 0.8rem;
  line-height: 1.45;
}
.edit-link { display: inline-block; margin-top: 16px; font-size: 0.86rem; font-weight: 600; color: var(--brand); }
.edit-link:hover { color: var(--accent-dark); }

/* ---------- Empty / blocked ---------- */
.state-box {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
}
.state-box h2 { font-size: 1.3rem; color: var(--brand); margin-bottom: 8px; }
.state-box p { color: var(--muted); max-width: 440px; margin: 0 auto 22px; }

/* ---------- Processing overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(10, 30, 24, 0.6);
  padding: 20px;
}
.overlay-box {
  width: 100%;
  max-width: 320px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  padding: 30px 24px;
  font-weight: 500;
}
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border: 4px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
  .mini-list { max-height: 200px; }
}

@media (max-width: 600px) {
  .page-banner { padding: 16px 0 20px; }
  .card { padding: 18px 16px; }
  .field-row, .choice-grid { grid-template-columns: 1fr; }
}