/* buyer_redesign.css — Tokovard Buyer Storefront, rebuilt for clarity, trust, and robustness */
:root {
  color-scheme: dark;

  --bg: #0d1016;
  --bg-canvas: #0f141c;
  --surface: #151b24;
  --surface-2: #1a2230;
  --surface-3: #212c3d;
  --surface-inset: #10161f;

  --fg: #f3f6fc;
  --fg-muted: #c3cadd;
  --fg-subtle: #97a4ba;
  --fg-faint: #6f7d95;

  --border: #253044;
  --border-strong: #33425c;
  --border-soft: rgba(255,255,255,0.06);

  --accent: #5b6cff;
  --accent-hover: #7684ff;
  --accent-soft: rgba(91,108,255,0.14);
  --accent-softer: rgba(91,108,255,0.08);

  --success: #22c55e;
  --success-soft: rgba(34,197,94,0.14);
  --warning: #f59e0b;
  --warning-soft: rgba(245,158,11,0.14);
  --price-accent: #ffd54a;
  --danger: #ef4444;
  --danger-soft: rgba(239,68,68,0.14);
  --info: #38bdf8;
  --info-soft: rgba(56,189,248,0.14);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.16);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.22);
  --shadow-lg: 0 24px 72px rgba(0,0,0,0.32);

  --container: 1180px;
  --header-h: 72px;
  --transition-fast: 0.16s ease;
  --transition: 0.24s ease;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font);
  background:
    radial-gradient(circle at top center, rgba(91,108,255,0.08), transparent 28%),
    linear-gradient(180deg, #0d1016 0%, #0f141c 100%);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.body-locked { overflow: hidden; }

button, input, textarea, select { font: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(13,16,22,0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.header.scrolled {
  background: rgba(13,16,22,0.92);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: var(--container);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}
.logo-mark,
.logo-mark-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 28px rgba(91,108,255,0.25);
}
.logo-mark { width: 40px; height: 40px; border-radius: 14px; font-size: 18px; font-weight: 800; }
.logo-mark-sm { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; font-weight: 800; }
.brand-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-logo-header {
  width: 40px;
  height: 40px;
}
.brand-logo-footer {
  width: 30px;
  height: 30px;
}
.logo-text { font-size: 15px; font-weight: 760; letter-spacing: -0.02em; }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-subtle);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.nav-btn:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.04);
  border-color: var(--border-soft);
}
.nav-btn.active {
  color: #dfe4ff;
  background: var(--accent-soft);
  border-color: rgba(91,108,255,0.22);
}

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--fg);
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4,7,12,0.62);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav {
  display: none;
  position: fixed;
  top: calc(var(--header-h) - 4px);
  left: 16px;
  right: 16px;
  z-index: 99;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(17,22,30,0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.mobile-nav.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-nav-btn {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--fg-muted);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.mobile-nav-btn:hover,
.mobile-nav-btn.active {
  background: var(--accent-soft);
  color: #dfe4ff;
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  min-height: calc(100vh - var(--header-h));
}
.page {
  display: none;
  padding: 28px 0 88px;
}
.page.active {
  display: block;
  animation: fadeUp 0.24s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.section { padding: 40px 0; }
.section-title {
  font-size: clamp(1.35rem, 1.1rem + 0.5vw, 1.8rem);
  font-weight: 760;
  margin-bottom: 24px;
  text-align: center;
}
.section-subtitle {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}
.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-header .section-title { margin-bottom: 0; text-align: left; }

/* Hero */
.hero-banner-section {
  padding: 8px 0 18px;
}
.hero-banner-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  box-shadow: var(--shadow-lg);
}
.hero-banner-image {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 336;
  object-fit: cover;
  object-position: center;
}
.hero {
  padding: 48px 0 36px;
  text-align: center;
}
.hero-content {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(91,108,255,0.2);
  color: #dfe4ff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(2.2rem, 1.5rem + 2vw, 4rem);
  font-weight: 820;
  line-height: 1.03;
  letter-spacing: -0.05em;
  margin-bottom: 16px;
}
.hero-subtitle {
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--fg-subtle);
  font-size: 16px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.hero-stat {
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
}
.hero-stat-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero-stat-label {
  margin-top: 6px;
  color: var(--fg-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gradient-text {
  background: linear-gradient(180deg, #aeb9ff 0%, #6f81ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-glow { display: none; }

/* Card primitives */
.glass-card,
.step-card,
.trust-card,
.product-card,
.product-detail-card,
.checkout-card,
.payment-card,
.history-card,
.accordion,
.state-card,
.maintenance-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0)), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.glass-card { padding: 24px; }
.product-detail-card,
.checkout-card,
.payment-card { border-radius: 22px; }

/* Steps / trust */
.steps-grid,
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.step-card,
.trust-card {
  padding: 24px 20px;
  text-align: center;
  transition: border-color var(--transition), background-color var(--transition), transform var(--transition-fast);
}
.step-card:hover,
.trust-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)), var(--surface-2);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #dfe4ff;
  font-size: 12px;
  font-weight: 800;
}
.step-icon,
.trust-icon {
  display: block;
  margin-bottom: 14px;
  font-size: 28px;
}
.step-card h3,
.trust-card h4 {
  font-size: 15px;
  font-weight: 760;
  margin-bottom: 8px;
}
.step-card p,
.trust-card p {
  color: var(--fg-subtle);
  font-size: 13px;
  line-height: 1.65;
}
.trust-section {
  padding-top: 40px;
  border-top: 1px solid var(--border-soft);
}

/* Toolbar */
.catalog-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-faint);
  font-size: 14px;
}
.search-box .form-input { padding-left: 40px; }

/* Products */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.products-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.product-card {
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: border-color var(--transition), background-color var(--transition), transform var(--transition-fast), box-shadow var(--transition);
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0)), var(--surface-2);
  box-shadow: var(--shadow-md);
}
.product-card-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.58;
  filter: saturate(0.75);
}
.product-card-compact {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)), var(--surface);
  box-shadow: var(--shadow-sm);
}
.product-card-banner {
  position: relative;
  aspect-ratio: 1 / 1;
  height: auto;
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.product-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}
.product-card:hover .product-card-banner img { transform: scale(1.04); }
.product-banner-fallback,
.product-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(91,108,255,0.12), rgba(255,255,255,0.02));
  color: var(--fg-faint);
}
.product-banner-fallback-card { font-size: 48px; }
.product-banner-fallback-hero { min-height: 320px; font-size: 64px; }
.product-card-emoji { opacity: 0.58; }
.product-card-body { padding: 9px 10px 10px; }
.product-card-title {
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 6px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 0;
}
.product-card-desc {
  color: var(--fg-subtle);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
}
.product-price-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}
.product-price {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--price-accent);
}
.product-price-old {
  color: var(--fg-faint);
  font-size: 11px;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.85;
  white-space: nowrap;
}
.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.3);
  color: #facc15;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.family-product-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: start;
}
.family-product-media {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.family-product-hero {
  margin-bottom: 0;
}
.family-product-panel {
  min-height: 100%;
}
.family-detail-head {
  margin-bottom: 16px;
}
.variant-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.variant-pill {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  min-height: 46px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), transform var(--transition-fast);
}
.variant-pill:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.variant-pill.active {
  background: var(--accent-soft);
  border-color: rgba(91,108,255,0.3);
  color: #dfe4ff;
}
.family-selected-panel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.family-selected-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.family-selected-title {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.45rem);
  font-weight: 800;
  line-height: 1.15;
}
.family-selected-subtitle {
  margin-top: 6px;
  color: var(--fg-subtle);
  font-size: 13px;
  line-height: 1.45;
}
.family-stock-badge {
  flex-shrink: 0;
}
.family-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.family-meta-card {
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px 14px;
}
.family-meta-label {
  display: block;
  color: var(--fg-subtle);
  font-size: 12px;
  margin-bottom: 6px;
}
.family-meta-value {
  display: block;
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.family-product-desc {
  margin: 16px 0 18px;
}
.detail-price-accent {
  color: var(--price-accent);
}

/* Page header */
.page-header {
  padding: 8px 0 22px;
}
.page-header h1 {
  font-size: clamp(1.5rem, 1.2rem + 0.6vw, 2rem);
  font-weight: 780;
  margin-bottom: 8px;
}
.page-header p {
  color: var(--fg-subtle);
  font-size: 14px;
  line-height: 1.6;
}

/* Product detail */
.product-hero {
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.product-hero img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}
.product-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.product-detail-title {
  font-size: clamp(1.5rem, 1.2rem + 0.7vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 6px;
}
.product-detail-code {
  color: var(--fg-faint);
  font-size: 13px;
}
.product-detail-desc {
  margin: 16px 0;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.75;
}
.product-price-block {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}
.product-price-promo-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.product-price-row-detail {
  gap: 10px;
}
.product-price-big {
  font-size: clamp(2.35rem, 1.8rem + 1vw, 3.1rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.05em;
}
.product-price-old-detail {
  font-size: 1rem;
}
.price-badge-detail {
  font-size: 11px;
  padding: 5px 10px;
}
.product-price-unit {
  color: var(--fg-faint);
  font-size: 13px;
}
.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-stack-spaced { margin-top: 16px; }
.page-back-button { margin-bottom: 16px; }

/* Checkout / payment */
.checkout-title,
.payment-title {
  font-size: 20px;
  font-weight: 780;
  margin-bottom: 18px;
}
.checkout-form-section {
  margin: 16px 0;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(91,108,255,0.16);
  background: rgba(91,108,255,0.06);
}
.checkout-qty-block {
  text-align: center;
  margin: 12px 0;
}
.checkout-qty-label,
.checkout-section-title,
.payment-meta,
.payment-fee-note,
.payment-tip-box,
.support-copy,
.support-hint,
.history-meta,
.footer-text,
.footer-copyright,
.countdown-label,
.poll-indicator {
  color: var(--fg-subtle);
}
.checkout-qty-label,
.checkout-section-title { font-size: 13px; }
.checkout-total-row {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.checkout-total-label { font-weight: 700; }
.payment-badge {
  margin-bottom: 14px;
  font-size: 12px;
  padding: 0 12px;
}
.payment-meta { font-size: 13px; line-height: 1.6; }
.payment-meta-bottom { margin-bottom: 4px; }
.payment-total {
  margin: 8px 0;
  font-size: clamp(1.6rem, 1.3rem + 0.8vw, 2.1rem);
  font-weight: 820;
  letter-spacing: -0.04em;
}
.payment-fee-note { font-size: 12px; }
.payment-tip-box {
  margin-top: 14px;
  font-size: 12px;
  text-align: left;
  line-height: 1.6;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
}
.form-label-hint {
  color: var(--fg-faint);
  font-weight: 500;
}
.form-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-inset);
  color: var(--fg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
textarea.form-input {
  min-height: 96px;
  resize: vertical;
  padding-top: 12px;
  padding-bottom: 12px;
}
select.form-input { cursor: pointer; }
.form-input::placeholder { color: var(--fg-faint); }
.form-input:focus {
  border-color: rgba(91,108,255,0.72);
  box-shadow: 0 0 0 4px rgba(91,108,255,0.14);
  background: #111926;
}
.form-input.invalid {
  border-color: rgba(239,68,68,0.72);
  box-shadow: 0 0 0 4px rgba(239,68,68,0.14);
}
.form-error {
  margin-top: 6px;
  color: #fca5a5;
  font-size: 12px;
  min-height: 16px;
}

/* Detail rows */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  color: var(--fg-subtle);
  font-size: 13px;
}
.detail-value {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}
.detail-total {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

/* Qty */
.qty-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.qty-picker-full {
  width: 100%;
  justify-content: space-between;
}
.qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.qty-btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.qty-display {
  min-width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 760;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition-fast), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}
.btn-primary {
  color: white;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 12px 24px rgba(91,108,255,0.22);
}
.btn-success {
  color: #a3efbf;
  background: var(--success-soft);
  border-color: rgba(34,197,94,0.22);
}
.btn-success:hover { background: rgba(34,197,94,0.18); }
.btn-glass,
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--fg);
}
.btn-glass:hover,
.btn-ghost:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.btn-full { width: 100%; }
.btn-lg { min-height: 48px; padding-inline: 20px; font-size: 15px; }
.btn-sm { min-height: 36px; padding-inline: 12px; font-size: 12px; border-radius: 10px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}
.badge-green { background: var(--success-soft); color: #a3efbf; }
.badge-red { background: var(--danger-soft); color: #ffb4b4; }
.badge-yellow { background: var(--warning-soft); color: #fcd34d; }
.badge-blue { background: var(--info-soft); color: #9addff; }
.badge-purple { background: var(--accent-soft); color: #dfe4ff; }
.pulse-badge { animation: pulse 1.8s infinite; }

/* QR / countdown */
.qr-container { margin: 20px 0; }
.qr-wrapper {
  display: inline-flex;
  padding: 16px;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-md);
}
.countdown {
  margin: 12px 0 4px;
  font-size: clamp(2rem, 1.6rem + 1vw, 2.8rem);
  font-weight: 860;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.countdown-live { color: #8ff0b2; }
.countdown-warning { color: #fcd34d; animation: pulse 1.1s infinite; }
.countdown-expired { color: #fca5a5; }
.countdown-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.58; }
}
.poll-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  font-size: 12px;
}
.poll-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  animation: blink 1.5s infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* Credential */
.credential-box {
  position: relative;
  margin-bottom: 12px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(91,108,255,0.18);
  background: linear-gradient(180deg, rgba(91,108,255,0.1), rgba(91,108,255,0.04));
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition), background-color var(--transition);
  word-break: break-word;
}
.credential-box:hover {
  transform: translateY(-1px);
  border-color: rgba(91,108,255,0.28);
  background: linear-gradient(180deg, rgba(91,108,255,0.12), rgba(91,108,255,0.05));
}
.credential-index {
  margin-bottom: 10px;
  color: #dfe4ff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.credential-value {
  display: block;
  padding-right: 96px;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  user-select: all;
  -webkit-user-select: all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.credential-copy {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 800;
}

/* Info / empty / loading */
.info-box {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}
.info-yellow { background: var(--warning-soft); color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.info-blue { background: var(--info-soft); color: #9addff; border: 1px solid rgba(56,189,248,0.2); }
.info-green { background: var(--success-soft); color: #a3efbf; border: 1px solid rgba(34,197,94,0.2); }
.empty-state {
  padding: 56px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 56px;
  margin-bottom: 14px;
  opacity: 0.55;
}
.empty-state h3 {
  margin-bottom: 8px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 760;
}
.empty-state p {
  color: var(--fg-subtle);
  max-width: 460px;
  margin: 0 auto;
}
.spinner {
  width: 32px;
  height: 32px;
  margin: 32px auto;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
.spinner-sm {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-card {
  height: 296px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: skeleton 1.2s linear infinite;
}
@keyframes skeleton {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* State / support / history */
.state-card { margin-top: 20px; }
.state-card .empty-icon { font-size: 48px; margin-bottom: 12px; }
.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}
.support-copy,
.support-hint {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.history-list {
  display: grid;
  gap: 12px;
}
.history-card { padding: 16px; }
.history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.history-meta {
  font-size: 12px;
  line-height: 1.65;
  margin-bottom: 12px;
}
.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.track-card code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.order-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.order-progress-step {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
}
.order-progress-step span {
  display: block;
  font-size: 14px;
  font-weight: 760;
  color: var(--fg-subtle);
}
.order-progress-step small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--fg-faint);
}
.order-progress-step.active {
  background: var(--accent-soft);
  border-color: rgba(91,108,255,0.22);
}
.order-progress-step.active span,
.order-progress-step.active small { color: #dfe4ff; }

/* Tickets / accordion */
.ticket-messages {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}
.ticket-msg {
  max-width: min(86%, 720px);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.msg-buyer {
  align-self: flex-start;
  background: var(--surface-2);
}
.msg-admin {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: rgba(91,108,255,0.22);
}
.msg-sender {
  margin-bottom: 4px;
  color: var(--fg-subtle);
  font-size: 11px;
  font-weight: 800;
}
.msg-text {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.6;
}
.msg-time {
  margin-top: 6px;
  color: var(--fg-faint);
  font-size: 11px;
}
.ticket-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ticket-image {
  width: 100%;
  max-width: 180px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.accordion {
  margin-top: 10px;
  overflow: hidden;
}
.accordion summary {
  list-style: none;
  position: relative;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 760;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-faint);
  font-size: 16px;
}
.accordion[open] summary::after {
  content: "−";
  color: #dfe4ff;
}
.accordion-body {
  padding: 0 16px 16px;
  color: var(--fg-subtle);
  font-size: 13px;
  line-height: 1.7;
}

/* Toast / footer */
#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}
.toast {
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(21,27,36,0.98);
  border: 1px solid var(--border);
  color: var(--fg);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.22s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
.toast.hiding { animation: slideOut 0.22s ease forwards; }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateY(12px); opacity: 0; } }

.footer {
  margin-top: 40px;
  padding: 44px 20px;
  border-top: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.02);
}
.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 760;
}
.footer-text {
  margin-bottom: 16px;
  font-size: 13px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.footer-link-btn,
.footer-links button {
  border: none;
  background: none;
  color: var(--fg-subtle);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  transition: color var(--transition);
}
.footer-link-btn:hover,
.footer-links button:hover,
.footer-link-btn.active {
  color: #dfe4ff;
}
.footer-copyright {
  font-size: 11px;
}

/* Maintenance */
.maintenance-overlay {
  position: fixed;
  right: 16px;
  left: 16px;
  bottom: 16px;
  z-index: 250;
  display: flex;
  align-items: end;
  justify-content: center;
  pointer-events: none;
}
.maintenance-card {
  width: 100%;
  max-width: 540px;
  padding: 20px;
  pointer-events: auto;
  text-align: center;
  border-color: rgba(245,158,11,0.2);
}
.maintenance-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* Focus */
.logo:focus-visible,
.nav-btn:focus-visible,
.mobile-nav-btn:focus-visible,
.footer-link-btn:focus-visible,
.product-card:focus-visible,
.btn:focus-visible,
.form-input:focus-visible,
.accordion summary:focus-visible,
.qty-btn:focus-visible,
.hamburger:focus-visible {
  outline: 2px solid rgba(118,132,255,0.95);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .nav-desktop { display: none; }
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-nav { display: block; }
  .hero-stats { grid-template-columns: 1fr; max-width: 320px; }
  .support-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 68px; }
  .header-inner,
  .container { padding-left: 16px; padding-right: 16px; }
  .page { padding-top: 20px; padding-bottom: 72px; }
  .hero-banner-section { padding: 4px 0 14px; }
  .hero-banner-card { border-radius: 18px; }
  .hero { padding: 24px 0 20px; }
  .family-product-layout { grid-template-columns: 1fr; gap: 16px; }
  .family-selected-panel { padding: 14px; }
  .variant-pill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .variant-pill { min-height: 40px; padding: 9px 12px; font-size: 12px; }
  .family-selected-head { flex-direction: column; }
  .product-price { font-size: 15px; }
  .product-price-old { font-size: 10px; }
  .hero-subtitle { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 28px 0; }
  .catalog-toolbar {
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 20;
    padding: 10px;
    border-radius: 16px;
    background: rgba(13,16,22,0.9);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
  }
  .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .steps-grid,
  .trust-grid { grid-template-columns: 1fr; }
  .product-card-body { padding: 8px; }
  .product-card-title { font-size: 11px; min-height: 0; margin-bottom: 5px; }
  .product-price { font-size: 11px; }
  .product-hero img,
  .product-hero-placeholder { height: 220px; }
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .detail-value,
  .detail-total { text-align: left; width: 100%; }
  .history-card-top { flex-direction: column; align-items: flex-start; }
  .history-actions .btn,
  .state-actions .btn { width: 100%; }
  .order-progress { grid-template-columns: 1fr; }
  .page-back-button {
    width: 100%;
    justify-content: center;
    position: sticky;
    top: calc(var(--header-h) + 8px);
    z-index: 21;
    background: rgba(13,16,22,0.92);
    backdrop-filter: blur(14px);
  }
}

@media (max-width: 640px) {
  .header-inner,
  .container { padding-left: 14px; padding-right: 14px; }
  .hero-banner-card { border-radius: 16px; }
  .products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .variant-pill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-meta-grid { grid-template-columns: 1fr; }
  .family-selected-title { font-size: 1rem; }
  .family-selected-subtitle { font-size: 12px; }
  .product-price-big { font-size: 2.1rem; }
  .product-price-row-detail { gap: 8px; }
  .product-card-compact { border-radius: 12px; }
  .product-card-body { padding: 7px; }
  .product-card-title { font-size: 10px; }
  .product-price { font-size: 10px; }
  .logo-text {
    max-width: 126px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .page-header h1 { font-size: 1.45rem; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 14px; }
  .glass-card,
  .product-detail-card,
  .checkout-card,
  .payment-card,
  .history-card { padding: 16px; }
  .product-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn,
  .btn-lg,
  .btn-sm { min-height: 46px; }
  .countdown { font-size: 1.9rem; }
  .credential-box { padding: 16px 14px 14px; }
  .credential-value {
    padding-right: 0;
    font-size: 14px;
  }
  .credential-copy {
    position: static;
    margin-top: 10px;
  }
  .action-stack-spaced {
    position: sticky;
    bottom: 10px;
    z-index: 18;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(13,16,22,0.92);
    backdrop-filter: blur(12px);
  }
  #toast-container {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
  .toast { max-width: 100%; }
}