/* ═══════════════════════════════════════════════
   aillm satire store — terminal-core theme
   ═══════════════════════════════════════════════ */

/* ── reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --bg-card: #111;
  --border: #222;
  --border-light: #333;
  --text: #e0e0e0;
  --text-muted: #999;
  --text-dim: #777;
  --green: #00ff41;
  --green-dim: #00cc33;
  --amber: #ffb000;
  --magenta: #ff44ff;
  --cyan: #44ffff;
  --red: #ff4466;
  --font: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
  --font-ui: -apple-system, 'Segoe UI', system-ui, sans-serif;
  --radius: 4px;
  --max-w: 1100px;
  --glow-green: 0 0 10px rgba(0, 255, 65, 0.3);
  --glow-amber: 0 0 10px rgba(255, 176, 0, 0.3);
}

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: radial-gradient(ellipse 900px 500px at 50% -15%, rgba(0, 255, 65, 0.015) 0%, transparent 70%), var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* faint depth glow — like distant starlight on a dark horizon */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 500px 300px at 75% 15%, rgba(0, 255, 65, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 15% 85%, rgba(68, 255, 255, 0.02) 0%, transparent 70%);
}

/* a few sparse star dots + faint orbit ring peeking from bottom-left */
body::after {
  content: '';
  position: fixed;
  width: 280px;
  height: 280px;
  left: -70px;
  bottom: -70px;
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 65, 0.035);
  box-shadow:
    65vw 25vh 0 0 rgba(255,255,255,0.08),
    20vw 60vh 0 0 rgba(255,255,255,0.06),
    50vw 15vh 0 0 rgba(255,255,255,0.05),
    0 0 35px rgba(0, 255, 65, 0.015);
  z-index: -1;
  pointer-events: none;
}
@media (max-width: 768px) { body::before, body::after { display: none; } }

/* ── buttons ── */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  border-radius: var(--radius);
  line-height: 1.4;
}

.btn:hover { border-color: var(--green); color: var(--green); opacity: 1; }
.btn.primary {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
}
.btn.primary:hover {
  background: var(--green);
  color: var(--bg);
  box-shadow: var(--glow-green);
}
.btn.large { padding: 0.8rem 2rem; font-size: 1rem; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.3rem;
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--text);
}
.logo-bracket { color: var(--text-dim); font-weight: 300; }
.logo-text { color: var(--green); }
.logo-sub { color: var(--text-muted); font-size: 0.75rem; margin-left: 2px; }
.site-logo:hover .logo-text { text-shadow: var(--glow-green); }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-link { color: var(--text-muted); font-size: 0.95rem; }
.nav-link:hover { color: var(--green); }

.cart-link { position: relative; }
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  vertical-align: super;
  margin-left: 2px;
}
/* badge pulse animation */
@keyframes badge-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.cart-count.pulse { animation: badge-pulse .35s ease-out; }

/* ── hero ── */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

/* terminal-native space elements — monospace chars as celestial bodies */
.space-planet,
.space-star-1,
.space-star-2,
.space-star-3 {
  position: absolute;
  font-family: var(--font);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.space-planet {
  right: 6%;
  bottom: 8%;
  font-size: 32px;
  color: var(--green);
  opacity: 0.06;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.04);
}

.space-star-1 {
  left: 4%;
  top: 12%;
  font-size: 14px;
  color: var(--text);
  opacity: 0.08;
}

.space-star-2 {
  right: 12%;
  top: 18%;
  font-size: 10px;
  color: var(--text);
  opacity: 0.06;
}

.space-star-3 {
  left: 12%;
  bottom: 20%;
  font-size: 16px;
  color: var(--amber);
  opacity: 0.05;
}

.hero-content { position: relative; }

.hero-ascii {
  font-size: clamp(0.5rem, 1.5vw, 0.85rem);
  line-height: 1.5;
  color: var(--green);
  margin-bottom: 2rem;
  text-align: left;
  display: inline-block;
}

.hero-btn { margin-bottom: 1rem; }
.hero-sub { color: var(--text-muted); font-size: 0.9rem; }

.hero-terminal {
  margin-top: 3rem;
  max-width: 500px;
  width: 100%;
}

.terminal-output {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  font-size: 0.85rem;
  line-height: 1.8;
  text-align: left;
  color: var(--text-muted);
}

.terminal-output .prompt { color: var(--green); }
.terminal-output .output { color: var(--text-muted); }

@keyframes blink {
  50% { opacity: 0; }
}

/* ── featured products ── */
.featured-section {
  padding: 5rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}
.section-header h2 { font-size: 1.2rem; font-weight: 400; color: var(--text); }

/* ── product grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 2rem;
}

.product-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .25s;
  overflow: hidden;
  color: var(--text);
  position: relative;
}
.product-card:hover {
  border-color: var(--green);
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}
.product-card:hover .product-name { color: var(--green); }

.product-card-visual {
  aspect-ratio: 3/2;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  width: 60%;
  height: 60%;
  opacity: 0.4;
}

.grid-dot {
  background: var(--green);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  place-self: center;
  opacity: 0.5;
}
.grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--green);
  opacity: 0.3;
  font-family: var(--font);
}

.product-type-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  border: 1px solid var(--border);
}

.product-card-body { padding: 1.25rem; }
.product-name { font-size: 1rem; font-weight: 500; transition: color .2s; line-height: 1.4; }
.product-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.5; }

.product-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.product-price { color: var(--green); font-size: 1rem; }
.product-tokens { color: var(--text-muted); font-size: 0.8rem; }
.product-temp { color: var(--amber); font-size: 0.75rem; margin-left: auto; }

/* ── manifesto ── */
.manifesto-section {
  padding: 4rem 0;
  text-align: center;
}
.manifesto-ascii {
  display: inline-block;
  font-size: clamp(0.5rem, 1.2vw, 0.8rem);
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}

/* ── shop page ── */
.page-header {
  padding: 3rem 0 2rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 400; margin-bottom: 0.5rem; }
.page-header .subtitle { color: var(--text-muted); font-size: 0.9rem; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  max-width: 400px;
}
.search-input {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  outline: none;
}
.search-input:focus { border-color: var(--green); }
.search-input::placeholder { color: var(--text-dim); }
.search-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-radius: var(--radius);
  font-family: var(--font);
}
.search-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
/* result count after search */
.search-count { margin-top: 0.5rem; }

.search-clear {
  color: var(--text-dim);
  font-size: 1.2rem;
  line-height: 1;
}
.search-clear:hover { color: var(--red); }

/* ── product detail ── */
.product-detail {
  padding: 2rem 0;
}

.breadcrumb { margin-bottom: 2rem; }

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .product-detail-layout { grid-template-columns: 1fr; gap: 2rem; }
}

/* model card frame */
.model-card-frame {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.model-card-header {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}
.model-label { color: var(--green); text-transform: uppercase; letter-spacing: 0.1em; }
.model-version { color: var(--text-dim); }
.model-card-body { padding: 1.5rem 1rem; }
.model-name { font-size: 1.3rem; margin-bottom: 1.5rem; line-height: 1.3; }
.model-specs { display: flex; flex-direction: column; gap: 0.75rem; }
.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}
.spec-label { color: var(--text-muted); }
.spec-value { color: var(--amber); text-align: right; }
.model-card-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* product info */
.product-title { font-size: 1.5rem; font-weight: 500; line-height: 1.3; }
.product-description { color: var(--text-muted); font-size: 0.9rem; margin-top: 1rem; line-height: 1.7; }

.product-features { margin-top: 1.5rem; }
.product-features h3 { font-size: 0.85rem; font-weight: 400; color: var(--green); margin-bottom: 0.5rem; }
.product-features ul { display: flex; flex-direction: column; gap: 0.4rem; }
.product-features li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
}

.product-pricing {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}
.price-label { color: var(--text-muted); }
.price-amount { color: var(--green); font-size: 1.4rem; font-weight: 500; }
.price-tokens { color: var(--amber); }
.price-temp { color: var(--magenta); }

.add-to-cart-btn {
  width: 100%;
  margin-top: 2rem;
}

/* ── cart page ── */
.cart-contents { margin: 2rem 0; }

.cart-items { display: flex; flex-direction: column; gap: 1rem; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-item-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.9rem; }
.cart-item-price { color: var(--green); font-size: 0.85rem; margin-top: 0.25rem; }
.cart-item-actions { display: flex; align-items: center; gap: 1rem; }

.cart-item-remove {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.8rem;
  border-radius: var(--radius);
}
.cart-item-remove:hover { border-color: var(--red); color: var(--red); }

.cart-summary {
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}
.summary-row.delivery-note { color: var(--text-muted); font-size: 0.8rem; }

#checkout-btn { width: 100%; margin-top: 1rem; }
.secure-note { margin-top: 0.75rem; }
.token-note { margin-top: 0.25rem; }

/* overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.overlay-content pre {
  color: var(--green);
  font-size: 0.85rem;
  line-height: 1.6;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ── checkout page ── */
.checkout-result {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 3rem 0;
}
.checkout-result h1 { font-size: 1.4rem; margin: 1rem 0; }
.checkout-result .subtitle { color: var(--text-muted); font-size: 0.9rem; }
.token-count { color: var(--amber); font-size: 0.85rem; margin-top: 0.5rem; }

.downloads-section {
  margin-top: 3rem;
  text-align: left;
  width: 100%;
  max-width: 600px;
}
.downloads-section h2 { font-size: 1rem; font-weight: 400; margin-bottom: 0.5rem; color: var(--green); }

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.download-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.download-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.download-icon { color: var(--green); font-size: 1.2rem; }
.download-card h3 { font-size: 0.85rem; font-weight: 400; }
.file-type { font-size: 0.7rem; color: var(--text-dim); }
.download-btn {
  display: block;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--border);
  color: var(--green);
  font-size: 0.8rem;
  border-radius: var(--radius);
  margin-top: auto;
}
.download-btn:hover {
  background: var(--green);
  color: var(--bg);
  border-color: var(--green);
}

.receipt-ascii {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 2rem 0;
  white-space: pre;
}

.checkout-footer { margin-top: 2rem; }

/* ── about page ── */
.about-content {
  max-width: 650px;
  margin: 0 auto;
  padding: 3rem 0;
}
.about-ascii { margin-bottom: 2rem; text-align: center; }
.about-content h1 { font-size: 1.3rem; font-weight: 400; margin-bottom: 2rem; }

.about-section {
  margin-bottom: 2rem;
}
.about-section h2 {
  font-size: 0.9rem;
  color: var(--green);
  font-weight: 400;
  margin-bottom: 0.75rem;
  text-transform: lowercase;
}
.about-section p, .about-section li {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.about-section ul { display: flex; flex-direction: column; gap: 0.4rem; }
.about-section li {
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
}

.terminal-command {
  margin-top: 3rem;
}
.terminal-command pre {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.8;
  background: var(--bg-alt);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── error page ── */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
}
.error-page pre { color: var(--red); opacity: 0.6; font-size: 0.8rem; }

/* hook-list on about page — same style as .about-section ul */
.hook-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.hook-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
  list-style: none;
}

/* ── empty state ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
}

/* ── footer ── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  text-align: center;
}

.footer-ascii pre {
  font-size: 0.65rem;
  line-height: 1.5;
  color: var(--text-dim);
  display: inline-block;
  text-align: left;
  white-space: pre;
}

.footer-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.footer-link { color: var(--text-dim); font-size: 0.8rem; }
.footer-link:hover { color: var(--green); }
.footer-sep { color: var(--text-dim); font-size: 0.7rem; }
.footer-ssh { color: var(--text-dim); font-size: 0.8rem; font-family: var(--font); }
.footer-network {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.network-label { color: var(--text-dim); font-size: 0.7rem; opacity: 0.6; }
.footer-subtle {
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* ── product card image ── */
.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s, filter .3s;
  filter: brightness(0.9) contrast(1.05);
}
.product-card:hover .product-card-image {
  transform: scale(1.03);
  filter: brightness(1) contrast(1.1);
}

.product-card-visual:has(.product-card-image) {
  background: var(--bg);
}

/* ── product detail image ── */
.product-image-detail {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  filter: brightness(0.95);
  transition: filter .3s;
}
.product-image-detail:hover {
  filter: brightness(1);
  box-shadow: var(--glow-green);
}

/* ── pod / print badge ── */
.pods-badge {
  margin-top: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--amber);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--amber);
  line-height: 1.5;
  opacity: 0.8;
}

/* ── shipping section ── */
.shipping-section {
  padding: 3rem 0;
  text-align: center;
}
.shipping-section .ascii-art {
  display: inline-block;
  font-size: clamp(0.45rem, 1vw, 0.7rem);
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}

/* ── responsive ── */
@media (max-width: 600px) {
  html { font-size: 14px; }
  .product-grid { grid-template-columns: 1fr; }
  .hero { min-height: 60vh; }
  .nav-links { gap: 1rem; }
  .downloads-grid { grid-template-columns: 1fr; }
}

/* ── M I S S I N G   C L A S S E S ── */
/* (used by PHP pages but were never defined) */

/* inline text links */
.link {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 255, 65, 0.3);
  transition: all .2s;
}
.link:hover {
  text-decoration-color: var(--green);
  text-shadow: var(--glow-green);
}

/* subtle helper text (used on product, cart, checkout pages) */
.subtle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.text-center { text-align: center; }

/* glow class for ASCII art accents (index.php hero, checkout) */
.glow {
  text-shadow: var(--glow-green);
  animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { text-shadow: 0 0 8px rgba(0, 255, 65, 0.2); }
  50% { text-shadow: 0 0 18px rgba(0, 255, 65, 0.45), 0 0 40px rgba(0, 255, 65, 0.1); }
}

/* qty-badge for checkout download cards */
.qty-badge {
  display: inline-block;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
}

/* terminal-bracket wrapper for checkout messages */
.terminal-bracket {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  background: var(--bg-alt);
  max-width: 500px;
}

/* cart empty state container */
.cart-empty {
  text-align: center;
  padding: 3rem 0;
}

/* loading state — animated ellipsis */
@keyframes loading-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.loading {
  color: var(--text-muted);
  font-size: 0.85rem;
  animation: loading-pulse 1.2s ease-in-out infinite;
}
.loading::after {
  content: '...';
  animation: loading-ellipsis 1.5s steps(4, end) infinite;
  display: inline-block;
  width: 1.2em;
  text-align: left;
}
@keyframes loading-ellipsis {
  0% { content: '.'; }
  25% { content: '..'; }
  50% { content: '...'; }
  75% { content: ''; }
}

/* container utility (used by layout) */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* pre block styling for better ASCII rendering */
pre {
  font-family: var(--font);
  white-space: pre;
  overflow-x: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* improve link color in paragraphs and lists */
p a, li a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 255, 65, 0.25);
}
p a:hover, li a:hover {
  text-decoration-color: var(--green);
}

/* better sticky header on mobile */
@media (max-width: 600px) {
  .site-header { padding: 0.75rem 0; }
  .header-nav { flex-wrap: wrap; gap: 0.5rem; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .model-card-frame { margin-top: 1rem; }
  .terminal-bracket { padding: 1.25rem; }
}

/* ── subtle scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── image gallery for multi-image products (e.g. poster series) ── */
.image-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  transition: border-color .2s;
}

.gallery-item:hover {
  border-color: var(--green);
}

.gallery-image {
  width: 100%;
  display: block;
  filter: brightness(0.9) contrast(1.05);
  transition: filter .3s, transform .3s;
}

.gallery-item:hover .gallery-image {
  filter: brightness(1) contrast(1.1);
  transform: scale(1.02);
}

@media (max-width: 600px) {
  .image-gallery {
    grid-template-columns: 1fr;
  }
}

/* ── newsletter footer ── */
.footer-newsletter {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.newsletter-form {
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.newsletter-row {
  display: flex;
  gap: 0.5rem;
}

.newsletter-input {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  outline: none;
}

.newsletter-input:focus {
  border-color: var(--green);
}

.newsletter-input::placeholder {
  color: var(--text-dim);
}

.newsletter-btn {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--font);
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all .2s;
  white-space: nowrap;
}

.newsletter-btn:hover {
  background: var(--green);
  color: var(--bg);
}

.newsletter-status {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.newsletter-subtle {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* ── terminal typing animation ── */
#terminal-type {
  visibility: hidden;
}

#terminal-type .line {
  display: block;
  line-height: 1.8;
}

#terminal-type .line .prompt {
  color: var(--green);
}

#terminal-type .line.output {
  color: var(--text-muted);
}

/* ── category filter pills ── */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-xs, 0.4rem);
  margin-top: var(--gap, 1rem);
}

.filter-pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  text-transform: lowercase;
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  color: var(--text-muted, #888);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.filter-pill:hover {
  background: var(--border, #333);
  color: var(--text, #e0e0e0);
}

.filter-pill.active {
  background: var(--green, #5f5);
  color: var(--bg, #0d0d0d);
  border-color: var(--green, #5f5);
}

/* ── related products ── */
.related-products {
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border, #333);
  margin-top: 2rem;
}

.related-title {
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 1.2rem;
  color: var(--text-muted, #888);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap, 1rem);
}

.related-card-wrapper { position: relative; }

.related-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.15s;
}

.related-card:hover {
  border-color: var(--green, #5f5);
}

.related-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-secondary, #1a1a1a);
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted, #444);
}

.related-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
}

.related-card-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card-price {
  color: var(--green, #5f5);
  margin-left: 0.5rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── toast notification ── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
@media (max-width: 600px) {
  #toast-container { width: 90%; left: 5%; transform: none; }
  .toast { white-space: normal; text-align: center; }
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast-visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-error {
  border-color: var(--red);
  color: var(--red);
}

/* ── cart quantity controls ── */
.cart-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-qty-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.cart-qty-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.cart-qty-num {
  min-width: 28px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 28px;
}

/* ── hamburger menu ── */
.ham-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 4px;
}
.ham-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: background .2s;
}
.ham-btn:hover .ham-line {
  background: var(--green);
}

/* ── product card now wraps link + add button ── */
.product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.product-card-link:hover .product-name {
  color: var(--green);
}
/* ── card add button ── */
.card-add-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  background: rgba(10,10,10,0.85);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: var(--font);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
}
@media (hover: hover) {
  .card-add-btn { opacity: 0; }
  .product-card:hover .card-add-btn { opacity: 1; }
}
.card-add-btn:hover {
  background: var(--green);
  color: var(--bg);
  border-color: var(--green);
}
.card-add-btn:disabled {
  opacity: 1;
  cursor: default;
  border-color: var(--green);
}

/* ── mobile nav with hamburger ── */
@media (max-width: 600px) {
  .ham-btn { display: flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10,10,10,0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0 1.5rem;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
  }
  .nav-links.nav-open {
    max-height: 300px;
    padding: 1rem 1.5rem;
    display: flex;
  }
  .nav-links .nav-link {
    opacity: 0;
    transition: opacity .2s ease .1s;
  }
  .nav-links.nav-open .nav-link {
    opacity: 1;
  }

  .site-header { position: relative; } /* so .nav-links positions below */
  .header-nav { flex-wrap: wrap; }
}

/* ── noscript fallback ── */
.noscript-notice {
  text-align: center;
  padding: 3rem 1.5rem;
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.noscript-notice p {
  margin: 0.5rem 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}
