/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #0b0d12;
  --bg-elevated: #12151d;
  --bg-card: #161a24;
  --border: #262b38;
  --text: #eef0f5;
  --text-dim: #a2a8b8;
  --text-faint: #6b7387;
  --accent: #7c5cff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-2: #24d3c4;
  --warn: #f2b53a;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
  --radius: 14px;
  --radius-sm: 8px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 68px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 56px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.08; letter-spacing: -0.01em; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .2s var(--ease-out), background .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-2px); background: #8f74ff; }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-pending {
  background: var(--bg-elevated);
  color: var(--text-faint);
  border: 1px dashed var(--border);
  cursor: default;
  pointer-events: none;
}

/* =============================================================
   4. Header
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(11, 13, 18, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: #0e1017; }
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.header-left { display: flex; align-items: center; min-width: 64px; }
.lang-switch {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  color: var(--text-dim);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang-switch svg { width: 16px; height: 16px; flex: none; }
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); }
.brand svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }

.header-right { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.75rem); }
.header-right a { font-size: .9rem; font-weight: 500; color: var(--text-dim); transition: color .2s var(--ease-out); }
.header-right a:hover { color: var(--text); }

@media (max-width: 719px) {
  .header-right a:not(:last-child) { display: none; }
}

/* =============================================================
   5. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem);
  background:
    radial-gradient(60% 55% at 82% 0%, var(--accent-soft), transparent 65%),
    radial-gradient(45% 45% at 8% 100%, rgba(36, 211, 196, 0.10), transparent 70%);
}
.hero-inner { max-width: 780px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 600; letter-spacing: .03em;
  color: var(--accent-2);
  margin-bottom: 1rem;
}
.hero-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.hero-title { font-size: clamp(2.2rem, 5.6vw, 3.6rem); max-width: 16ch; margin-bottom: 1.1rem; }
.hero-subtitle { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--text-dim); max-width: 56ch; margin-bottom: 2rem; }
.hero-actions { display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; line-height: 1.2; }
.hero-stat strong { font-family: var(--display); font-size: 1.4rem; color: var(--text); }
.hero-stat span { font-size: .82rem; color: var(--text-faint); }

/* =============================================================
   6. Catalog switch bar
   ============================================================= */
.catalog-switch {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  background: rgba(11, 13, 18, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.catalog-switch-row {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  overflow-y: visible;
  padding-block: .85rem;
  scrollbar-width: thin;
}
.catalog-switch-row::-webkit-scrollbar { height: 4px; }
.catalog-switch-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.filter-pill {
  flex: none;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .88rem; font-weight: 600;
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out), background .2s var(--ease-out);
}
.filter-pill svg { width: 16px; height: 16px; flex: none; }
.filter-pill:hover { color: var(--text); border-color: var(--text-faint); }
.filter-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.filter-pill .pill-count {
  font-size: .75rem; font-weight: 700;
  opacity: .7;
}

/* =============================================================
   7. Catalog grid + cards
   ============================================================= */
.catalogo { padding-block: clamp(2rem, 5vw, 3rem) clamp(3rem, 6vw, 4.5rem); }

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

.product-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  transition: transform .25s var(--ease-out), border-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 16px 32px -18px rgba(124, 92, 255, 0.45);
}
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(124, 92, 255, 0.16), transparent 60%),
    var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.card-media svg { width: 44%; height: 44%; color: var(--accent); opacity: .9; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: .75rem; background: #fff; }
.card-cat-tag {
  position: absolute; top: .6rem; left: .6rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.72);
  border: 1px solid var(--border);
  font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--text-dim);
}
.card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-brand { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-2); }
.card-title { font-size: 1.02rem; font-weight: 600; line-height: 1.28; }
.card-desc {
  font-size: .87rem; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.card-price { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.card-rating { font-size: .82rem; color: var(--warn); font-weight: 600; }
.card-actions { margin-top: auto; display: flex; gap: .5rem; padding-top: .5rem; }
.card-actions .btn { flex: 1; padding: .6rem .9rem; font-size: .82rem; }

.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-faint);
  padding-block: 3rem;
  font-size: .95rem;
}

/* =============================================================
   8. Trust / how-we-pick
   ============================================================= */
.trust { padding-block: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--border); background: var(--bg-elevated); }
.trust-inner { max-width: 720px; }
.trust h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .9rem; }
.trust p { color: var(--text-dim); }

/* =============================================================
   9. Footer
   ============================================================= */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.25rem; background: var(--bg); }
.footer-disclosure { font-size: .78rem; color: var(--text-faint); line-height: 1.55; max-width: 900px; margin-bottom: 1.25rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--text-dim); }
.footer-row a { text-decoration: underline; text-underline-offset: 3px; color: var(--text-dim); }
.footer-row a:hover { color: var(--accent); }

/* =============================================================
   10. Modal
   ============================================================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6, 7, 11, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease-out);
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 720px) {
  .modal-overlay { align-items: center; padding: 2rem; }
}

.modal {
  width: 100%;
  max-width: 640px;
  max-height: min(88vh, 780px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  transform: translateY(24px);
  transition: transform .28s var(--ease-out);
  position: relative;
}
.modal-overlay.is-open .modal { transform: translateY(0); }
@media (min-width: 720px) {
  .modal { border-radius: var(--radius); }
}

.modal-close {
  position: absolute; top: .85rem; right: .85rem; z-index: 2;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(11, 13, 18, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
}
.modal-close svg { width: 18px; height: 18px; flex: none; }
.modal-close:hover { border-color: var(--accent); color: var(--accent); }

.modal-media {
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(124, 92, 255, 0.22), transparent 60%),
    var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.modal-media svg { width: 30%; height: 30%; color: var(--accent); }
.modal-media img { width: 100%; height: 100%; object-fit: contain; padding: 1.25rem; background: #fff; }

.modal-body { padding: 1.5rem 1.5rem 1.75rem; display: flex; flex-direction: column; gap: .9rem; }
.modal-tag {
  align-self: flex-start;
  padding: .3rem .65rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.modal-title { font-size: 1.4rem; }
.modal-brand { font-size: .9rem; color: var(--text-dim); }
.modal-highlights h4 { font-size: .85rem; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .4rem; }
.modal-highlights p { font-size: .97rem; color: var(--text); line-height: 1.6; }
.modal-cta { display: flex; }
.modal-price-note { font-size: .78rem; color: var(--text-faint); }
.modal-pending-note { font-size: .8rem; color: var(--text-faint); margin-top: .5rem; }
.modal-disclosure { font-size: .76rem; color: var(--text-faint); }
#modalMeta .card-meta { margin: -.2rem 0 .2rem; }
#modalMeta .card-price { font-size: 1.3rem; }
#modalMeta .card-rating { font-size: .92rem; }

/* =============================================================
   11. Legal page
   ============================================================= */
.legal-page { padding-block: clamp(2.5rem, 6vw, 4rem); }
.legal-inner { max-width: 720px; }
.legal-inner h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 1.75rem; }
.legal-inner h2 { font-size: 1.15rem; margin-block: 1.75rem .6rem; }
.legal-inner p { color: var(--text-dim); }
.legal-back-wrap { margin-top: 2.25rem; }

/* =============================================================
   12. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (min-width: 960px) {
  .product-grid { gap: 1.4rem; }
}
@media (min-width: 1280px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =============================================================
   13. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .product-card:hover { transform: none; }
  .btn-primary:hover { transform: none; }
}
