/* payment.php — checkout payment step (tokens + shell in payment.php) */

.cart-step-bar {
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cart-step-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.cs-steps {
  display: flex;
  gap: 0;
  align-items: center;
}
.cs-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: rgba(248, 245, 239, 0.35);
  font-weight: 400;
}
.cs-step.done { color: var(--teal-hl); }
.cs-step.active { color: rgba(248, 245, 239, 0.85); font-weight: 500; }
.cs-step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9px;
  flex-shrink: 0;
}
.cs-step.done .cs-step-num {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.cs-step.active .cs-step-num {
  background: rgba(248, 245, 239, 0.12);
  border-color: rgba(248, 245, 239, 0.5);
}
.cs-step-arrow { color: rgba(248, 245, 239, 0.15); font-size: 10px; padding: 0 2px; }
.pay-step-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(248, 245, 239, 0.3);
  letter-spacing: 0.04em;
}
.pay-step-secure svg { color: var(--teal-hl); flex-shrink: 0; }

.pay-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 40px 80px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.block {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.block:last-child { margin-bottom: 0; }
.block-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bh-left { display: flex; align-items: center; gap: 10px; }
.bh-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.bh-num.done { background: var(--green); }
.bh-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.bh-edit { font-size: 12px; color: var(--teal); cursor: pointer; transition: opacity 0.12s; }
.bh-edit:hover { opacity: 0.7; }
.block-body { padding: 20px 22px; }

.method-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.method-tab {
  padding: 14px 16px;
  border: 1.5px solid var(--rule);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  position: relative;
}
.method-tab.active { border-color: var(--teal); background: var(--teal-pale); }
.method-tab:hover:not(.active) { background: var(--bg-2); }
.mt-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
}
.mt-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.mt-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.method-tab.active .mt-radio { background: var(--teal); border-color: var(--teal); }
.mt-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  display: none;
}
.method-tab.active .mt-radio::after { display: block; }
.mt-sub { font-size: 12px; color: var(--ink-3); font-weight: 300; line-height: 1.4; }
.mt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.card-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field label .req { color: var(--teal); }
.ctrl {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--rule);
  border-radius: 4px;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  transition: all 0.15s;
  outline: none;
}
.ctrl:focus {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(10, 82, 82, 0.08);
}
.ctrl::placeholder { color: var(--ink-4); }
.ctrl.error { border-color: var(--red); background: var(--red-soft); }
.ctrl-sel {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2372685E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.card-num-wrap { position: relative; }
.card-num-wrap .ctrl { padding-right: 80px; font-family: var(--mono); letter-spacing: 0.08em; }
.card-brands {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}
.card-brand-icon {
  width: 28px;
  height: 18px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface);
  transition: all 0.15s;
}
.card-brand-icon.active {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-pale);
}

.cvc-help { font-size: 11px; color: var(--ink-4); margin-top: 3px; }

.po-form { display: flex; flex-direction: column; gap: 14px; }
.po-info-banner {
  padding: 12px 14px;
  background: var(--teal-soft);
  border: 1px solid rgba(10, 82, 82, 0.15);
  border-radius: 4px;
  font-size: 13px;
  color: var(--teal);
  line-height: 1.6;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pib-icon { flex-shrink: 0; margin-top: 1px; }

.same-as-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; cursor: pointer; }
.same-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.same-check.checked {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-size: 9px;
}
.same-label { font-size: 13px; color: var(--ink-2); }
.billing-fields { display: flex; flex-direction: column; gap: 10px; transition: all 0.3s; }
.billing-fields.hidden { display: none; }

.shipping-options { display: flex; flex-direction: column; gap: 6px; }
.ship-opt {
  padding: 12px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
  transition: all 0.15s;
  background: var(--bg);
}
.ship-opt.active { border-color: var(--teal); background: var(--teal-pale); }
.ship-opt:hover:not(.active):not(.disabled) { background: var(--bg-2); }
.ship-opt.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--bg-2);
}
.ship-opt.disabled .so-price { color: var(--ink-3); font-family: var(--sans); font-size: 12px; font-weight: 500; }
.so-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.ship-opt.active .so-radio { background: var(--teal); border-color: var(--teal); }
.so-radio::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  display: none;
}
.ship-opt.active .so-radio::after { display: block; }
.so-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.so-detail { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.so-price { font-family: var(--serif); font-size: 16px; font-weight: 500; color: var(--ink); }
.so-price.free { color: var(--green); }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  position: sticky;
  top: 108px;
}
.sc-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sc-head h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
.sc-head .sc-edit { font-size: 12px; color: var(--teal); cursor: pointer; text-decoration: none; }
.sc-head .sc-edit:hover { text-decoration: underline; }
.sc-items { padding: 6px 0; max-height: 260px; overflow-y: auto; }
.sc-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid var(--rule-2);
}
.sc-item:last-child { border-bottom: none; }
.sci-thumb { display: grid; place-items: center; }
.sci-thumb img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  display: block;
}
.sci-name { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.25; }
a.sci-name-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
a.sci-name-link:hover {
  color: var(--teal);
  text-decoration: underline;
}
.sci-qty { font-family: var(--mono); font-size: 10px; color: var(--ink-4); margin-top: 1px; }
.sci-price {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.sc-totals {
  border-top: 1px solid var(--rule-2);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sct-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.sct-row.total { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 11px; }
.sctr-k { color: var(--ink-3); }
.sctr-k.bold { color: var(--ink); font-weight: 600; }
.sctr-v { font-weight: 500; color: var(--ink); }
.sctr-v.teal { color: var(--teal); }
.sctr-v.green { color: var(--green); }
.sctr-v.total { font-family: var(--serif); font-size: 22px; color: var(--ink); }

.savings-row {
  margin: 0 14px 12px;
  padding: 8px 12px;
  background: var(--green-soft);
  border: 1px solid rgba(26, 107, 58, 0.18);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sr-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 9px;
}
.sr-text { font-size: 12px; font-weight: 500; color: var(--green); }
.sr-text.hidden { display: none; }

.trust-row {
  padding: 12px 18px;
  border-top: 1px solid var(--rule-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tr-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); }
.tri-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.pay-btn {
  width: 100%;
  padding: 15px;
  background: var(--ink);
  color: #f8f5ef;
  border-radius: 5px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}
.pay-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--teal);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.pay-btn:hover::before { transform: translateX(0); }
.pay-btn span { position: relative; z-index: 1; }
.pay-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pay-btn:disabled::before { display: none; }

.pay-wrap { padding: 14px 14px 12px; }
.pay-note { font-size: 11px; color: var(--ink-4); text-align: center; margin-top: 8px; line-height: 1.5; }
.pay-note a { color: var(--teal); }

.confirm-screen {
  display: none;
  max-width: 580px;
  margin: 60px auto 0;
  padding: 0 40px 80px;
  text-align: center;
  animation: fadeUp 0.5s ease-out;
}
.confirm-screen.active { display: block; }
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cs-seal {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  margin: 0 auto 28px;
  border: 2px solid var(--green);
  animation: pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}
.cs-h1 {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
  color: var(--ink);
  margin-bottom: 12px;
}
.cs-h1 em { font-style: italic; color: var(--teal); }
.cs-body { font-size: 16px; font-weight: 300; color: var(--ink-3); line-height: 1.7; margin-bottom: 28px; }
.cs-details {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  text-align: left;
}
.csd-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 18px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 13px;
}
.csd-row:last-child { border-bottom: none; }
.csdr-k { color: var(--ink-3); }
.csdr-v { font-weight: 600; color: var(--ink); }
.csdr-v.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.csdr-v.green { color: var(--green); }
.cs-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.csa-btn {
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid var(--rule);
  text-decoration: none;
  display: inline-block;
}
.csa-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.csa-primary:hover { background: var(--teal-mid); }
.csa-ghost { color: var(--ink-2); background: var(--surface); }
.csa-ghost:hover { background: var(--bg-2); }

.processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  place-items: center;
}
.processing-overlay.active { display: grid; }
.po-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}
.po-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--rule);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.po-msg {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  font-style: italic;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 20px;
  cursor: pointer;
  transition: color 0.12s;
  text-decoration: none;
}
.page-back:hover { color: var(--teal); }
.page-back svg { transition: transform 0.15s; }
.page-back:hover svg { transform: translateX(-2px); }

.section-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.field-err { font-size: 11px; color: var(--red); margin-top: 3px; display: none; }
.field-err.show { display: block; }

.stripe-pay-note {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--teal-soft);
  border: 1px solid rgba(11, 110, 110, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.stripe-pay-note strong { color: var(--teal); }

@media (max-width: 960px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 860px) {
  .pay-page {
    grid-template-columns: 1fr;
    padding: 20px 20px 60px;
  }
  .summary-card { position: static; order: -1; }
  .cart-step-inner { padding: 10px 20px; }
  .cs-steps { display: none; }
  .confirm-screen { padding: 0 20px 60px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
}
@media (max-width: 480px) {
  .field-row,
  .field-row-3 { grid-template-columns: 1fr; }
  .method-tabs { grid-template-columns: 1fr; }
}
