:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #657089;
  --line: #e4e8f0;
  --surface: #ffffff;
  --background: #f6f8fc;
  --accent: #5e56f7;
  --accent-dark: #443dc8;
  --accent-soft: #efeeff;
  --success: #16795b;
  --success-soft: #e8f7f0;
  --warning: #8b5b08;
  --warning-soft: #fff6df;
  --danger: #b63a48;
  --shadow: 0 18px 48px rgba(44, 54, 93, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--ink);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(14px);
}

.brand { align-items: center; color: var(--ink); display: flex; gap: 12px; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.98rem; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: 0.72rem; margin-top: 3px; }
.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 11px;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  letter-spacing: 0.04em;
  width: 36px;
}
.mode-badge { background: var(--warning-soft); border: 1px solid #f1dc99; border-radius: 999px; color: var(--warning); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; padding: 8px 12px; }

.container { margin: 0 auto; max-width: 1180px; padding: 34px 22px 70px; }
.test-banner { align-items: flex-start; background: var(--warning-soft); border: 1px solid #f1dc99; border-radius: 16px; color: #6f4b0d; display: flex; gap: 13px; margin-bottom: 42px; padding: 16px 18px; }
.banner-icon { align-items: center; background: #f0c65a; border-radius: 50%; color: #5d4204; display: inline-flex; flex: 0 0 24px; font-weight: 900; height: 24px; justify-content: center; }
.test-banner strong { display: block; font-size: 0.95rem; }
.test-banner p { margin: 5px 0 0; font-size: 0.84rem; line-height: 1.5; }

.hero { align-items: end; display: flex; gap: 30px; justify-content: space-between; margin-bottom: 36px; }
.landing-hero { margin-bottom: 25px; padding-top: 12px; }
.eyebrow { color: var(--accent); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; margin: 0 0 10px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -0.055em; line-height: 1.04; margin-bottom: 17px; max-width: 720px; }
.hero-copy { color: var(--muted); line-height: 1.65; margin-bottom: 0; max-width: 700px; }
.hero-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); min-width: 150px; padding: 18px 20px; text-align: center; }
.hero-stat span { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.06em; }
.hero-stat small { color: var(--muted); font-size: 0.78rem; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.landing-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.landing-benefits { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 40px; }
.landing-benefits article { background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line); border-radius: 16px; padding: 16px 17px; }
.landing-benefits strong, .landing-benefits span { display: block; }
.landing-benefits strong { font-size: 0.9rem; margin-bottom: 6px; }
.landing-benefits span { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

.catalog-controls { margin-bottom: 20px; }
.catalog-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 12px; }
.catalog-heading .eyebrow { margin-bottom: 5px; }
.catalog-heading h2 { font-size: 1.45rem; letter-spacing: -0.04em; margin: 0; }
.result-count { color: var(--muted); font-size: 0.8rem; font-weight: 750; }
.toolbar { align-items: end; display: flex; gap: 14px; }
.toolbar label { color: var(--muted); display: flex; flex-direction: column; font-size: 0.75rem; font-weight: 700; gap: 7px; }
.toolbar .search-field { flex: 1; }
.toolbar input, .toolbar select, .email-field input { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--ink); min-height: 44px; outline: none; padding: 0 13px; }
.toolbar input:focus, .toolbar select:focus, .email-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94, 86, 247, 0.13); }

.product-grid { align-items: start; display: grid; gap: 17px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; min-height: 0; padding: 18px; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.product-card:hover { border-color: #c7c4ff; box-shadow: var(--shadow); transform: translateY(-2px); }
.product-visual { background: #f4f4fb; border-radius: 12px; height: 88px; margin: -2px -2px 13px; overflow: hidden; position: relative; width: calc(100% + 4px); }
.product-image { display: block; height: 100%; object-fit: contain; padding: 10px; position: relative; width: 100%; z-index: 1; }
.product-image-fallback { align-items: center; background: linear-gradient(135deg, #eeedff, #f8f7ff); color: var(--accent-dark); display: flex; gap: 10px; height: 100%; justify-content: center; position: absolute; inset: 0; }
.product-image-fallback[hidden] { display: none; }
.fallback-mark { align-items: center; background: var(--accent); border-radius: 12px; color: #fff; display: inline-flex; font-size: 1.05rem; font-weight: 850; height: 42px; justify-content: center; letter-spacing: -0.03em; width: 42px; }
.fallback-label { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.product-card-head { align-items: start; display: flex; flex-direction: column; gap: 8px; }
.product-card h3 { font-size: 1.08rem; letter-spacing: -0.025em; line-height: 1.25; margin: 0; }
.type-pill, .category-pill, .status-pill { border-radius: 999px; display: inline-flex; font-size: 0.68rem; font-weight: 800; padding: 6px 9px; white-space: nowrap; }
.product-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.category-pill { background: #f0f1f6; color: var(--muted); }
.type-pill.instant { background: var(--success-soft); color: var(--success); }
.type-pill.activation { background: var(--accent-soft); color: var(--accent-dark); }
.description-wrap { margin: 14px 0 16px; }
.product-description { color: var(--muted); font-size: 0.88rem; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.product-description.is-collapsed { -webkit-box-orient: vertical; -webkit-line-clamp: 4; display: -webkit-box; overflow: hidden; }
.details-toggle { background: transparent; border: 0; color: var(--accent-dark); font-size: 0.78rem; font-weight: 800; margin-top: 8px; padding: 0; }
.details-toggle:hover { text-decoration: underline; }
.product-card.expanded .product-description { display: block; }
.product-meta { align-items: end; border-top: 1px solid var(--line); display: flex; justify-content: space-between; padding-top: 15px; }
.product-price { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.03em; }
.product-stock { color: var(--muted); font-size: 0.74rem; margin-top: 4px; }
.button { border: 0; border-radius: 10px; font-weight: 750; min-height: 42px; padding: 0 15px; transition: background 160ms ease, transform 160ms ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: #f0f1f6; color: var(--ink); }
.button:disabled { cursor: wait; opacity: 0.6; transform: none; }

.empty-state, .error-message { border-radius: 12px; margin: 18px 0 0; padding: 14px 16px; }
.empty-state { background: #fff; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.error-message { background: #fff0f1; color: var(--danger); font-size: 0.85rem; }

.order-result { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); margin-top: 48px; padding: clamp(20px, 4vw, 32px); }
.section-heading { align-items: start; display: flex; justify-content: space-between; }
.section-heading h2 { font-size: 1.5rem; letter-spacing: -0.04em; margin-bottom: 0; }
.status-pill { background: var(--warning-soft); color: var(--warning); }
.status-pill.delivered { background: var(--success-soft); color: var(--success); }
.order-meta { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin: 26px 0 0; }
.order-meta div { background: var(--background); border-radius: 12px; padding: 13px 15px; }
.order-meta dt { color: var(--muted); font-size: 0.72rem; margin-bottom: 5px; }
.order-meta dd { font-size: 0.85rem; margin: 0; overflow-wrap: anywhere; }
.pending-notice { align-items: center; background: var(--warning-soft); border-radius: 12px; color: var(--warning); display: flex; font-size: 0.85rem; gap: 10px; margin-top: 18px; padding: 13px 15px; }
.spinner { animation: spin 800ms linear infinite; border: 2px solid #e7ca7b; border-right-color: var(--warning); border-radius: 50%; height: 16px; width: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.delivery-box { background: #131b2f; border-radius: 13px; color: #e9efff; margin-top: 18px; padding: 17px; }
.delivery-box h3 { color: #b8c4ed; font-size: 0.75rem; letter-spacing: 0.1em; margin-bottom: 11px; text-transform: uppercase; }
.delivery-box pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; line-height: 1.6; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.checkout-dialog { border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(18, 25, 54, 0.22); color: var(--ink); max-width: 440px; padding: 30px; width: calc(100% - 32px); }
.checkout-dialog::backdrop { background: rgba(21, 27, 52, 0.48); backdrop-filter: blur(3px); }
.checkout-dialog h2 { letter-spacing: -0.04em; margin-bottom: 8px; }
.dialog-close { background: #f0f1f6; border: 0; border-radius: 50%; color: var(--muted); font-size: 1.25rem; height: 30px; line-height: 1; position: absolute; right: 18px; top: 18px; width: 30px; }
.checkout-product { color: var(--muted); margin-bottom: 4px; }
.checkout-price { font-size: 1.45rem; font-weight: 800; margin-bottom: 24px; }
.email-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.email-field span { font-size: 0.82rem; font-weight: 750; }
.email-field strong { color: var(--danger); }
.email-field small { color: var(--muted); line-height: 1.4; }
.email-field input { width: 100%; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 21px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; font-size: 0.75rem; justify-content: space-between; padding: 19px 22px 28px; }

@media (max-width: 800px) {
  .hero { align-items: start; flex-direction: column; }
  .hero-stat { min-width: 0; text-align: left; width: 100%; }
  .hero-stat span, .hero-stat small { display: inline; }
  .hero-stat span { margin-right: 6px; }
  .landing-benefits { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .site-header { padding: 15px 16px; }
  .container { padding: 24px 16px 50px; }
  .test-banner { margin-bottom: 24px; padding: 13px 14px; }
  .test-banner p { font-size: 0.78rem; }
  .hero { gap: 18px; margin-bottom: 24px; }
  h1 { font-size: clamp(1.85rem, 9vw, 2.35rem); margin-bottom: 12px; }
  .hero-copy { font-size: 0.9rem; line-height: 1.5; }
  .catalog-heading h2 { font-size: 1.25rem; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { padding: 16px; }
  .product-visual { height: 78px; }
  .product-card h3 { font-size: 1rem; }
  .product-description { font-size: 0.84rem; }
  .order-meta { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 5px; }
  .brand small { display: none; }
  .mode-badge { font-size: 0.62rem; padding: 7px 9px; }
}
