:root {
  --bg: #fafaf9;
  --ink: #1c1917;
  --muted: #78716c;
  --accent: #4f46e5;
  --card: #ffffff;
  --line: #e7e5e4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.tb-error {
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 20px;
  font-size: 14px;
  border-bottom: 1px solid #fecaca;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a { color: var(--muted); font-size: 15px; }
.site-header nav a:hover { color: var(--ink); }
.cart-link { margin-left: auto; font-weight: 600; font-size: 15px; }
.cart-link:hover { color: var(--accent); }
.uid { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

main { max-width: 1080px; margin: 0 auto; padding: 32px; }

.hero {
  background: linear-gradient(120deg, #eef2ff, #faf5ff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 64px 48px;
  margin-bottom: 28px;
}
.hero h1 { font-size: 42px; margin: 0 0 8px; }
.hero p { color: var(--muted); font-size: 18px; margin: 0 0 24px; }

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-size: 15px;
}
.cta:hover { background: #4338ca; }

.widget-slot { margin: 28px 0; }
.widget-slot.inline { margin-top: 24px; }
.widget-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 15px; margin: 12px 0 4px; }
.card span { color: var(--muted); font-size: 14px; }
.thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; }
.t1 { background: linear-gradient(135deg, #c7d2fe, #a5b4fc); }
.t2 { background: linear-gradient(135deg, #bbf7d0, #86efac); }
.t3 { background: linear-gradient(135deg, #fde68a, #fcd34d); }
.t4 { background: linear-gradient(135deg, #fbcfe8, #f9a8d4); }

.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-media { aspect-ratio: 1 / 1; border-radius: 16px; }
.product-info h1 { text-transform: capitalize; font-size: 32px; margin: 0 0 8px; }
.price { font-size: 22px; color: var(--accent); font-weight: 700; margin: 0 0 16px; }
.desc { color: var(--muted); margin-bottom: 20px; }

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 40px 32px;
  margin-top: 48px;
}
.subscribe { max-width: 460px; margin: 0 auto; text-align: center; }
.subscribe label { display: block; font-weight: 600; margin-bottom: 12px; }
.subscribe .row { display: flex; gap: 8px; }
.subscribe input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
}
.subscribe button {
  background: var(--ink);
  color: #fff;
  border: 0;
  padding: 0 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.subscribe small { display: block; margin-top: 10px; color: var(--muted); }
.subscribe code { background: #f5f5f4; padding: 1px 5px; border-radius: 4px; }
.legal { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 0; }

.section-title, .page-title { font-size: 24px; margin: 0 0 18px; }
.page-title { margin-top: 8px; }
.back { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.back:hover { color: var(--ink); }

/* Cart */
.cart { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.thumb.sm { width: 56px; height: 56px; aspect-ratio: auto; border-radius: 8px; flex: none; }
.cart-item-info { display: flex; flex-direction: column; }
.cart-item-info span { color: var(--muted); font-size: 14px; }
.cart-item-price { margin-left: auto; font-weight: 600; }
.cart-summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.cart-total { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 18px; }
.cart-summary form { display: flex; flex-direction: column; gap: 10px; }
.cart-summary input {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
}
.cart-summary .cta { text-align: center; }
.cart-summary small { display: block; margin-top: 12px; color: var(--muted); }
.cart-summary code { background: #f5f5f4; padding: 1px 5px; border-radius: 4px; }

/* Confirmation */
.confirmation { max-width: 520px; margin: 40px auto; text-align: center; }
.check {
  width: 64px; height: 64px; line-height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #dcfce7; color: #16a34a;
  font-size: 32px;
}
.order-lines { list-style: none; padding: 0; margin: 20px 0 28px; color: var(--muted); }
.order-lines li { padding: 4px 0; }

/* Prose (about, 404) */
.prose { max-width: 680px; margin: 0 auto; }
.prose h1 { font-size: 32px; margin: 0 0 16px; }
.prose h2 { font-size: 20px; margin: 28px 0 10px; }
.prose p { color: var(--muted); }
.prose ul { color: var(--muted); padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose.center { text-align: center; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .product { grid-template-columns: 1fr; }
  .cart { grid-template-columns: 1fr; }
  .site-header { flex-wrap: wrap; gap: 14px 18px; }
}

/* Triggerbee debug bar (server-side call trace) */
.tb-debug {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: #1c1917;
  color: #e7e5e4;
  font: 12px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
}
.tb-debug-toggle {
  width: 100%;
  text-align: left;
  background: #292524;
  color: #fff;
  border: 0;
  padding: 8px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.tb-debug-body { display: none; max-height: 40vh; overflow: auto; padding: 10px 16px 14px; }
.tb-debug.open .tb-debug-body { display: block; }
.tb-debug table { width: 100%; border-collapse: collapse; }
.tb-debug th, .tb-debug td { text-align: left; padding: 3px 10px 3px 0; white-space: nowrap; }
.tb-debug th { color: #a8a29e; font-weight: 600; border-bottom: 1px solid #44403c; }
.tb-debug td { border-bottom: 1px solid #292524; }
.tb-debug tr.ok td:nth-child(4) { color: #4ade80; }
.tb-debug tr.bad td { color: #fca5a5; }
.tb-debug tr.info td { color: #93c5fd; }
.tb-debug-empty { color: #a8a29e; }
.tb-debug details summary { cursor: pointer; color: #93c5fd; }
.tb-debug .hdr { margin-top: 6px; }
.tb-debug .hdr em { color: #a8a29e; font-style: normal; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; }
.tb-debug pre { margin: 2px 0 0; padding: 6px 8px; background: #0c0a09; border-radius: 4px; white-space: pre-wrap; word-break: break-all; max-width: 420px; }
.tb-debug small { display: block; margin-top: 8px; color: #a8a29e; }
.tb-debug code { background: #292524; padding: 1px 4px; border-radius: 3px; }
/* keep page content clear of the collapsed bar */
.site-footer { margin-bottom: 40px; }

/* uid cookie lifetime panel (proxy/ITP testing) */
.tb-cookies { margin: 2rem auto; max-width: 60rem; padding: 1rem 1.25rem; border: 1px solid #d4d4d8; border-radius: 8px; background: #fafafa; }
.tb-cookies h3 { margin: 0 0 .5rem; font-size: 1rem; }
.tb-cookies h4 { margin: 1rem 0 .35rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #52525b; }
.tb-cookies-note { font-size: .85rem; color: #52525b; margin: 0 0 .5rem; }
.tb-cookies-raw { background: #fff; border: 1px solid #e4e4e7; padding: .5rem; border-radius: 4px; font-size: .78rem; overflow-x: auto; margin: 0; }
.tb-cookies-empty { font-size: .85rem; color: #71717a; background: #fff; border: 1px dashed #d4d4d8; padding: .5rem; border-radius: 4px; }
.tb-cookies table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.tb-cookies th { text-align: left; border-bottom: 1px solid #d4d4d8; padding: .3rem .4rem; color: #52525b; font-weight: 600; }
.tb-cookies td { padding: .3rem .4rem; border-bottom: 1px solid #ececef; }
.tb-cookies-val { font-family: ui-monospace, monospace; }
.tb-cookies small { display: block; margin-top: .5rem; color: #71717a; font-size: .75rem; }
.tb-probe { padding: .55rem .7rem; border-radius: 4px; font-size: .85rem; border: 1px solid; }
.tb-probe--pending, .tb-probe--waiting { background: #fffbeb; border-color: #fcd34d; color: #713f12; }
.tb-probe--capped { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.tb-probe--survived { background: #f0fdf4; border-color: #86efac; color: #14532d; }
.tb-probe--odd { background: #f4f4f5; border-color: #d4d4d8; color: #3f3f46; }
