/* ==========================================================================
   Youone Pay — Checkout Design System
   ========================================================================== */

:root {
  /* Brand palette */
  --navy: #0F172A;
  --navy-soft: #1E293B;
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-light: #60A5FA;
  --emerald: #10B981;
  --emerald-dark: #059669;
  --danger: #EF4444;
  --amber: #F59E0B;

  /* Surfaces */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* Text */
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-on-blue: #FFFFFF;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.16), 0 8px 16px rgba(15, 23, 42, 0.06);
  --shadow-blue: 0 12px 28px rgba(37, 99, 235, 0.28);
  --shadow-emerald: 0 12px 28px rgba(16, 185, 129, 0.28);

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
  --med: 280ms;

  /* Theme-dependent component colors (redeclared per theme below so both
     the manual toggle and the OS-level prefers-color-scheme path stay in sync) */
  --trust-color: var(--emerald-dark);
  --badge-num-bg: var(--navy);

  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0F1C;
  --surface: #111827;
  --surface-alt: #17202F;
  --border: #1F2A3D;
  --border-strong: #2A374C;
  --text: #F1F5F9;
  --text-secondary: #A3B0C2;
  --text-muted: #6B7C93;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 28px 70px rgba(0, 0, 0, 0.55);
  --trust-color: #34D399;
  --badge-num-bg: var(--blue);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A0F1C;
    --surface: #111827;
    --surface-alt: #17202F;
    --border: #1F2A3D;
    --border-strong: #2A374C;
    --text: #F1F5F9;
    --text-secondary: #A3B0C2;
    --text-muted: #6B7C93;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 28px 70px rgba(0, 0, 0, 0.55);
    --trust-color: #34D399;
    --badge-num-bg: var(--blue);
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--med) var(--ease), color var(--med) var(--ease);
}

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.logo .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow-blue);
}
.logo .pay-tag {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--trust-color);
  background: color-mix(in srgb, var(--emerald) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--emerald) 25%, transparent);
  padding: 6px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.trust-badge svg { width: 13px; height: 13px; flex: none; }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--fast) var(--ease);
}
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Progress bar */
.progress-bar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-full);
  white-space: nowrap;
  transition: all var(--med) var(--ease);
}
.progress-step .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  transition: all var(--med) var(--ease);
}
.progress-step.active { color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.progress-step.active .step-num { background: var(--blue); border-color: var(--blue); color: #fff; }
.progress-step.done { color: var(--emerald-dark); }
.progress-step.done .step-num { background: var(--emerald); border-color: var(--emerald); color: #fff; }

/* ==========================================================================
   Layout
   ========================================================================== */

.checkout-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 120px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 980px) {
  .checkout-layout { grid-template-columns: 1fr; padding-bottom: 140px; }
}

.checkout-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--med) var(--ease), background var(--med) var(--ease), border-color var(--med) var(--ease);
}

@media (max-width: 560px) {
  .card { padding: 20px; border-radius: var(--r-lg); }
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}
.card-title .badge-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--badge-num-bg);
  color: #fff;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

/* ==========================================================================
   Product card
   ========================================================================== */

.product-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.product-image {
  width: 92px;
  height: 92px;
  border-radius: var(--r-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow: hidden;
  flex: none;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }

.product-info { flex: 1; min-width: 0; }
.product-name { font-size: 1.08rem; font-weight: 700; margin-bottom: 4px; }
.product-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }
.product-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 4px 9px;
  border-radius: var(--r-full);
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.qty-label { font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); }
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  overflow: hidden;
}
.qty-stepper button {
  width: 34px; height: 34px;
  border: none;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--fast) var(--ease);
}
.qty-stepper button:hover { background: var(--border); }
.qty-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-stepper input {
  width: 42px;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.qty-stepper input:focus { outline: none; }

.price-lines { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.price-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.price-line strong { color: var(--text); font-weight: 700; }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid.full { grid-template-columns: 1fr; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field.col-2 { grid-column: span 2; }
@media (max-width: 520px) { .field.col-2 { grid-column: span 1; } }

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field label .opt { font-weight: 500; color: var(--text-muted); }

.field input,
.field select {
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent);
}
.field input.invalid, .field select.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}
.field input.valid { border-color: var(--emerald); }

.field-error {
  font-size: 0.74rem;
  color: var(--danger);
  font-weight: 600;
  min-height: 1em;
  display: none;
}
.field-error.show { display: block; }

.field .check-icon {
  position: absolute;
  right: 12px;
  top: 34px;
  width: 16px; height: 16px;
  color: var(--emerald);
  display: none;
}
.field.is-valid .check-icon { display: block; }

/* ==========================================================================
   Payment methods
   ========================================================================== */

.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 560px) { .pay-methods { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .pay-methods { grid-template-columns: repeat(5, 1fr); } }

.pay-method {
  position: relative;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--fast) var(--ease);
  text-align: center;
}
.pay-method:hover { border-color: var(--blue-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pay-method input { position: absolute; opacity: 0; }
.pay-method .pm-icon { height: 22px; display: flex; align-items: center; justify-content: center; }
.pay-method .pm-label { font-size: 0.76rem; font-weight: 700; color: var(--text-secondary); }
.pay-method.selected {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}
.pay-method.selected .pm-label { color: var(--blue-dark); }
.pay-method .pm-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}
.pay-method.selected .pm-check { display: flex; }
.pay-method .pm-check svg { width: 10px; height: 10px; }

.pay-panel {
  display: none;
  animation: fadeSlide var(--med) var(--ease);
}
.pay-panel.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.redirect-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface-alt);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border-strong);
}
.redirect-note svg { flex: none; width: 20px; height: 20px; color: var(--blue); }

.card-number-wrap { position: relative; }
.card-brand-icon {
  position: absolute;
  right: 12px;
  top: 34px;
  height: 20px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}
.card-brand-icon.show { opacity: 1; }

/* ==========================================================================
   Trust / Social proof
   ========================================================================== */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.trust-item svg { flex: none; width: 20px; height: 20px; color: var(--emerald); margin-top: 1px; }

.badges-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.mini-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.stars { color: var(--amber); font-size: 1.1rem; letter-spacing: 2px; }
.rating-text { font-weight: 800; font-size: 0.95rem; }
.rating-sub { font-size: 0.78rem; color: var(--text-muted); }

.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.testimonial {
  background: var(--surface-alt);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  border: 1px solid var(--border);
}
.testimonial .t-name {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 700;
  color: var(--text);
  font-size: 0.78rem;
}

/* ==========================================================================
   Summary sidebar
   ========================================================================== */

.checkout-summary { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) { .checkout-summary { position: static; order: -1; } }

.summary-card {
  background: linear-gradient(165deg, var(--navy) 0%, #1E2A45 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 26px;
  box-shadow: var(--shadow-lg);
}
.summary-title { font-size: 0.95rem; font-weight: 800; margin-bottom: 18px; opacity: 0.9; }
.summary-product { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.summary-product .product-image { width: 56px; height: 56px; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.summary-product-info { flex: 1; min-width: 0; }
.summary-product-name { font-size: 0.86rem; font-weight: 700; }
.summary-product-qty { font-size: 0.76rem; opacity: 0.65; margin-top: 2px; }

.summary-lines { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.12); border-bottom: 1px solid rgba(255,255,255,0.12); }
.summary-line { display: flex; justify-content: space-between; font-size: 0.86rem; opacity: 0.85; }
.summary-line strong { opacity: 1; }

.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; }
.summary-total .label { font-size: 0.9rem; opacity: 0.8; font-weight: 600; }
.summary-total .amount { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }

.btn-pay-desktop {
  width: 100%;
  border: none;
  border-radius: var(--r-full);
  padding: 17px 24px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  box-shadow: var(--shadow-blue);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), filter var(--fast) var(--ease);
}
.btn-pay-desktop:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(37, 99, 235, 0.36); filter: brightness(1.05); }
.btn-pay-desktop:active { transform: translateY(0); }
.btn-pay-desktop svg { width: 17px; height: 17px; }
.btn-pay-desktop:disabled { opacity: 0.7; cursor: progress; transform: none; }

@media (max-width: 980px) {
  .checkout-summary .btn-pay-desktop { display: none; }
}
@media (min-width: 981px) {
  .checkout-main > .btn-pay-desktop { display: none; }
}

.secure-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.76rem; color: var(--text-muted); font-weight: 600;
}
.secure-note svg { width: 13px; height: 13px; }

/* Mobile sticky pay bar */
.mobile-pay-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  align-items: center;
  gap: 12px;
  box-shadow: 0 -8px 24px rgba(15,23,42,0.08);
}
@media (max-width: 980px) { .mobile-pay-bar { display: flex; } }
.mobile-total { flex: none; }
.mobile-total .label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.mobile-total .amount { font-size: 1.15rem; font-weight: 800; }
.mobile-pay-bar .btn-pay-desktop { flex: 1; padding: 14px; font-size: 0.92rem; }

/* ==========================================================================
   Buttons / misc
   ========================================================================== */

.btn-spinner {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: none;
}
.is-loading .btn-spinner { display: inline-block; }
.is-loading .btn-label, .is-loading svg.lock-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 32px;
  margin-top: 20px;
}
.footer-inner { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.footer-links {
  display: flex; flex-wrap: wrap; gap: 20px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
}
.footer-links a { text-decoration: none; transition: color var(--fast) var(--ease); }
.footer-links a:hover { color: var(--blue); }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.footer-brand { font-size: 0.78rem; color: var(--text-muted); }
.footer-payments { display: flex; gap: 8px; flex-wrap: wrap; opacity: 0.75; }
.footer-payments .pm-icon { height: 16px; }
.footer-ssl { display: flex; gap: 8px; }

/* ==========================================================================
   Success page
   ========================================================================== */

.success-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.success-card {
  max-width: 480px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.success-icon-wrap {
  width: 84px; height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--emerald) 12%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.success-icon-wrap svg { width: 42px; height: 42px; color: var(--emerald); }
.success-check-circle { stroke-dasharray: 76; stroke-dashoffset: 76; animation: drawCircle 600ms var(--ease) forwards; }
.success-check-path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: drawCheck 400ms var(--ease) 500ms forwards; }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.success-title { font-size: 1.5rem; margin-bottom: 8px; }
.success-sub { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 24px; }

.receipt-box {
  background: var(--surface-alt);
  border-radius: var(--r-md);
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.receipt-row { display: flex; justify-content: space-between; gap: 14px; font-size: 0.85rem; }
.receipt-row .k { color: var(--text-muted); font-weight: 600; flex: none; }
.receipt-row .v { font-weight: 700; text-align: right; }
.receipt-row.total { border-top: 1px dashed var(--border-strong); padding-top: 10px; font-size: 0.95rem; }

.email-note {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 24px;
}
.email-note svg { width: 15px; height: 15px; flex: none; }

.success-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-outline {
  padding: 13px; border-radius: var(--r-full);
  border: 1.5px solid var(--border-strong);
  background: transparent; color: var(--text);
  font-weight: 700; font-size: 0.88rem;
  transition: all var(--fast) var(--ease);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* ==========================================================================
   Legal pages (privacy / terms / refund)
   ========================================================================== */

.legal-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}
.legal-disclaimer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}
.legal-disclaimer svg { width: 18px; height: 18px; flex: none; color: var(--amber); margin-top: 1px; }
.legal-wrap h1 { font-size: 1.7rem; margin-bottom: 6px; }
.legal-updated { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.legal-wrap section { margin-top: 30px; }
.legal-wrap h2 { font-size: 1.02rem; margin-bottom: 10px; }
.legal-wrap p { font-size: 0.9rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 10px; }
.legal-wrap ul { margin: 10px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal-wrap li { font-size: 0.9rem; line-height: 1.6; color: var(--text-secondary); }
.legal-wrap a.inline-link { color: var(--blue); font-weight: 600; text-decoration: none; }
.legal-wrap a.inline-link:hover { text-decoration: underline; }
.legal-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); text-decoration: none; margin-bottom: 24px; }
.legal-back:hover { color: var(--blue); }
.legal-back svg { width: 15px; height: 15px; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  z-index: 500;
  max-width: calc(100vw - 32px);
  text-align: center;
}
:root[data-theme="dark"] .toast { background: var(--blue); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   Multi-item cart (order line items + summary list)
   ============================================================ */
.items-list { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 20px; }
.item-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.item-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
}
.item-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-brand { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.item-name { font-weight: 700; font-size: .95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: .78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-qty { font-weight: 600; color: var(--text-muted); font-size: .9rem; }
.item-price { font-weight: 800; color: var(--text); white-space: nowrap; }

.summary-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.summary-item { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; }
.summary-item-name { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-item-name b { color: var(--text); }
.summary-item-price { font-weight: 700; white-space: nowrap; color: var(--text); }

@media (max-width: 440px) {
  .item-row { grid-template-columns: 48px 1fr auto; }
  .item-qty { display: none; }
}

/* ============================================================
   Mobile hardening — no sideways scroll, keep all info visible
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 620px) {
  /* tighter gutters so nothing runs off the screen edge */
  .header-inner { padding: 12px 16px; gap: 10px; }
  .progress-bar { padding: 0 16px 12px; gap: 4px; }
  .checkout-layout { padding: 20px 16px 150px; gap: 16px; }
  .footer-inner { padding: 0 16px; }

  /* decorative header badges crowd the top bar on phones — hide them */
  .header-trust .trust-badge { display: none; }
  .logo { font-size: 1.08rem; }
  .logo .mark { width: 30px; height: 30px; }

  /* big numbers shrink so they never force the row wider than the screen */
  .summary-total .amount { font-size: 1.55rem; }
  .mobile-total .amount { font-size: 1.2rem; }

  /* long emails / product names wrap instead of pushing the layout out */
  .summary-item-name, .item-meta { white-space: normal; overflow-wrap: anywhere; }
}

/* Multi-item rows: keep the quantity visible (was hidden before) and stop overflow.
   Two-row grid: thumb on the left, name in the middle, qty over price on the right. */
@media (max-width: 440px) {
  .item-row {
    grid-template-columns: 42px 1fr auto;
    grid-template-areas: "thumb info qty" "thumb info price";
    gap: 2px 8px;
    padding: 8px 10px;
    align-items: center;
  }
  .item-thumb { grid-area: thumb; width: 42px; height: 42px; align-self: center; }
  .item-info { grid-area: info; min-width: 0; }
  .item-name { font-size: 0.9rem; }
  .item-qty { grid-area: qty; display: block; text-align: right; color: var(--text-muted); font-size: 0.82rem; }
  .item-price { grid-area: price; text-align: right; white-space: nowrap; }
}
