/* ============================================================
   PHILAUTIA PALATE — checkout.css
   Multi-step checkout, secure payment, confirmation & receipt
   ============================================================ */

/* ---------- Checkout modal ---------- */
.checkout-modal { z-index: 95; }
.checkout-panel { max-width: 480px; padding: 2rem 1.6rem 1.6rem; }

.checkout-back {
  position: absolute;
  top: 0.9rem;
  right: 3.2rem;
  font-size: 1.05rem;
}

/* ---------- Progress indicator ---------- */
.ck-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin: 0.2rem 0 1.4rem;
  position: relative;
}
.ck-progress::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-50%);
}
.ck-step {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--black2);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  transition: all 0.25s ease;
}
.ck-step::after {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.4);
  margin: 0.2rem auto 0;
}
.ck-step.active {
  color: var(--black);
  background: linear-gradient(180deg, #E8D27A 0%, #D4AF37 55%, #BC9B35 100%);
  border-color: var(--gold);
  font-weight: 700;
}
.ck-step.active::after { background: #070707; }
.ck-step.done { color: var(--lgold); border-color: var(--gold); }
.ck-step.done::after { background: var(--gold); }
.ck-step i {
  font-style: normal;
  font-weight: 800;
  font-size: 0.6rem;
  margin-right: 0.3rem;
  color: var(--lgold);
}
.ck-step.active i { color: var(--black); }

/* ---------- Billing step ---------- */
.ck-method {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.ck-method-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--charcoal);
  border: 1.5px solid var(--gold-border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.ck-method-option:hover { border-color: var(--gold); }
.ck-method-option input { position: absolute; opacity: 0; pointer-events: none; }
.ck-method-body { display: flex; flex-direction: column; flex: 1; gap: 0.15rem; }
.ck-method-body strong { color: var(--cream); font-size: 0.9rem; }
.ck-method-body small { color: var(--muted); font-size: 0.74rem; }
.ck-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-border);
  position: relative;
  flex-shrink: 0;
}
.ck-method-option input:checked + .ck-method-body + .ck-radio {
  border-color: var(--gold);
}
.ck-method-option input:checked + .ck-method-body + .ck-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--gold);
}
.ck-fee-row { color: var(--muted); border: 0; margin: 0; padding: 0.4rem 0; font-weight: 500; }
.ck-fee-row .basket-total { color: var(--muted); font-weight: 500; }
.ck-grand-row { border: 0; margin: 0; padding: 0.6rem 0 0.35rem; font-size: 1rem; }
.ck-grand-row .basket-total { color: var(--lgold); }

/* ---------- Payment: greeting ---------- */
.ck-greet {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  background: rgba(212, 175, 55, 0.06);
  border: 1px dashed var(--gold-border);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
}
.ck-order-no { color: var(--lgold); font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }
.ck-customer { color: var(--cream); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Basket thumbnails in review lists ---------- */
.review-item { align-items: center; }
.review-item-main { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.review-item-main .ri-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.basket-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--gold-border);
  background: var(--charcoal);
}
.ri-detail { display: flex; align-items: center; gap: 0.55rem; }
.ri-qty {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* panes */
.ck-pane { animation: fadePanel 0.25s ease; }

/* ---------- Review / Details ---------- */
.ck-or {
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0.9rem 0;
}

.ck-eyebrow {
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.25rem;
}

/* ---------- Payment ---------- */
.ck-summary {
  background: var(--charcoal);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}
.ck-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--lgold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
.ck-summary-count { color: var(--muted); font-size: 0.7rem; }

.ck-details-note {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(212, 175, 55, 0.06);
  border: 1px dashed var(--gold-border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.9rem;
}
.ck-details-note strong { color: var(--cream); }

.ck-secure {
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 0.8rem;
}

/* ---------- Confirmation ---------- */
.ck-success-check {
  width: 54px;
  height: 54px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #E8D27A 0%, #D4AF37 55%, #BC9B35 100%);
  color: var(--black);
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.35);
}

.ck-receipt-box {
  background: var(--charcoal);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 0.4rem 0 1rem;
}
.ck-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.15);
  font-size: 0.84rem;
}
.ck-receipt-row:last-child { border-bottom: none; }
.ck-receipt-row span { color: var(--muted); }
.ck-receipt-row strong { color: var(--lgold); }
.ck-paid { color: #4fce78; font-weight: 700; letter-spacing: 0.06em; }
.ck-ref { font-size: 0.72rem; color: var(--muted); word-break: break-all; max-width: 60%; text-align: right; }

.ck-btns { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.2rem 0 0.8rem; }
.ck-email-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--lgold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.7rem;
}
.ck-home-link {
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.4rem;
}
.ck-home-link:hover { color: var(--lgold); }

/* ---------- Payment methods ---------- */
.ck-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
  margin: 1rem 0;
}
.ck-pay-section { margin-bottom: 0.2rem; }
.ck-section-title {
  color: var(--cream);
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.7rem;
}

/* Stripe Payment Element container — dark so the iframe matches the theme */
.pm-element {
  background: #0c0c0c;
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  min-height: 48px;
  transition: border-color 0.2s ease;
}
.pm-element:focus-within { border-color: var(--gold); }

/* customer/order summary rows on the payment step */
.ck-cust-summary {
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  background: #0d0d0d;
  overflow: hidden;
}
.ck-cust-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
}
.ck-cust-row + .ck-cust-row { border-top: 1px solid rgba(212, 175, 55, 0.12); }
.ck-cust-row span { color: var(--muted); }
.ck-cust-row strong { color: var(--cream); text-align: right; word-break: break-word; }

/* payment status banner */
.ck-status {
  margin: 0.85rem 0 0.2rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  border: 1px solid transparent;
}
.ck-status.ck-loading { color: var(--lgold); background: rgba(212, 175, 55, 0.08); border-color: var(--gold-border); }
.ck-status.ck-processing { color: var(--lgold); background: rgba(212, 175, 55, 0.1); border-color: var(--gold-border); }
.ck-status.ck-failed { color: #ff9b9b; background: rgba(255, 82, 82, 0.1); border-color: rgba(255, 82, 82, 0.35); }
.ck-status.ck-warn { color: #ffd28a; background: rgba(255, 167, 38, 0.1); border-color: rgba(255, 167, 38, 0.35); }
.ck-status .ck-status-title { display:block; font-family:'Playfair Display',serif; font-weight:700; font-size:1.05rem; margin-bottom:.2rem; }
.ck-status .ck-status-line { display:block; font-weight:500; }
.ck-status .ck-status-line + .ck-status-line { margin-top:.05rem; }

/* stripe trust note under section title */
.ck-stripe-note {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* hosted checkout redirect notice (replaces the on-page card form) */
.ck-redirect-note {
  border: 1px dashed var(--gold-border);
  background: rgba(212, 175, 55, 0.06);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  text-align: center;
  color: var(--cream);
  font-size: 0.82rem;
  line-height: 1.5;
}
.ck-redirect-note p { margin: 0; }
.ck-redirect-tip {
  margin-top: 0.35rem !important;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: monospace;
}

/* failed / cancelled action buttons */
.ck-pay-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
}
.ck-pay-actions .btn { flex: 1; min-width: 0; white-space: nowrap; padding: 0.6rem 0.5rem; font-size: 0.7rem; }

/* pay button spinner */
.ck-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  animation: ck-spin 0.7s linear infinite;
}
@keyframes ck-spin { to { transform: rotate(360deg); } }

/* confirmation thanks + receipt extra rows */
.ck-thanks {
  text-align: center;
  font-size: 0.85rem;
  color: var(--creamy) ;
  margin: 0.6rem 0 0;
}
.ck-ref-row span.ck-ref { font-family: monospace; font-size: 0.74rem; }

.ck-terms {
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.5;
  margin: 0.85rem 0 0.2rem;
}
.ck-help {
  margin-top: 1rem;
  background: var(--charcoal);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  text-align: center;
}
.ck-help-title { color: var(--cream); font-weight: 700; font-size: 0.85rem; }
.ck-help-text { color: var(--muted); font-size: 0.78rem; margin: 0.2rem 0 0.7rem; }
.ck-help-note { color: var(--muted); font-size: 0.68rem; line-height: 1.5; margin-top: 0.6rem; }
.ck-help-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.2rem 0 0.5rem;
}

/* ---------- Payment successful ---------- */
.ck-success-title {
  color: var(--lgold);
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.35rem;
}
.ck-thanks {
  text-align: center;
  color: var(--cream);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.ck-next {
  background: var(--charcoal);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin: 0.4rem 0 0.9rem;
}
.ck-next-title {
  color: var(--cream);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.ck-next ul { margin: 0; padding-left: 1.1rem; }
.ck-next li { color: var(--muted); font-size: 0.78rem; line-height: 1.6; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  /* keep form inputs at 16px so iOS Safari does not auto-zoom on focus */
  .form-field input,
  .form-field textarea,
  .form-field select {
    font-size: 16px;
    padding: 0.8rem 0.95rem;
  }
  .form-field label { font-size: 0.78rem; }

  /* bring the panel closer to the edge and let it breathe */
  .review-modal { padding: 0.7rem; }
  .review-panel,
  .checkout-panel {
    border-radius: 18px;
    padding: 1.5rem 1.2rem 1.3rem;
    max-height: calc(100dvh - 1.4rem);
  }

  /* iPhone home-indicator safe area under the fixed action bar */
  .mobile-bar { padding-bottom: env(safe-area-inset-bottom); }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }

  /* progress steps: keep all four visible without horizontal scroll */
  .ck-progress { gap: 0.12rem; margin-bottom: 1.1rem; }
  .ck-step {
    font-size: 0.54rem;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.5rem;
  }
  .ck-step i { font-size: 0.52rem; margin-right: 0.2rem; }

  /* summary / receipt cards use the full panel width */
  .ck-summary,
  .ck-receipt-box { padding: 0.8rem 0.85rem; }
  .ck-receipt-row { font-size: 0.8rem; gap: 0.5rem; }
  .ck-ref { max-width: 55%; }

  /* failed / cancelled actions stack into full-width taps */
  .ck-pay-actions { flex-direction: column; }
  .ck-pay-actions .btn {
    flex: 1 1 auto;
    width: 100%;
    padding: 0.85rem 0.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  /* primary pay button: comfortable tap target on touch screens */
  #payButton { padding-top: 0.95rem; padding-bottom: 0.95rem; }

  .ck-eyebrow { font-size: 0.6rem; letter-spacing: 0.22em; }
  .ck-status { font-size: 0.78rem; padding: 0.6rem 0.75rem; }
  .ck-secure, .ck-terms, .ck-help-note { font-size: 0.66rem; }
  .ck-method-option { padding: 0.7rem 0.8rem; }
}

@media (max-width: 360px) {
  .review-panel,
  .checkout-panel { padding: 1.3rem 1rem 1.15rem; }
  .ck-progress { gap: 0.08rem; }
  .ck-step { padding: 0.24rem 0.4rem; letter-spacing: 0; }
  .ck-step i { display: none; }
  .ck-method-body strong { font-size: 0.85rem; }
  .ck-method-body small { font-size: 0.7rem; }
  .ck-summary-head { font-size: 0.72rem; }
  .ck-customer { font-size: 0.75rem; }
}