/* ===== cr1stal.shop — storefront ===== */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e3e8ef;
  --accent: #0891b2;
  --accent-d: #0e7490;
  --accent-l: #ecfeff;
  --header: #0f1b2d;
  --header-2: #16243a;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 20px rgba(15,23,42,.06);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.page { padding: 22px 0 48px; flex: 1 0 auto; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 18px; font-size: .95rem; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text); transition: .15s; white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(8,145,178,.28); }
.btn-primary:hover { background: var(--accent-d); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-d); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: default; }

/* ===== header ===== */
.site-header { background: var(--header); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; }
.logo-text { font-weight: 800; font-size: 1.16rem; letter-spacing: .2px; }
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-nav a { color: #cbd5e1; font-weight: 500; font-size: .94rem; }
.header-nav a:hover { color: #fff; text-decoration: none; }
.lang-switch { display: inline-flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 3px; }
.lang-switch a { color: #94a3b8; padding: 3px 9px; border-radius: 6px; font-size: .82rem; font-weight: 700; }
.lang-switch a:hover { color: #fff; text-decoration: none; }
.lang-switch a.is-active { background: var(--accent); color: #fff; }
.trust-strip { background: var(--header-2); }
.trust-strip-inner { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 8px 16px; }
.trust-item { display: inline-flex; align-items: center; gap: 6px; color: #93c5d6; font-size: .8rem; font-weight: 500; }
.trust-item .ico { width: 14px; height: 14px; color: #22d3ee; }

/* ===== hero ===== */
.hero {
  background: linear-gradient(135deg, #ecfeff 0%, #eef2ff 100%);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 40px 26px; text-align: center; margin-bottom: 26px;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -.3px; }
.hero-sub { color: var(--text-2); font-size: 1.02rem; margin-bottom: 22px; }

/* ===== features ===== */
.features { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 30px; }
.feature {
  display: flex; gap: 14px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm);
}
.feature-icon {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-l); color: var(--accent-d);
  display: flex; align-items: center; justify-content: center;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-title { font-weight: 700; }
.feature-text { color: var(--text-2); font-size: .9rem; }

/* ===== sections ===== */
.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title { font-size: 1.35rem; font-weight: 800; }
.section-meta { color: var(--muted); font-size: .9rem; }
.empty-note { color: var(--text-2); }

/* ===== grids ===== */
.grid { display: grid; gap: 14px; }
.grid-cats { grid-template-columns: repeat(2, 1fr); }
.grid-products { grid-template-columns: repeat(2, 1fr); }

/* ===== thumbnails / placeholders ===== */
.thumb-ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0891b2, #22d3ee); color: #fff;
}
.thumb-ph span { font-size: 2rem; font-weight: 800; opacity: .9; }
.thumb-ph.big span { font-size: 4rem; }

/* ===== category card ===== */
.category-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; color: var(--text); box-shadow: var(--shadow-sm); transition: .15s;
}
.category-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cbd5e1; }
.cat-thumb { aspect-ratio: 16 / 10; background: var(--surface-2); }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-thumb .thumb-ph { width: 100%; height: 100%; }
.cat-body { padding: 12px 14px; }
.cat-name { font-weight: 700; }
.cat-count { color: var(--muted); font-size: .82rem; margin-top: 2px; }

/* ===== product card ===== */
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; color: var(--text); box-shadow: var(--shadow-sm); transition: .15s;
  display: flex; flex-direction: column;
}
.product-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cbd5e1; }
.pc-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-thumb .thumb-ph { width: 100%; height: 100%; }
.stock-pill {
  position: absolute; top: 8px; left: 8px; font-size: .68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(4px);
}
.stock-pill.ok { background: rgba(240,253,244,.92); color: var(--ok); }
.stock-pill.out { background: rgba(254,242,242,.92); color: var(--danger); }
.pc-body { padding: 12px 14px; display: flex; flex-direction: column; flex: 1; }
.pc-name { font-weight: 700; font-size: .96rem; }
.pc-desc {
  color: var(--text-2); font-size: .84rem; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.pc-price { font-weight: 800; font-size: 1.08rem; color: var(--text); }
.pc-arrow { color: var(--accent); font-weight: 800; font-size: 1.1rem; }

/* ===== steps ===== */
.steps { display: grid; gap: 14px; grid-template-columns: 1fr; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.step-num {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 10px;
}
.step-title { font-weight: 700; }
.step-text { color: var(--text-2); font-size: .9rem; }

/* ===== breadcrumb ===== */
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-2); }
.bc-sep { margin: 0 6px; }
.bc-current { color: var(--text); }

/* ===== empty state ===== */
.empty-state {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r);
  padding: 40px 20px; text-align: center; color: var(--text-2);
}

/* ===== product page ===== */
.product-layout { display: grid; gap: 22px; grid-template-columns: 1fr; }
.product-image {
  width: 100%; border-radius: var(--r); border: 1px solid var(--border);
  aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface);
}
.product-image.thumb-ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #0891b2, #22d3ee); }
.product-title { font-size: 1.5rem; font-weight: 800; }
.product-badges { margin-bottom: 8px; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-out { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.price-big { font-size: 2rem; font-weight: 800; margin: 6px 0 16px; }
.block-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 8px; }
.product-desc { margin-bottom: 18px; }
.desc-text { white-space: pre-line; color: var(--text-2); margin: 0; }

/* ===== checkout form ===== */
.checkout-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 16px; }
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 7px; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: .95rem; font-family: inherit; color: var(--text); background: #fff;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,145,178,.12); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.hint-warn { color: var(--warn); }

.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.qty-btn {
  width: 42px; border: none; background: var(--surface-2); font-size: 1.2rem; font-weight: 700;
  color: var(--text); cursor: pointer;
}
.qty-btn:hover { background: var(--accent-l); color: var(--accent-d); }
.qty-input {
  width: 64px; text-align: center; border: none; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); font-size: 1rem; font-weight: 700; font-family: inherit;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; }

.pay-methods { display: flex; flex-direction: column; gap: 8px; }
.pay-option {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: .12s;
}
.pay-option:hover { border-color: var(--accent); }
.pay-option.is-selected { border-color: var(--accent); background: var(--accent-l); }
.pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.pay-option-body { flex: 1; }
.pay-option-name { display: block; font-weight: 600; font-size: .92rem; }
.pay-option-code { display: block; font-size: .76rem; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.pay-option-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex: none; position: relative;
}
.pay-option.is-selected .pay-option-check { border-color: var(--accent); }
.pay-option.is-selected .pay-option-check::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}

.buy-summary { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.buy-total { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.buy-total strong { font-size: 1.5rem; }
.notice { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px; color: var(--text-2); }
.notice-warn { background: var(--warn-bg); border-color: #fde68a; color: var(--warn); }

/* ===== order page ===== */
.order-wrap { max-width: 920px; margin: 0 auto; }
.order-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.order-head h1 { font-size: 1.4rem; margin: 0; }
.order-id { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); font-size: .8rem; word-break: break-all; }
.status-banner { border-radius: var(--r); padding: 14px 16px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 2px; }
.status-banner strong { font-size: 1.05rem; }
.status-banner span { font-size: .9rem; }
.status-banner.ok { background: var(--ok-bg); border: 1px solid #bbf7d0; color: var(--ok); }
.status-banner.warn { background: var(--warn-bg); border: 1px solid #fde68a; color: var(--warn); }
.status-banner.pending { background: var(--accent-l); border: 1px solid #a5f3fc; color: var(--accent-d); }
.order-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.pay-field { margin-bottom: 16px; }
.mini-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.copy-field {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px;
}
.copy-value { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; font-weight: 700; word-break: break-all; }
.copy-value.addr { font-weight: 600; font-size: .82rem; }
.copy-unit { font-weight: 700; color: var(--accent-d); font-size: .85rem; }
.copy-btn {
  flex: none; border: 1px solid var(--border); background: #fff; border-radius: 7px;
  padding: 5px 11px; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--accent-d);
  font-family: inherit;
}
.copy-btn:hover { background: var(--accent-l); }
.copy-btn.copied { color: var(--ok); border-color: #bbf7d0; }
.qr-box { text-align: center; margin: 16px 0; }
.qr-box img { display: inline-block; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px; background: #fff; }
.countdown-box { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.countdown { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; font-weight: 800; color: var(--text); }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .9rem; margin: 8px 0 12px; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.delivered-item {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 8px;
}
.delivered-item code { flex: 1; font-size: .9rem; font-weight: 700; word-break: break-all; }
.save-note { font-size: .84rem; color: var(--text-2); background: var(--accent-l); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.order-summary .meta-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.order-summary .meta-row:last-child { border-bottom: none; }
.meta-row span { color: var(--text-2); }
.meta-row b { text-align: right; word-break: break-word; }
.meta-row.total b { font-size: 1.15rem; }
.status-badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status-badge.pending, .status-badge.reserved { background: var(--accent-l); color: var(--accent-d); }
.status-badge.paid, .status-badge.available { background: var(--ok-bg); color: var(--ok); }
.status-badge.expired, .status-badge.sold { background: #f1f5f9; color: var(--text-2); }
.status-badge.canceled { background: var(--danger-bg); color: var(--danger); }
.status-badge.paid_needs_review { background: var(--warn-bg); color: var(--warn); }

/* ===== error page ===== */
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--accent); line-height: 1; }
.error-message { font-size: 1.3rem; margin: 10px 0 24px; }

/* ===== footer ===== */
.site-footer { background: var(--header); color: #cbd5e1; margin-top: auto; }
.footer-grid { display: grid; gap: 22px; grid-template-columns: 1fr; padding: 32px 16px; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: 8px; }
.footer-text { font-size: .88rem; color: #94a3b8; margin: 0 0 6px; }
.footer-link { color: #67e8f9; }
.pay-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-badge { background: var(--header-2); color: #93c5d6; border-radius: 7px; padding: 5px 11px; font-size: .78rem; font-weight: 700; }
.footer-bottom { background: #0a1320; padding: 14px 0; }
.footer-bottom .container { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: #64748b; }
.footer-disc { color: #475569; }

/* ===== responsive ===== */
@media (min-width: 640px) {
  .grid-cats { grid-template-columns: repeat(3, 1fr); }
  .grid-products { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 56px 30px; }
  .hero-title { font-size: 2.3rem; }
  .order-grid { grid-template-columns: 1.4fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (min-width: 960px) {
  .grid-cats { grid-template-columns: repeat(4, 1fr); }
  .grid-products { grid-template-columns: repeat(4, 1fr); }
  .product-layout { grid-template-columns: 1fr 1fr; align-items: start; }
  .product-gallery { position: sticky; top: 80px; }
}
@media (max-width: 480px) {
  .header-nav { gap: 10px; }
  .header-nav a:not(.lang-switch a) { font-size: .88rem; }
  .hero-title { font-size: 1.55rem; }
}
