/* =========================================================
   MassageChairAdvisor.online - Global Styles (Light + Dark)
   Path: /assets/css/style.css
   ========================================================= */

/* 1) Theme tokens */
:root {
  /* Typography */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1320px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Light theme (default) */
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --surface: rgba(255, 255, 255, 0.90);
  --surface-strong: #ffffff;

  --text: #0f172a;
  --text-muted: #475569;

  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.18);

  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);

  /* Brand */
  --accent: #2563eb;
  --accent-2: #16a34a;
  --accent-soft: rgba(37, 99, 235, 0.12);

  /* Buttons */
  --btn-text: #ffffff;

  /* Header */
  --header-bg: rgba(248, 250, 252, 0.82);
  --header-border: rgba(15, 23, 42, 0.12);

  /* Footer */
  --footer-bg: #ffffff;

  /* Cookie */
  --cookie-bg: rgba(255, 255, 255, 0.96);
  --cookie-border: rgba(15, 23, 42, 0.18);
}

/* Dark overrides */
[data-theme="dark"] {
  --bg: #050816;
  --bg-alt: #020617;
  --surface: rgba(2, 6, 23, 0.90);
  --surface-strong: rgba(15, 23, 42, 0.94);

  --text: #f8fafc;
  --text-muted: #9ca3af;

  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);

  --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);

  --accent: #3b82f6;
  --accent-2: #22c55e;
  --accent-soft: rgba(59, 130, 246, 0.16);

  --header-bg: rgba(2, 6, 23, 0.78);
  --header-border: rgba(148, 163, 184, 0.18);

  --footer-bg: rgba(2, 6, 23, 0.90);

  --cookie-bg: rgba(2, 6, 23, 0.96);
  --cookie-border: rgba(148, 163, 184, 0.28);
}

/* 2) Base reset */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at top, var(--bg) 0, var(--bg-alt) 60%);
  color: var(--text);
  line-height: 1.6;
}

/* 3) Typography */
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.0rem, 3vw, 2.7rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; }
p { margin: 0.6rem 0; color: var(--text-muted); }
strong { color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 4) Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 2.2rem 0;
  border-top: 1px solid var(--border);
}
.section:first-of-type { border-top: none; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr);
  gap: 2rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

/* 5) Cards / surfaces */
.card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}
.card.soft {
  background: var(--surface);
  box-shadow: none;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.pill {
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
}

/* 6) Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 650;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}
.btn-primary {
  color: var(--btn-text);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.03); }

.btn-secondary {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}
.btn-secondary:hover { text-decoration: none; filter: brightness(1.02); }

/* 7) Header / Nav (Two-row layout) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

/* Anchor for absolutely-positioned header actions */
.site-header .container {
  position: relative;
}

.navbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 0 0.9rem;
}

/* Brand (Row 1) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  justify-content: center;
}
.brand img {
  height: 28px;
  width: auto;
}
.brand span {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--text);
}

/* Menu (Row 2) */
.navlinks {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap; /* menu can wrap if labels get long */
}
.navlinks a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.navlinks a:hover { color: var(--text); text-decoration: none; }

/* Header actions (top right) */
.header-actions {
  position: absolute;
  top: 0.9rem;
  right: 1.5rem;
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: nowrap;
}

/* Prevent header buttons from breaking into multiple lines */
.header-actions .btn,
.header-actions .theme-toggle {
  white-space: nowrap;
}

/* Header buttons compact */
.header-actions .btn {
  padding: 0.7rem 1.05rem;
  font-size: 0.9rem;
}

/* Theme toggle (compact) */
.theme-toggle {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.theme-toggle:hover { filter: brightness(1.02); }

/* 8) Hero */
.hero {
  padding: 2.2rem 0 2.5rem;
}
.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.hero p { color: var(--text-muted); }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
  align-items: center;
}

/* 9) Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  padding: 1.5rem 0 2.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  font-weight: 600;
}
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* 10) Cookie banner */
.sb-cookie-banner {
  position: fixed !important;
  bottom: 1rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 2rem);
  max-width: 760px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--cookie-border);
  background: var(--cookie-bg);
  box-shadow: var(--shadow);
  z-index: 200;
}
.sb-cookie-text {
  flex: 1 1 320px;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.sb-cookie-text strong { color: var(--text); }

.sb-cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sb-cookie-btn {
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 1.0rem;
  font-weight: 650;
  cursor: pointer;
}
.sb-cookie-btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--btn-text);
  border-color: transparent;
}

/* 11) Responsive */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }

  .header-actions {
    right: 1rem;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 1rem; }
  .btn { width: 100%; }
  .hero-ctas { width: 100%; }

  .header-actions {
    position: static;
    margin-top: 0.4rem;
    justify-content: center;
    width: 100%;
  }
}

/* =========================================================
   Amazon Product Box (Universal Component)
   ========================================================= */
.amz-box {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}

.amz-box-top {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.amz-box-media {
  width: 120px;
}

.amz-box-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.amz-box-placeholder {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.amz-box-placeholder-icon {
  font-size: 1.35rem;
}

.amz-box-placeholder-text {
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.amz-box-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.amz-box-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--text);
}

.amz-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}

.amz-box-bullets {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.amz-box-bullets li {
  margin: 0.2rem 0;
}

.amz-box-note {
  margin: 0.35rem 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.amz-box-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.amz-box-cta {
  white-space: nowrap;
}

.amz-box-disclaimer {
  color: var(--text-muted);
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .amz-box-top {
    grid-template-columns: 1fr;
  }
  .amz-box-media {
    width: 100%;
  }
  .amz-box-img,
  .amz-box-placeholder {
    width: 100%;
    height: 120px;
  }
}

.content-divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.15),
    transparent
  );
  margin: 2.5rem 0;
}

.section-divider {
  padding-top: 0;
  padding-bottom: 0;
}
