/* ============================================================================
   iEnTop Hub — Sistema de diseño
   hub.ientop.es · Tema dual (claro/oscuro) · Sin dependencias externas
   Fuente única de estilos para páginas estáticas y plantillas SSR.
   ========================================================================== */

/* ---------- Fuentes (autohospedadas, sin CDN) ---------- */
/* Inter desde nuestro CDN (una sola copia para todo el ecosistema).
   Variable 100..900: cubre tambien font-weight 600 y 900, que los
   @font-face estaticos de antes NO declaraban y el navegador
   sintetizaba. Sigue siendo autoalojada a efectos de RGPD:
   cdn.ientop.es es nuestro, no un tercero. */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('https://cdn.ientop.es/v1/inter-greek.woff2') format('woff2');unicode-range:U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('https://cdn.ientop.es/v1/inter-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url('https://cdn.ientop.es/v1/inter-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

/* ---------- Tokens: tema CLARO (por defecto) ---------- */
:root {
  /* superficies */
  --bg: #faf9f7;
  --bg-raised: #ffffff;
  --bg-sunken: #f1f0ed;
  --bg-header: rgba(250, 249, 247, .82);
  /* texto */
  --ink: #14161c;
  --ink-2: #4b5163;
  --ink-3: #7b8194;
  --ink-inverse: #ffffff;
  /* acento */
  --brand: #2447c9;
  --brand-strong: #1b37a3;
  --brand-soft: #e8edfd;
  --brand-ink: #ffffff;
  /* semánticos */
  --ok: #157347;
  --ok-soft: #e3f4eb;
  --warn: #9a6700;
  --warn-soft: #fdf3d8;
  --danger: #b3261e;
  --danger-soft: #fde9e7;
  /* líneas y sombras */
  --line: #e6e4df;
  --line-strong: #d5d3cc;
  --shadow-1: 0 1px 2px rgba(20, 22, 28, .05), 0 1px 1px rgba(20, 22, 28, .03);
  --shadow-2: 0 2px 6px rgba(20, 22, 28, .06), 0 12px 32px -12px rgba(20, 22, 28, .14);
  --shadow-3: 0 4px 12px rgba(20, 22, 28, .08), 0 24px 64px -20px rgba(20, 22, 28, .22);
  /* decoración */
  --hero-glow: radial-gradient(52rem 30rem at 78% -12%, rgba(36, 71, 201, .10), transparent 62%),
               radial-gradient(38rem 24rem at 8% -6%, rgba(36, 71, 201, .06), transparent 58%);
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(20, 22, 28, .012));
  /* métricas */
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-full: 999px;
  --container: 74rem;
  --header-h: 4.25rem;
  color-scheme: light;
}

/* ---------- Tokens: tema OSCURO ---------- */
/* (a) preferencia del sistema, si el usuario no ha forzado claro */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b11;
    --bg-raised: #14141d;
    --bg-sunken: #08080d;
    --bg-header: rgba(11, 11, 17, .78);
    --ink: #eceef4;
    --ink-2: #a6abc0;
    --ink-3: #767c93;
    --ink-inverse: #0b0b11;
    --brand: #7d97ff;
    --brand-strong: #a3b5ff;
    --brand-soft: rgba(125, 151, 255, .12);
    --brand-ink: #0b0b11;
    --ok: #4cc38a; --ok-soft: rgba(76, 195, 138, .12);
    --warn: #e5b458; --warn-soft: rgba(229, 180, 88, .12);
    --danger: #ef7d76; --danger-soft: rgba(239, 125, 118, .12);
    --line: #23232e;
    --line-strong: #32323f;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .5), 0 14px 40px -14px rgba(0, 0, 0, .7);
    --shadow-3: 0 4px 14px rgba(0, 0, 0, .55), 0 28px 72px -22px rgba(0, 0, 0, .8);
    --hero-glow: radial-gradient(52rem 30rem at 78% -12%, rgba(125, 151, 255, .12), transparent 62%),
                 radial-gradient(38rem 24rem at 8% -6%, rgba(125, 151, 255, .06), transparent 58%);
    --card-grad: linear-gradient(180deg, rgba(255, 255, 255, .015), rgba(255, 255, 255, 0));
    color-scheme: dark;
  }
}
/* (b) tema forzado por el usuario (toggle) — gana siempre */
:root[data-theme="dark"] {
  --bg: #0b0b11;
  --bg-raised: #14141d;
  --bg-sunken: #08080d;
  --bg-header: rgba(11, 11, 17, .78);
  --ink: #eceef4;
  --ink-2: #a6abc0;
  --ink-3: #767c93;
  --ink-inverse: #0b0b11;
  --brand: #7d97ff;
  --brand-strong: #a3b5ff;
  --brand-soft: rgba(125, 151, 255, .12);
  --brand-ink: #0b0b11;
  --ok: #4cc38a; --ok-soft: rgba(76, 195, 138, .12);
  --warn: #e5b458; --warn-soft: rgba(229, 180, 88, .12);
  --danger: #ef7d76; --danger-soft: rgba(239, 125, 118, .12);
  --line: #23232e;
  --line-strong: #32323f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .5), 0 14px 40px -14px rgba(0, 0, 0, .7);
  --shadow-3: 0 4px 14px rgba(0, 0, 0, .55), 0 28px 72px -22px rgba(0, 0, 0, .8);
  --hero-glow: radial-gradient(52rem 30rem at 78% -12%, rgba(125, 151, 255, .12), transparent 62%),
               radial-gradient(38rem 24rem at 8% -6%, rgba(125, 151, 255, .06), transparent 58%);
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, .015), rgba(255, 255, 255, 0));
  color-scheme: dark;
}

/* ---------- Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem; line-height: 1.65;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -.022em; margin: 0 0 .6em; font-weight: 800; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
h3 { font-size: 1.22rem; font-weight: 700; }
h4 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
strong { color: var(--ink); font-weight: 700; }
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Utilidades de maquetación ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.section { padding-block: clamp(3.2rem, 7vw, 5.5rem); }
.section--tight { padding-block: clamp(2.2rem, 5vw, 3.4rem); }
.section--sunken { background: var(--bg-sunken); border-block: 1px solid var(--line); }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 60rem) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 40rem) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: .6rem; z-index: 200; background: var(--brand); color: var(--brand-ink); padding: .55rem 1rem; border-radius: var(--r-sm); font-weight: 700; }
.skip-link:focus { left: .6rem; }

/* Cabecera de sección */
.section-head { max-width: 46rem; margin: 0 auto 2.4rem; text-align: center; }
.section-head .kicker { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent); padding: .34rem .8rem; border-radius: var(--r-full); margin-bottom: 1rem; }
.section-head p { color: var(--ink-2); font-size: 1.06rem; }

/* ---------- Header / navegación ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-header);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 1.4rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-co { height: 38px; width: auto; display: block; }
.brand-sep { width: 1px; height: 32px; background: var(--line); flex: none; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand .brand-hub { font-weight: 300; color: var(--ink-2); font-size: 1.1rem; letter-spacing: -.02em; padding-left: .05rem; }
@media (max-width: 520px) {
  .brand { gap: 10px; }
  .brand-co { height: 30px; }
  .brand-sep { height: 26px; }
  .brand-logo { height: 36px; }
  .brand .brand-hub { font-size: .95rem; }
}
.foot-ceo { display: flex; gap: 13px; align-items: center; margin-top: 1.1rem; }
.foot-ceo img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.fc-q { font-style: italic; font-size: .84rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
.fc-s { font-size: .78rem; color: var(--ink-2); margin: .3rem 0 0; }
.fc-s a { color: var(--brand); }
.main-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.main-nav a { color: var(--ink-2); font-weight: 500; font-size: .94rem; padding: .5rem .8rem; border-radius: var(--r-sm); }
.main-nav a:hover { color: var(--ink); background: var(--bg-sunken); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: .55rem; }
.nav-toggle { display: none; }
@media (max-width: 56rem) {
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--bg-raised); border-bottom: 1px solid var(--line);
    padding: .8rem clamp(1.1rem, 4vw, 2rem) 1.1rem; box-shadow: var(--shadow-2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8rem .9rem; font-size: 1rem; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1;
  padding: .78rem 1.35rem; border-radius: var(--r-full);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.02rem; }
.btn-sm { padding: .5rem .95rem; font-size: .85rem; }
.btn-icon { padding: .58rem; border-radius: var(--r-full); background: transparent; color: var(--ink-2); border: 1px solid transparent; }
.btn-icon:hover { color: var(--ink); background: var(--bg-sunken); }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--bg-raised); background-image: var(--card-grad);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card-pad { padding: 1.6rem; }

/* Tarjeta de tienda */
.store-card { display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; height: 100%; }
.store-card .store-logo {
  width: 3.4rem; height: 3.4rem; border-radius: var(--r-md); flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 1.25rem;
  background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  overflow: hidden;
}
.store-card .store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-card h3 { margin: 0; }
.store-card .store-meta { display: flex; flex-wrap: wrap; gap: .4rem .8rem; color: var(--ink-3); font-size: .84rem; }
.store-card .store-desc { color: var(--ink-2); font-size: .93rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-card .store-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }

/* Tarjeta de producto */
.product-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.product-card .product-media {
  aspect-ratio: 4 / 3; background: var(--bg-sunken); border-bottom: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-3); overflow: hidden;
}
.product-card .product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.product-card:hover .product-media img { transform: scale(1.035); }
.product-card .product-body { display: flex; flex-direction: column; gap: .45rem; padding: 1.05rem 1.15rem 1.25rem; flex: 1; }
.product-card .product-store { font-size: .8rem; color: var(--ink-3); }
.product-card .product-store a { color: inherit; }
.product-card h3 { font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .product-price { margin-top: auto; display: flex; align-items: baseline; gap: .55rem; }
.price { font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.price-old { color: var(--ink-3); text-decoration: line-through; font-size: .9rem; }
.price-iva { color: var(--ink-3); font-size: .76rem; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 700; padding: .28rem .68rem; border-radius: var(--r-full); border: 1px solid transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-neutral { background: var(--bg-sunken); color: var(--ink-2); border-color: var(--line); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(3.6rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem); background-image: var(--hero-glow); }
.hero .container { max-width: 56rem; text-align: center; }
.hero .lead { font-size: clamp(1.06rem, 2vw, 1.28rem); color: var(--ink-2); max-width: 42rem; margin-inline: auto; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2rem; }
.hero-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.6rem; margin-top: 2.6rem; color: var(--ink-3); font-size: .86rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-trust svg { color: var(--ok); }

/* Buscador grande */
.searchbar { display: flex; gap: .5rem; max-width: 38rem; margin: 2.2rem auto 0; padding: .45rem; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-full); box-shadow: var(--shadow-2); }
.searchbar:focus-within { border-color: var(--brand); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); padding: .5rem .4rem .5rem 1rem; }
.searchbar input:focus { outline: none; }
.searchbar input::placeholder { color: var(--ink-3); }

/* ---------- Iconos y features ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.feature { display: flex; flex-direction: column; gap: .7rem; padding: 1.6rem; height: 100%; }
.feature .feature-icon { width: 2.9rem; height: 2.9rem; border-radius: var(--r-md); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.feature .feature-icon .icon { width: 1.4rem; height: 1.4rem; }
.feature h3 { margin: 0; }
.feature p { color: var(--ink-2); font-size: .94rem; margin: 0; }

/* Pasos numerados */
.steps { counter-reset: step; display: grid; gap: 1.25rem; }
.step { position: relative; counter-increment: step; padding: 1.5rem 1.5rem 1.5rem 4.4rem; }
.step::before {
  content: counter(step); position: absolute; left: 1.3rem; top: 1.45rem;
  width: 2.1rem; height: 2.1rem; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: .95rem;
}
.step h3 { margin-bottom: .3rem; }
.step p { color: var(--ink-2); margin: 0; font-size: .95rem; }

/* ---------- FAQ (details nativo) ---------- */
.faq { display: grid; gap: .7rem; max-width: 50rem; margin-inline: auto; }
.faq details { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; font-weight: 700; padding: 1.05rem 1.3rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: .6rem; height: .6rem; flex: none; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .18s ease; margin-right: .2rem; }
.faq details[open] summary::after { transform: rotate(225deg); }
.faq .faq-body { padding: 0 1.3rem 1.2rem; color: var(--ink-2); font-size: .95rem; }
.faq .faq-body :last-child { margin-bottom: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding-block: 1rem 0; font-size: .84rem; color: var(--ink-3); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: .3rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); margin-inline: .15rem; }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--bg-raised);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: .68rem .9rem; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field .hint { font-size: .78rem; color: var(--ink-3); }
.field.invalid input { border-color: var(--danger); }
.field .error { font-size: .8rem; color: var(--danger); }

/* ---------- Prosa legal ---------- */
.prose { max-width: 46rem; margin-inline: auto; }
.prose h2 { font-size: 1.4rem; margin-top: 2.6em; }
.prose h3 { font-size: 1.08rem; margin-top: 1.8em; }
.prose p, .prose li { color: var(--ink-2); font-size: .97rem; }
.prose .legal-meta { color: var(--ink-3); font-size: .85rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 1.2em 0; }
.prose th, .prose td { text-align: left; padding: .6rem .7rem; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-sunken); color: var(--ink); font-weight: 700; }
.prose td { color: var(--ink-2); }
.prose .callout { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); border-radius: var(--r-md); padding: 1rem 1.2rem; font-size: .92rem; }
.legal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem 2rem; margin: 1.2em 0; }
.legal-grid dt { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .15rem; }
.legal-grid dd { margin: 0; color: var(--ink); font-weight: 500; font-size: .95rem; }
@media (max-width: 40rem) { .legal-grid { grid-template-columns: 1fr; } }

/* ---------- Página de tienda (SSR) ---------- */
.store-hero { padding-block: 2.2rem 1.8rem; border-bottom: 1px solid var(--line); background-image: var(--hero-glow); }
.store-hero .store-head { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.store-hero .store-logo { width: 4.6rem; height: 4.6rem; border-radius: var(--r-lg); display: grid; place-items: center; font-weight: 800; font-size: 1.7rem; background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); overflow: hidden; }
.store-hero .store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-banner { margin-bottom: 1.3rem; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.store-banner img { display: block; width: 100%; height: auto; max-height: 16rem; object-fit: cover; }
.store-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 .2rem; }
.store-hero .store-tagline { color: var(--ink-2); margin: 0; }
.store-hero .store-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.store-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding-block: 1.2rem; }
.store-toolbar .searchbar { margin: 0; flex: 1; min-width: 15rem; max-width: 26rem; box-shadow: none; }
.store-toolbar select { font: inherit; font-size: .9rem; color: var(--ink); background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-full); padding: .55rem 2rem .55rem 1rem; }

/* ---------- Ficha de producto (SSR) ---------- */
.product-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3.4rem); align-items: start; padding-block: 2rem 3rem; }
@media (max-width: 56rem) { .product-layout { grid-template-columns: 1fr; } }
.product-gallery { position: sticky; top: calc(var(--header-h) + 1rem); }
.product-gallery .gallery-main { aspect-ratio: 1; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-raised); display: grid; place-items: center; overflow: hidden; }
.product-gallery .gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.product-gallery .gallery-thumbs { display: flex; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }
.product-gallery .gallery-thumbs button { width: 4.2rem; height: 4.2rem; padding: 0; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-raised); overflow: hidden; cursor: pointer; }
.product-gallery .gallery-thumbs button[aria-current="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.product-gallery .gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.product-info .product-seller { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--ink-2); margin-bottom: 1rem; }
.buy-box { position: sticky; top: calc(var(--header-h) + 1rem); padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.buy-box .price { font-size: 2rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-full); overflow: hidden; }
.qty button { font: inherit; font-weight: 700; background: transparent; border: 0; color: var(--ink); width: 2.6rem; height: 2.6rem; cursor: pointer; }
.qty button:hover { background: var(--bg-sunken); }
.qty input { width: 3rem; text-align: center; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Carrito (drawer) ---------- */
.cart-fab { position: relative; }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 1.15rem; height: 1.15rem; padding-inline: .25rem; border-radius: var(--r-full); background: var(--brand); color: var(--brand-ink); font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
.cart-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(8, 8, 13, .5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(26rem, 92vw); background: var(--bg-raised); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); transform: translateX(102%); transition: transform .24s ease; display: flex; flex-direction: column; }
.cart-drawer.open { transform: none; }
.cart-drawer header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.cart-drawer header h2 { margin: 0; font-size: 1.1rem; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.3rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-item { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .8rem; align-items: center; }
.cart-item .ci-thumb { width: 3.4rem; height: 3.4rem; border-radius: var(--r-sm); background: var(--bg-sunken); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--ink-3); }
.cart-item .ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .ci-name { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.cart-item .ci-meta { font-size: .78rem; color: var(--ink-3); }
.cart-item .ci-remove { font-size: .78rem; color: var(--danger); background: none; border: 0; cursor: pointer; padding: .2rem 0; text-align: left; }
.cart-foot { border-top: 1px solid var(--line); padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; }
.cart-empty { text-align: center; color: var(--ink-3); padding: 3rem 1rem; }

/* ---------- Aviso cookies ---------- */
.cookie-banner { position: fixed; z-index: 170; left: 1rem; right: 1rem; bottom: 1rem; max-width: 30rem; margin-inline: auto; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 1.2rem 1.3rem; display: none; }
.cookie-banner.show { display: block; }
.cookie-banner p { font-size: .86rem; color: var(--ink-2); margin: 0 0 .9rem; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Toast ---------- */
.toast-region { position: fixed; z-index: 180; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 600; padding: .7rem 1.2rem; border-radius: var(--r-full); box-shadow: var(--shadow-3); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--line); background: var(--bg-sunken); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding-block: 3rem 2rem; }
@media (max-width: 56rem) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 36rem) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.site-footer a { color: var(--ink-2); font-size: .92rem; }
.site-footer a:hover { color: var(--brand); }
.footer-about p { color: var(--ink-2); font-size: .9rem; max-width: 24rem; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.4rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .84rem; }
.theme-switch { display: inline-flex; align-items: center; gap: .15rem; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-full); padding: .2rem; }
.theme-switch button { font: inherit; font-size: .78rem; font-weight: 600; border: 0; background: transparent; color: var(--ink-3); padding: .35rem .8rem; border-radius: var(--r-full); cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

/* ---------- Página 404 ---------- */
.error-hero { min-height: 55vh; display: grid; place-items: center; text-align: center; padding-block: 4rem; background-image: var(--hero-glow); }
.error-hero .code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; letter-spacing: -.04em; color: var(--brand); line-height: 1; }

/* ---------- Impresión ---------- */
@media print {
  .site-header, .site-footer, .cookie-banner, .cart-drawer, .cart-overlay, .toast-region, .hero-cta, .searchbar { display: none !important; }
  body { background: #fff; color: #000; }
  .prose p, .prose li { color: #000; }
}

/* ======================= Modal genérico del hub ======================= */
/* Presupuestos y avisos (lo crean store.js/designer.js; claro/oscuro) */
.hub-modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(8,8,14,.55); display: flex; align-items: center; justify-content: center; padding: 1rem; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.hub-modal { background: var(--bg-raised); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 1.1rem 1.2rem; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.hub-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.hub-modal-head h3 { margin: 0; font-size: 1.15rem; }
.hub-modal-foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.hub-modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.hub-modal label { font-size: .85rem; color: var(--ink-2); display: block; }
.hub-modal input, .hub-modal textarea, .hub-modal select { width: 100%; margin-top: .25rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-sunken); color: var(--ink); font: inherit; }
.hub-modal .quote-error { color: var(--danger); }
@media (max-width: 560px) { .hub-modal .form-grid { grid-template-columns: 1fr; } }

/* ======================= Editor de diseño (F2) ======================= */
.designer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .designer-layout { grid-template-columns: 1fr; } }
.designer-stage { position: relative; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); padding: .8rem; display: flex; align-items: center; justify-content: center; min-height: 360px; }
.designer-stage canvas { max-width: 100%; }
.designer-panel { display: flex; flex-direction: column; gap: .9rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.designer-panel .card { padding: .9rem 1rem; }
.designer-panel h3 { margin: 0 0 .5rem; font-size: .98rem; }
.designer-caras { display: flex; gap: .5rem; flex-wrap: wrap; }
.designer-caras button { border: 1px solid var(--line); background: var(--bg-sunken); color: var(--ink); border-radius: var(--r-sm); padding: .45rem .8rem; cursor: pointer; font: inherit; font-size: .88rem; }
.designer-caras button[aria-current="true"] { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.designer-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.designer-field { font-size: .85rem; color: var(--ink-2); display: block; margin-top: .5rem; }
.designer-field input, .designer-field select { width: 100%; margin-top: .25rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-sunken); color: var(--ink); font: inherit; }
.designer-inline { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.designer-total { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.designer-total .price { font-size: 1.5rem; }
.designer-desglose { margin: .5rem 0 0; padding: 0; list-style: none; font-size: .84rem; color: var(--ink-2); }
.designer-desglose li { display: flex; justify-content: space-between; gap: .8rem; padding: .18rem 0; border-bottom: 1px dashed var(--line); }
.designer-hint { font-size: .8rem; color: var(--ink-2); margin: .4rem 0 0; }

/* =================== Páginas especiales de tienda =================== */
.sp-hero { padding: 2.2rem 0 1.2rem; }
.sp-hero h1 { font-size: 1.7rem; margin: 0 0 .4rem; }
.sp-hero .muted { max-width: 640px; }
.sp-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0 0; }
.sp-form { max-width: 680px; }
.sp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.sp-campo { font-size: .88rem; color: var(--ink-2); display: block; }
.sp-campo input, .sp-campo select, .sp-campo textarea {
  width: 100%; margin-top: .3rem; padding: .6rem .75rem; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--bg-raised); color: var(--ink); font: inherit;
}
.sp-campo-full { grid-column: 1 / -1; }
.sp-fotos-previa { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.sp-fotos-previa img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
@media (max-width: 600px) { .sp-form-grid { grid-template-columns: 1fr; } }
.tienda-paginas { display: flex; gap: .6rem; flex-wrap: wrap; margin: .9rem 0 0; }
.tienda-paginas a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem;
  border: 1px solid var(--brand); color: var(--brand); border-radius: var(--r-full);
  font-weight: 600; font-size: .92rem;
}
.tienda-paginas a:hover { background: var(--brand); color: #fff; text-decoration: none; }
