/* =====================================================================
   AtTek — tech theme
   Loaded AFTER style.css on customer-facing pages only (storefront,
   checkout result pages, legal pages). The admin panel doesn't load
   this file, so it keeps its own clean look.
   ===================================================================== */

:root {
  --bg: #060B18;
  --bg-2: #0A1226;
  --panel: #0E1730;
  --panel-2: #131E3E;
  --ink: #EAF0FF;
  --ink-soft: #97A6C9;
  --border: rgba(130, 160, 255, 0.16);
  --border-strong: rgba(130, 160, 255, 0.34);

  --accent: #3DD6F5;      /* cyan */
  --accent-2: #5B7CFF;    /* electric blue */
  --accent-3: #9B7BFF;    /* violet */
  --moss: #3B6BFF;        /* legacy variable names, remapped to the new palette */
  --moss-dark: #2A52D6;
  --gold: #FFC857;

  --grad: linear-gradient(135deg, #2F6BFF 0%, #6D5CFF 100%);
  --grad-text: linear-gradient(90deg, #3DD6F5, #6C8BFF, #A78BFA, #3DD6F5);

  /* Theme building blocks: tints, glows and small details. Each theme
     in css/themes/ only needs to change the values in this block. */
  --tint-rgb: 255, 255, 255;       /* subtle surfaces on the background */
  --glass-rgb: 6, 11, 24;          /* see-through header and panels */
  --line-rgb: 130, 160, 255;       /* background grid lines */
  --accent-rgb: 61, 214, 245;
  --accent2-rgb: 91, 124, 255;
  --accent3-rgb: 109, 92, 255;
  --gold-rgb: 255, 200, 87;
  --danger-rgb: 255, 122, 122;
  --success-rgb: 82, 227, 166;
  --on-accent: #fff;               /* text on buttons */
  --on-gold: #1b1300;
  --placeholder: #6E7DA3;
  --chip-ink: #A9ECFA;
  --warn-ink: #FFD27A;
  --autofill: #101B3B;
  --scroll: #1B2850;
  --scroll-hover: #2A3A72;
  --blob-1: #2F6BFF;
  --blob-2: #7C4DFF;
  --blob-3: #11B5D8;
  --blob-opacity: 1;
  --media-bg: #F3F4F7;            /* behind product photos (most have white backgrounds) */

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color-scheme: dark;
}

/* ---------- Base ---------- */

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

[id] { scroll-margin-top: 84px; }

::selection { background: rgba(var(--accent2-rgb), 0.45); color: #fff; }

button { color: inherit; font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad);
  color: var(--on-accent);
  border: 0;
  border-radius: 12px;
  padding: 14px 26px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -10px rgba(var(--accent2-rgb), 0.75);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
  background: var(--grad);
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -10px rgba(var(--accent2-rgb), 0.9);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--tint-rgb), 0.03);
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 48px;
  background: rgba(var(--glass-rgb), 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.logo-img { height: 30px; }

.site-header nav { gap: 4px; }

.site-header nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-header nav a:hover {
  color: var(--ink);
  background: rgba(var(--tint-rgb), 0.07);
}

.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(var(--tint-rgb), 0.06);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 7px 7px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cart-toggle:hover {
  background: rgba(var(--tint-rgb), 0.1);
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

#cartCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--grad);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
}

.cart-toggle.bump { animation: bump 0.45s ease; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  max-width: none;
  padding: 84px 0 96px;
  overflow: hidden;
  isolation: isolate;
}

/* Fades the glowing background into the page instead of ending in a hard line */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.blob {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  will-change: transform;
}

.blob.b1 { background: var(--blob-1); top: -180px; left: -120px; animation: drift1 22s ease-in-out infinite alternate; }
.blob.b2 { background: var(--blob-2); top: 40px; right: -160px; animation: drift2 26s ease-in-out infinite alternate; }
.blob.b3 { background: var(--blob-3); bottom: -260px; left: 32%; opacity: 0.3; animation: drift3 30s ease-in-out infinite alternate; }

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--line-rgb), 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--line-rgb), 0.09) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 75%);
  animation: gridMove 28s linear infinite;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero-text > * {
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.hero-text > *:nth-child(2) { animation-delay: 0.18s; }
.hero-text > *:nth-child(3) { animation-delay: 0.3s; }
.hero-text > *:nth-child(4) { animation-delay: 0.42s; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(var(--tint-rgb), 0.04);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0 0 24px;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.4vw, 70px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
}

.gradient-text {
  background: var(--grad-text);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s linear infinite;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0 0 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Hero showcase: crossfading, slowly zooming product images */

.hero-visual {
  position: relative;
  opacity: 0;
  animation: fadeUp 1s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.showcase-wrap {
  position: relative;
  border-radius: 30px;
  padding: 2px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 40px 90px -30px rgba(var(--accent2-rgb), 0.55), 0 0 0 1px rgba(var(--tint-rgb), 0.03);
}

/* A slowly rotating gradient shows through the 2px padding as a glowing edge */
.showcase-wrap::before {
  content: "";
  position: absolute;
  width: 220%;
  height: 220%;
  top: -60%;
  left: -60%;
  z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 30%, var(--accent) 45%, transparent 60%, var(--accent-3) 80%, transparent 95%);
  animation: spin 9s linear infinite;
}

.showcase-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--panel);
  cursor: pointer;
}

.showcase-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 11, 24, 0.9) 0%, rgba(6, 11, 24, 0.15) 45%, transparent 70%);
  pointer-events: none;
}

.showcase-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(var(--accent2-rgb), 0.25), transparent 60%), var(--panel);
}

.showcase-empty img { width: 52%; opacity: 0.9; animation: bob 6s ease-in-out infinite alternate; }

.hero-visual.has-slides .showcase-empty { display: none; }

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1.2s ease;
}

.slide.active { opacity: 1; animation: kenburns 6.8s ease-out forwards; }
.slide.prev { transform: scale(1.14); }

.showcase-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.cap-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  max-width: 70%;
}

.cap-price {
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.showcase-dots {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.dot.active { width: 24px; background: #fff; }

/* ---------- Trust strip ---------- */

.trust-strip {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: -38px auto 0;
  padding: 0 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(var(--glass-rgb), 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
}

.trust-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent3-rgb), 0.22));
}

.trust-item strong { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.trust-item span { font-size: 13px; color: var(--ink-soft); }

/* ---------- Shop ---------- */

.shop {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 48px 96px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 32px;
}

.section-kicker {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.section-hint { margin: 0; font-size: 14px; color: var(--ink-soft); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.card-wrap { display: flex; }
.card-wrap > .product-card { flex: 1; }

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(var(--tint-rgb), 0.05), rgba(var(--tint-rgb), 0.015));
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 24px 55px -22px rgba(var(--accent-rgb), 0.4);
  outline: none;
}

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;           /* CJ product photos are square */
  overflow: hidden;
  background: var(--media-bg);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;           /* show the whole photo, never crop it */
  display: block;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.product-card:hover .card-media img { transform: scale(1.04); }

.card-media-empty {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 20%, rgba(var(--accent2-rgb), 0.35), transparent 60%), var(--panel-2);
}

.card-peek {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 10px);
  opacity: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(var(--glass-rgb), 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover .card-peek,
.product-card:focus-visible .card-peek { opacity: 1; transform: translate(-50%, 0); }

.product-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  flex: 1;
  cursor: pointer;
}

.product-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 500;
}

.icon { flex: none; }

.product-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
}

.price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.add-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--tint-rgb), 0.05);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.add-btn:hover {
  background: var(--grad);
  border-color: transparent;
  color: var(--on-accent);
  transform: translateY(-1px);
}

/* ---------- Ratings ---------- */

.star-rating {
  --pct: calc(var(--rating, 0) / 5 * 100%);
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--gold) var(--pct), rgba(var(--tint-rgb), 0.18) var(--pct));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.star-rating::before { content: "★★★★★"; }

.rating-line { color: var(--ink-soft); margin: 0; font-size: 13px; }
.no-reviews { color: var(--ink-soft); margin: 0; font-size: 13px; }

/* ---------- About ---------- */

.about {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px 110px;
}

.about h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.about-lead { max-width: 56ch; color: var(--ink-soft); font-size: 17px; margin: 0 0 36px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.feature-card {
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(var(--tint-rgb), 0.045), rgba(var(--tint-rgb), 0.01));
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.feature-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }

.feature-card .trust-icon { margin-bottom: 16px; }

.feature-card h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 8px; }
.feature-card p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.65; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 28px 48px;
}

.footer-links a { color: var(--ink-soft); transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Cart drawer, modals, forms ---------- */

.cart-backdrop {
  background: rgba(2, 5, 14, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.cart-drawer {
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
}

.cart-header h3 { font-family: var(--font-display); font-weight: 600; }

#cartClose,
.cart-header button {
  color: var(--ink-soft);
  background: none;
  border: 0;
  font-size: 26px;
  cursor: pointer;
  transition: color 0.2s ease;
}

#cartClose:hover,
.cart-header button:hover { color: var(--ink); }

.cart-item img { border-radius: 10px; }

.cart-item-controls button {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cart-item-controls button:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }

.cart-footer { border-top: 1px solid var(--border); }

.cart-total-row { font-family: var(--font-display); font-size: 18px; }

.cart-error { color: var(--danger, #FF8A8A); }

.modal {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.65);
}

input,
textarea,
select,
#checkoutForm input,
#reviewForm input,
#reviewForm textarea {
  background: rgba(var(--tint-rgb), 0.05);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(var(--tint-rgb), 0.07);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

::placeholder { color: var(--placeholder); }

#checkoutForm a,
.modal a { color: var(--accent); }

/* Product detail modal */

.product-modal-image {
  border-radius: 16px;
  aspect-ratio: 1 / 1;
  max-height: min(68vh, 520px);
  object-fit: contain;
  background: var(--media-bg);
}

.product-modal-about {
  margin: 4px 0 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(var(--tint-rgb), 0.04);
  border: 1px solid var(--border);
}

.product-modal-about h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.product-modal-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.reviews-section { border-top-color: var(--border); }
.reviews-section h4 { font-family: var(--font-display); }
.review-item { border-bottom-color: var(--border); }

.star-select span { color: rgba(var(--tint-rgb), 0.2); transition: color 0.15s ease, transform 0.15s ease; }
.star-select span:hover { transform: scale(1.15); }
.star-select span.selected { color: var(--gold); }

.delivery-line { color: var(--ink-soft); }

/* ---------- Legal / policy pages, success & cancel ---------- */

.policy-page a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.policy-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.policy-page h2 { font-family: var(--font-display); }

.policy-note {
  background: var(--panel);
  border-color: var(--border);
  border-left-color: var(--gold);
}

.placeholder {
  background: rgba(var(--gold-rgb), 0.16);
  color: var(--warn-ink);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- Scroll reveal ---------- */

.reveal { opacity: 0; }
.reveal.in { animation: fadeUp 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal.shown { opacity: 1; }

/* ---------- Animations ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

@keyframes drift1 { to { transform: translate3d(140px, 90px, 0) scale(1.18); } }
@keyframes drift2 { to { transform: translate3d(-120px, 110px, 0) scale(1.1); } }
@keyframes drift3 { to { transform: translate3d(90px, -70px, 0) scale(1.22); } }

@keyframes gridMove { to { background-position: 56px 56px; } }

@keyframes shimmer { to { background-position: -250% 0; } }

@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}

@keyframes kenburns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.14); }
}

@keyframes bob {
  from { transform: translateY(-6px); }
  to   { transform: translateY(8px); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero { padding: 56px 0 84px; }
  .hero-inner { grid-template-columns: 1fr; gap: 44px; padding: 0 24px; }
  .hero-visual { max-width: 520px; width: 100%; margin: 0 auto; }
  .trust-strip { grid-template-columns: 1fr; padding: 0 24px; margin-top: -30px; }
  .feature-grid { grid-template-columns: 1fr; }
  .shop { padding: 56px 24px 80px; }
  .about { padding: 0 24px 80px; }
}

@media (max-width: 640px) {
  .site-header { padding: 12px 18px; }
  .site-header nav a { padding: 8px 10px; font-size: 13px; }
  .site-header nav a:nth-child(3) { display: none; }
  .logo-img { height: 26px; }
  .site-footer { padding: 24px 20px; }
  .blob { width: 380px; height: 380px; filter: blur(70px); }
  .cap-name { font-size: 18px; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .product-card-body { padding: 14px; }
  .product-card h3 { font-size: 15px; }
  .price { font-size: 17px; }
  .add-btn { padding: 8px 12px; }
  .chip { font-size: 11px; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ---------- Respect "reduce motion" settings ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal, .hero-text > *, .hero-visual { opacity: 1 !important; }
}

/* ---------- Shop search + categories ---------- */
.shop-tools { display: flex; flex-direction: column; gap: 14px; margin: 0 0 26px; }
.shop-search { position: relative; max-width: 520px; }
.shop-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.shop-search input { width: 100%; padding: 13px 16px 13px 46px; border-radius: 999px; font-size: 15px; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-chips:empty { display: none; }
.shop-chip { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--ink-soft); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.shop-chip:hover { color: var(--ink); border-color: var(--accent); }
.shop-chip.active { color: var(--on-accent); background: var(--grad); border-color: transparent; }
.shop-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shop-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: var(--ink-soft); }
.shop-empty .btn-ghost { margin-top: 10px; }
.opt-count { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--accent); }

/* ---------- Option picker (e.g. phone model) ---------- */
.option-picker { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 14px; }
.option-picker label { font-size: 13px; font-weight: 600; color: var(--ink); }
.option-picker select { width: 100%; padding: 12px 14px; font-size: 15px; border-radius: 12px; }
.cart-item-option { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 4px; }

/* Checkout: the province dropdown matches the text boxes */
#checkoutForm select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
}
#checkoutForm select:invalid { color: var(--placeholder); }
#checkoutForm select option { color: var(--ink); background: var(--panel); }
#checkoutForm input,
#checkoutForm select { box-sizing: border-box; height: 42px; }

/* Delivery-area notes */
.hero-note { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); }
.checkout-note { margin: 0; font-size: 13px; color: var(--ink-soft); padding: 10px 12px; border-radius: 10px; background: rgba(var(--accent-rgb), 0.07); border: 1px solid var(--border); }
.checkout-note strong { color: var(--ink); }
.checkout-id-note { margin: -4px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.footer-note { font-size: 13px; color: var(--ink-soft); }

/* ---------- Colour theme picker (js/theme.js) ---------- */

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-picker { position: relative; }
.theme-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border-strong); background: rgba(var(--tint-rgb), 0.05); color: var(--ink);
  cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
}
.theme-btn:hover, .theme-btn[aria-expanded="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.theme-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 80; width: 240px; padding: 8px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.55);
}
.theme-menu[hidden] { display: none; }
.theme-menu-title { padding: 6px 10px 8px; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.theme-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 1px solid transparent;
  border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.theme-opt:hover { background: rgba(var(--tint-rgb), 0.06); }
.theme-opt[aria-checked="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.theme-swatch { flex: none; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.35); }
.theme-opt-text { display: grid; line-height: 1.25; }
.theme-opt-text strong { font-size: 14px; font-weight: 600; }
.theme-opt-text small { font-size: 12.5px; color: var(--ink-soft); }
.theme-picker.in-sidebar .theme-btn { display: flex; gap: 8px; justify-content: center; width: 100%; height: auto; border-radius: 10px; }
.theme-picker.in-sidebar .theme-menu { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; width: 100%; min-width: 220px; }
@media (max-width: 640px) {
  .theme-btn { width: 38px; height: 38px; }
  .header-actions { gap: 6px; }
  /* Phone: logo, theme and cart on the top row; links on a row below */
  .site-header { flex-wrap: wrap; row-gap: 6px; }
  .site-header .logo { order: 1; }
  .site-header .header-actions { order: 2; }
  .site-header nav { order: 3; width: 100%; justify-content: center; }
  .site-header nav a { white-space: nowrap; }
  .site-header nav a:nth-child(3) { display: inline-block; }
}

/* Product name links (to /product/<name>) look like plain headings */
.card-link { color: inherit; text-decoration: none; }
.modal-fullpage { display: block; text-align: center; margin: 12px 0 4px; font-size: 14px; color: var(--accent); }

/* Test-mode banner (js/theme.js), shown while PayFast is in sandbox mode */
.test-banner {
  position: relative; z-index: 40; padding: 10px 18px; text-align: center;
  font-size: 14px; line-height: 1.45; color: #2B1D00;
  background: repeating-linear-gradient(135deg, #FFC857 0 18px, #FFD27A 18px 36px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.test-banner strong { font-weight: 700; }
html.is-test-mode #checkoutForm .checkout-note::after {
  content: " Test mode: use PayFast's sandbox test details. No real money is taken.";
  display: block; margin-top: 6px; color: var(--warn-ink); font-weight: 600;
}
@media (max-width: 640px) { .test-banner { font-size: 12.5px; padding: 8px 12px; } }

/* Payment method choice at checkout */
.pay-methods { border: 0; margin: 2px 0 0; padding: 0; display: grid; gap: 8px; }
.pay-methods legend { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; padding: 0; }
.pay-method { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: rgba(var(--tint-rgb), 0.03); cursor: pointer; }
.pay-method[hidden] { display: none; }
.pay-method input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.pay-method strong { display: block; font-size: 14.5px; }
.pay-method small { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.pay-method:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
#checkoutForm .pay-method input[type=radio] { width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 2px 0 0; flex: none; box-shadow: none; }
#checkoutForm .pay-method > span { flex: 1; min-width: 0; }

/* ---------- Home: hero points, How it works, FAQ ---------- */
.hero-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-soft); }
.hero-points li { position: relative; padding-left: 26px; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }

.how { max-width: 1200px; margin: 0 auto; padding: 0 48px 90px; }
.how h2 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 28px; text-wrap: balance; }
.how-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.how-steps li { counter-increment: step; position: relative; display: grid; gap: 6px; align-content: start; padding: 22px 20px 20px; border-radius: 18px; border: 1px solid var(--border); background: rgba(var(--tint-rgb), 0.03); }
.how-steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-bottom: 6px; font-weight: 700; font-size: 14px; color: var(--on-accent); background: var(--grad); }
.how-steps strong { font-size: 16px; }
.how-steps span { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-item { border: 1px solid var(--border); border-radius: 14px; background: rgba(var(--tint-rgb), 0.03); }
.faq-item summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 600; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--accent); }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0; padding: 0 18px 16px; color: var(--ink-soft); line-height: 1.6; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 14px; }

/* Product names: never more than two lines on cards */
.product-card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Delivery estimate in the cart */
.cart-eta { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: rgba(var(--accent-rgb), 0.07); border: 1px solid var(--border); }
.cart-eta[hidden] { display: none; }

@media (max-width: 960px) {
  .how { padding: 0 24px 70px; }
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .how-steps { grid-template-columns: 1fr; }
}
