/* ============================================
   Helix — Product page
   v2.0 — Matches the live product HTML schema
   (product-page / product-grid / product-buy-card / size-selector / tabs / catalog-grid)
   Relies on design tokens from styles.css
   ============================================ */

/* ---------- TOKEN ALIASES ----------
   Inline styles in product HTML use some older / alternate token names.
   These aliases keep them rendering without touching the markup. */
:root {
  --bg: var(--canvas);
  --bg-elev-1: var(--surface-1);
  --bg-elev-2: var(--surface-2);
  --bg-elev-3: var(--surface-3);
  --text: var(--ink-1);
  --text-primary: var(--ink-1);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --text-mute: var(--ink-4);
  --text-soft: var(--ink-2);
  --accent-soft: var(--accent-dim);
  --accent-strong: var(--accent-bright);
  --r-md: var(--r-2);
  --t-xs: 11px;
  --t-sm: 13px;
  --t-md: 16px;
  --t-lg: 18px;
  --t-xl: 22px;
  --t-2xl: 26px;
  --t-3xl: 32px;
  --t-4xl: 42px;
}
.text-accent { color: var(--accent-bright); }

/* ---------- PAGE WRAPPER ---------- */
.product-page { padding: var(--s-3) 0 var(--s-10); }

/* ---------- HERO GRID ---------- */
.product-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--s-7);
  margin-top: var(--s-5);
  align-items: start;
}

/* LEFT visual column */
.product-image {
  background:
    radial-gradient(ellipse at 50% 28%, rgba(155, 179, 163, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, var(--surface-1), var(--canvas));
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-3) var(--s-5);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 580px;
  position: sticky;
  top: 92px;
  overflow: visible;
}
.product-image svg {
  width: 100%;
  height: auto;
  max-height: 640px;
  filter: drop-shadow(0 32px 64px rgba(0, 0, 0, 0.55));
}
/* brighter annotation text in the vial svg */
.product-image svg text[data-vial-label],
.product-image svg text[data-vial-sub] {
  fill: var(--accent-bright);
  letter-spacing: 0.12em;
}
.product-image svg text:not([data-vial-label]):not([data-vial-sub]) {
  fill: var(--ink-3);
  letter-spacing: 0.08em;
}

/* ---------- BUY CARD (right column) ---------- */
.product-buy { display: flex; flex-direction: column; gap: var(--s-3); }
.product-buy-card {
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.product-buy-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(34px, 4.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  margin: var(--s-1) 0 var(--s-2);
  font-weight: 400;
}
.product-buy-sub {
  font-size: 15px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* price block */
.product-buy-price {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-buy-price .now {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  line-height: 1;
}
.product-buy-price .now::before {
  content: '';
  display: inline-block;
}
.product-buy-price > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.product-buy-price .was {
  font-size: 16px;
  color: var(--ink-4);
  text-decoration: line-through;
  font-family: 'JetBrains Mono', monospace;
}
.product-buy-price .text-accent {
  color: var(--positive);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.product-buy-idr {
  font-size: 13px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  margin-top: calc(-1 * var(--s-2));
}

/* size selector */
.size-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-2);
}
.size-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-3);
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast) var(--ease);
  color: var(--ink-1);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.size-btn:hover { border-color: var(--accent-edge); background: var(--surface-3); }
.size-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-edge) inset;
}
a.size-btn { text-decoration: none; }
.size-btn .size-name {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.size-btn .size-price {
  font-family: 'Fraunces', serif;
  font-size: 19px;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.size-btn.active .size-price { color: var(--accent-bright); }

/* primary CTA */
.btn.btn-lg {
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* spec meta grid */
.product-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--canvas);
}
.product-meta-item {
  padding: var(--s-3) var(--s-3);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-meta-item:nth-child(3n) { border-right: none; }
.product-meta-item:nth-last-child(-n+3) { border-bottom: none; }
.product-meta-item .key {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 4px;
}
.product-meta-item .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-1);
}
.product-meta-item .val.text-accent { color: var(--accent-bright); font-family: 'JetBrains Mono', monospace; }

/* ---------- TABS ---------- */
.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink-1); }
.tab.active {
  color: var(--ink-1);
  border-bottom-color: var(--accent);
}

/* ---------- MOLECULAR PANEL ---------- */
.molecular-panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
}
.molecular-panel h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: var(--s-2);
  font-weight: 500;
}
.sequence-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent-bright);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  word-break: break-all;
  line-height: 1.55;
}

/* data-table is shared — defined in styles.css as needed */
.data-table { width: 100%; border-collapse: collapse; }
.data-table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
  vertical-align: top;
}
.data-table td:first-child {
  color: var(--ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 38%;
  padding-right: var(--s-3);
}
.data-table td:last-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-1);
}
.data-table tr:last-child td { border-bottom: none; }

/* ---------- RELATED PRODUCTS ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.product-card {
  display: block;
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-decoration: none;
  color: inherit;
  transition: all var(--t) var(--ease);
}
.product-card:hover {
  border-color: var(--accent-edge);
  transform: translateY(-2px);
  background: var(--surface-2);
}
.product-card-head { margin-bottom: var(--s-2); }
.product-card-cat {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.product-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-1);
  margin-bottom: var(--s-1);
  letter-spacing: -0.01em;
}
.product-card-sub {
  font-size: 12px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: var(--s-3);
}
.product-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.product-price { display: flex; align-items: baseline; gap: var(--s-2); }
.product-price .now {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.product-price .saves {
  font-size: 11px;
  color: var(--positive);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---------- SECTION HEAD (shared pattern) ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--s-4);
  gap: var(--s-4);
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}

/* ---------- MOBILE ---------- */
@media (max-width: 960px) {
  .product-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .product-image { position: relative; top: 0; min-height: 380px; padding: var(--s-4); }
  .product-meta { grid-template-columns: repeat(2, 1fr); }
  .product-meta-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .product-meta-item:nth-child(2n) { border-right: none; }
  .product-meta-item:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .product-meta-item:nth-last-child(-n+2) { border-bottom: none; }
  .product-buy-name { font-size: 32px; }
}
@media (max-width: 560px) {
  .size-selector { grid-template-columns: 1fr 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
  .product-buy-card { padding: var(--s-4); }
}