/* ==========================================================================
   cristal.css — el rediseño del socio (#0018, Respuestas/12.txt y
   Respuestas/nuevo diseño/seccion 1..8)

   Lo que pidió, con sus palabras: Glassmorphism (cristal con backdrop-filter),
   Bento Grid (bloques de bordes redondeados), High-Key (fondo muy luminoso,
   sombras suaves) y Modern Gradient UI (degradados cian-magenta en lo que se
   toca). Esta hoja va DESPUÉS de styles.css y es una piel, como la
   `tienda-cristal.css` de Streaming: si se quita el <link>, la tienda vuelve a
   la maqueta anterior sin romper nada.

   Dos capas, a propósito (ATLAS 2.6 · anti-patrón «la herencia sorpresa»):
     1. ESTRUCTURA sin tema (rejillas, tamaños, posiciones de las fotos 3D):
        vale para los tres temas porque el marcado es el mismo.
     2. COLOR solo en `:root[data-theme="claro"]`: editorial y oscuro no
        heredan un solo hex nuevo.

   Regla de color (ATLAS 2.6 · R1, R3 y R6): el cian #22d3ee y el magenta
   #d946ef de las capturas NO llevan texto encima — sobre blanco dan 1,81:1 y
   3,46:1. Se usan solo como LUZ decorativa (bordes de neón, resplandores,
   anillo del inicio), declarada como decoración. Donde hay letra, el
   degradado es su versión profunda, medida con scripts/contraste.py:
     «Añadir al carrito»  #0e7490 → #1d4ed8   blanco 5,36:1 y 6,70:1
     «Ver más»            #a21caf → #7e22ce   blanco 6,32:1 y 6,98:1
     botones vivos        #0e7490 → #7e22ce → #a21caf (las tres paradas ≥ 5,36:1)
   Un degradado recto nunca es más claro que la más clara de sus paradas
   (la curva de luminancia es convexa): medir las paradas basta.
   Tabla completa: docs/PSICOLOGIA_DEL_COLOR.md § #0018.
   ========================================================================== */

/* ---------- 1. Tokens del tema claro ---------- */
:root[data-theme="claro"] {
  --neon-a: #22d3ee;        /* luz cian — DECORATIVA, nunca con texto encima */
  --neon-b: #8b5cf6;        /* violeta de paso */
  --neon-c: #d946ef;        /* luz magenta — DECORATIVA */
  --neon: linear-gradient(135deg, var(--neon-a), var(--neon-b) 55%, var(--neon-c));
  --neon-glow: 0 0 22px rgba(34, 211, 238, .30), 0 0 34px rgba(217, 70, 239, .22);

  --cristal: rgba(255, 255, 255, .86);          /* respaldo SIN desenfoque */
  --cristal-line: rgba(255, 255, 255, .95);
  --cristal-shadow: 0 18px 40px -18px rgba(11, 37, 69, .28), 0 4px 10px -4px rgba(11, 37, 69, .08);

  --grad-buy: linear-gradient(135deg, #0e7490 0%, #1d4ed8 100%);
  --grad-buy-hover: linear-gradient(135deg, #0b6178 0%, #1e40af 100%);  /* 7,01 y 8,72 */
  --grad-more: linear-gradient(135deg, #a21caf 0%, #7e22ce 100%);
  --grad-more-hover: linear-gradient(135deg, #86198f 0%, #6b21a8 100%); /* 8,24 y 8,72 */
  --grad-vivo: linear-gradient(90deg, #0e7490 0%, #7e22ce 55%, #a21caf 100%);

  /* High-key: el ambiente pasa a cian, azul del logotipo, violeta y magenta bajo el
     mismo velo blanco al 82 % que midió #0016. Peor caso calculado apilando las
     cuatro manchas a su alfa máximo y aplicando el velo: #eee4fa, más claro que el
     --ambient-min #dee1f0 que ya audita contraste.py, así que todas sus filas siguen
     siendo ciertas sin tocar una sola. */
  --ambient:
    linear-gradient(rgba(255, 255, 255, .82), rgba(255, 255, 255, .82)),
    radial-gradient(80vw 70vh at 0% -10%, rgba(34, 211, 238, .55), rgba(34, 211, 238, 0) 66%),
    radial-gradient(70vw 64vh at 100% 12%, rgba(22, 69, 127, .38), rgba(22, 69, 127, 0) 66%),
    radial-gradient(76vw 70vh at 0% 85%, rgba(139, 92, 246, .40), rgba(139, 92, 246, 0) 66%),
    radial-gradient(70vw 66vh at 100% 100%, rgba(217, 70, 239, .46), rgba(217, 70, 239, 0) 66%);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme="claro"] { --cristal: rgba(255, 255, 255, .58); }
}

/* ---------- 2. Piezas comunes: cristal, neón, bento ---------- */
.cr-glass {
  background: var(--cristal, var(--bg));
  border: 1px solid var(--cristal-line, var(--line));
  border-radius: 22px;
  box-shadow: var(--cristal-shadow, var(--shadow-sm)), var(--glass-shine, none);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

/* Borde de neón: un degradado pintado en el borde con máscara, sin tapar el cristal.
   Decorativo (la tarjeta no es un control): no tiene mínimo WCAG y se declara así. */
.cr-neon { position: relative; isolation: isolate; }
:root[data-theme="claro"] .cr-neon { border-color: transparent; box-shadow: var(--cristal-shadow), var(--neon-glow); }
:root[data-theme="claro"] .cr-neon::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  padding: 2px;
  border-radius: inherit;
  background: var(--neon);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  pointer-events: none;
}

.cr-bento { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.cr-bento-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cr-bento-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cr-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--cristal-line, var(--line));
  box-shadow: 0 6px 14px -8px rgba(11, 37, 69, .35), inset 0 1px 0 #fff;
  color: var(--ink);
}
.cr-icon svg { width: 28px; height: 28px; }

.cr-section { position: relative; padding: clamp(40px, 5vw, 64px) 0; }
.cr-heading { text-align: center; max-width: 860px; margin: 0 auto 36px; }
.cr-heading h2,
.cr-hero h1 { letter-spacing: -.025em; line-height: 1.06; overflow-wrap: anywhere; }
.cr-heading h2 { font-size: clamp(30px, 5vw, 58px); margin-bottom: 12px; }
.cr-sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); }
.cr-sub a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.cr-subtitle { text-align: center; font-size: clamp(20px, 2.4vw, 28px); margin: 56px 0 24px; }

.cr-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}
.cr-actions .button { min-width: min(100%, 250px); min-height: 52px; font-size: 16px; }

/* ---------- 3. Cabecera flotante de cristal (capturas 1 y 8) ---------- */
:root[data-theme="claro"] .site-header {
  inset: 10px 12px auto 12px;
  border: 1px solid var(--cristal-line);
  border-radius: 18px;
  background: var(--cristal);
  box-shadow: var(--cristal-shadow);
}

/* ---------- 4. Inicio (sección 1) ---------- */
.cr-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 56px) 20px 64px;
  text-align: center;
}
.cr-hero-card {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 48px);
}
.cr-hero h1 { font-size: clamp(34px, 6.2vw, 82px); margin-bottom: 18px; }
.cr-hero-card .cr-sub { margin-bottom: 0; }
.cr-status {
  display: inline-block;
  margin: 16px 0 0;
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid var(--cristal-line, var(--line));
  background: rgba(255, 255, 255, .8);
  font-size: 15px;
  color: var(--ink);
}

/* El anillo de luz: un aro con degradado cónico cian → violeta → magenta. Decorativo. */
.cr-hero-ring { display: none; }
:root[data-theme="claro"] .cr-hero-ring {
  display: block;
  position: absolute;
  z-index: 0;
  left: 50%;
  top: calc(var(--header-h) + 40px);
  width: min(78vw, 820px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--neon-a) 0deg, var(--neon-a) 70deg, var(--neon-b) 180deg, var(--neon-c) 290deg, var(--neon-c) 360deg);
  -webkit-mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 16px), #000 calc(100% - 15px));
  mask: radial-gradient(farthest-side, rgba(0, 0, 0, 0) calc(100% - 16px), #000 calc(100% - 15px));
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, .55)) drop-shadow(0 0 26px rgba(217, 70, 239, .35));
  opacity: .9;
}

.cr-hero-stage {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: -40px auto 0;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: end;
  gap: 8px;
}
.cr-obj { width: 100%; height: auto; filter: drop-shadow(0 26px 30px rgba(11, 37, 69, .22)); }
.cr-obj-laptop { transform: translateY(4%); }
.cr-obj-audio { transform: translateY(2%) scale(.86); transform-origin: bottom center; }
.cr-hero .cr-actions { position: relative; z-index: 2; margin-top: 24px; }

/* ---------- 5. Entrega (sección 2) ---------- */
.cr-van {
  display: block;
  width: min(100%, 860px);
  height: auto;
  margin: 0 auto 36px;
  filter: drop-shadow(0 30px 28px rgba(11, 37, 69, .20));
}
.cr-tile { display: flex; align-items: center; gap: 18px; padding: 22px; }
.cr-tile strong { display: block; font-size: 19px; margin-bottom: 4px; }
.cr-tile span { color: var(--ink-2); font-size: 15px; }
.cr-tile > div { min-width: 0; }

/* ---------- 6. Cómo comprar (sección 3) ---------- */
.cr-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 28px;
  text-align: center;
}
.cr-steps img {
  width: min(100%, 230px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 10px;
  filter: drop-shadow(0 22px 22px rgba(11, 37, 69, .18));
}
.cr-steps h3 { font-size: 26px; margin-bottom: 10px; }
.cr-steps p { color: var(--ink-2); max-width: 36ch; margin: 0 auto; }

.ways.cr-bento > li { padding: 24px; }
.ways.cr-bento h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 22px; margin-bottom: 10px; }
.ways.cr-bento p { color: var(--ink); }
.ways.cr-bento .ways-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--cristal-line, var(--line));
}

/* ---------- 7. Catálogo: la tarjeta «like» (sección 4) ---------- */
:root[data-theme="claro"] .product-card {
  position: relative;
  isolation: isolate;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--cristal);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--cristal-shadow), var(--neon-glow);
  transition: transform .2s ease, box-shadow .2s ease;
}
:root[data-theme="claro"] .product-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  padding: 2px;
  border-radius: inherit;
  background: var(--neon);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  pointer-events: none;
}
:root[data-theme="claro"] .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cristal-shadow), 0 0 30px rgba(34, 211, 238, .42), 0 0 44px rgba(217, 70, 239, .30);
}
:root[data-theme="claro"] .product-card .product-photo {
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--cristal-line);
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -12px rgba(11, 37, 69, .35);
}
/* Propuesta B: la foto recortada flota sobre blanco con aire alrededor. */
.product-card.foto-blanca .product-photo { background: #fff; }
.product-card.foto-blanca .product-photo img:not([src$=".svg"]) { padding: 12%; filter: drop-shadow(0 14px 14px rgba(11, 37, 69, .18)); }

.product-card .product-info h3 { font-size: 19px; line-height: 1.25; }
.product-card .product-info p { font-size: 14px; }
.product-card .price { font-size: 22px; font-weight: 700; }

.product-card .product-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.product-card .product-actions .add,
.product-card .product-actions .details {
  flex: 1 1 auto;
  grid-column: auto;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  color: #fff;
}
:root[data-theme="claro"] .product-card .product-actions .add:enabled { background: var(--grad-buy); box-shadow: 0 8px 18px -8px rgba(14, 116, 144, .7); }
:root[data-theme="claro"] .product-card .product-actions .add:enabled:hover { background: var(--grad-buy-hover); }
:root[data-theme="claro"] .product-card .product-actions .details { background: var(--grad-more); backdrop-filter: none; box-shadow: 0 8px 18px -8px rgba(162, 28, 175, .7); }
:root[data-theme="claro"] .product-card .product-actions .details:hover { background: var(--grad-more-hover); }
/* Tienda apagada (sin cobros cargados): el botón NO finge estar vivo. Borde de neón
   punteado, letra --ink-2 (5,68:1 sobre --band-2) y el cursor de prohibido. */
:root[data-theme="claro"] .product-card .product-actions .add:disabled { color: var(--ink-2); border: 1px dashed var(--field-line); }

.share-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--cristal-line, var(--line));
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  color: var(--ink);
  cursor: pointer;
}
.share-icon:hover { background: #fff; }

/* ---------- 8. Nosotros: bento 2×2 (sección 5) ---------- */
.about .cr-bento-2 > li { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-top-width: 1px; }
.about .offer .cr-icon { display: grid; margin: 0 0 14px; }
.about .cr-bento-2 strong { font-size: 21px; }
.about .cr-bento-2 span:not(.cr-icon) { color: var(--ink-2); }

/* ---------- 9. Opiniones (sección 6) ---------- */
.cr-stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(4px, 2vw, 22px);
  margin: 0 auto 28px;
}
.cr-stars img { width: clamp(52px, 11vw, 150px); height: auto; filter: drop-shadow(0 0 18px rgba(34, 211, 238, .45)); }
.cr-stars img:nth-child(1), .cr-stars img:nth-child(5) { width: clamp(42px, 8.5vw, 118px); }
.cr-stars img:nth-child(3) { transform: translateY(-18%); }
.cr-reviews { max-width: 1080px; margin: 0 auto; padding: 24px; }
:root[data-theme="claro"] .cr-reviews .review { background: rgba(255, 255, 255, .7); border-radius: 18px; }
:root[data-theme="claro"] .cr-reviews > .review-grid > p { background: rgba(255, 255, 255, .85); border-radius: 14px; }

:root[data-theme="claro"] .button.vivid {
  background: var(--grad-vivo);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 24px -10px rgba(126, 34, 206, .75);
}
:root[data-theme="claro"] .button.vivid:hover { filter: brightness(.9); }
.button.vivid .icon-chip { background: #fff; }

/* ---------- 10. Ayuda (sección 7) ---------- */
.cr-ayuda { overflow: hidden; }
.cr-ayuda .wrap { position: relative; z-index: 1; max-width: 980px; }
.cr-orbs { display: none; }
:root[data-theme="claro"] .cr-orbs { display: block; position: absolute; inset: 0; pointer-events: none; }
:root[data-theme="claro"] .cr-orbs span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, .55), rgba(34, 211, 238, 0) 70%);
}
.cr-orbs span:nth-child(1) { width: 90px; height: 90px; left: 10%; top: 18%; }
.cr-orbs span:nth-child(2) { width: 260px; height: 260px; left: 4%; bottom: 8%; }
.cr-orbs span:nth-child(3) { width: 140px; height: 140px; right: 12%; top: 12%; }
#warranty-card.cr-glass { padding: 24px 28px; margin-bottom: 20px; text-align: center; }
#warranty-card h3 { margin-bottom: 8px; }
.cr-ayuda .faq {
  display: grid;
  gap: 14px;
  width: min(900px, 100%);
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.cr-ayuda .faq details:last-child { border-bottom: 1px solid transparent; }
.cr-ayuda .faq summary { padding: 18px 24px; font-size: 18px; }
.cr-ayuda .faq summary::after { color: var(--ink); font-size: 22px; }
.cr-ayuda .faq details p { padding: 0 24px; font-size: 15px; }
:root[data-theme="claro"] .cr-ayuda .faq details {
  position: relative;
  isolation: isolate;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--cristal);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--cristal-shadow);
}
:root[data-theme="claro"] .cr-ayuda .faq details::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neon-c), var(--neon-b), var(--neon-a));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  pointer-events: none;
}
:root[data-theme="claro"] .button.cr-outline { background: rgba(255, 255, 255, .7); border: 2px solid #7e22ce; color: var(--ink); }
:root[data-theme="claro"] .button.cr-outline:hover { background: #fff; }

/* ---------- 11. Entretenimiento (sección 8) ---------- */
:root[data-theme="claro"] .cr-play {
  background: url("/static/web/assets/nuevo/fondo-etereo.webp") center / cover no-repeat;
}
/* El velo del fondo etéreo: blanco al 72 % arriba, donde va el título, y al 92 % abajo
   para que la franja plateada de la imagen no se lea como gris (Acuerdo #0010). El texto
   se mide contra la zona MÁS OSCURA del fondo ya velado (A5): ver PSICOLOGIA_DEL_COLOR § #0018. */
:root[data-theme="claro"] .cr-play::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .72) 0%, rgba(255, 255, 255, .30) 42%, rgba(255, 255, 255, .30) 70%, rgba(255, 255, 255, .92) 100%);
  pointer-events: none;
}
.cr-play .wrap { position: relative; }
.cr-play-stage {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}
.cr-play-laptop { position: absolute; left: 12%; bottom: 0; width: 76%; height: auto; filter: drop-shadow(0 30px 30px rgba(11, 37, 69, .25)); }
.cr-play-plant { position: absolute; left: 0; bottom: 0; width: 17%; height: auto; }
.cr-play-mouse { position: absolute; right: 0; bottom: 2%; width: 17%; height: auto; }
.cr-float {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink);
  animation: cr-flotar 6s ease-in-out infinite;
}
.cr-float svg { width: 30px; height: 30px; }
.cr-float-1 { left: 4%; top: 18%; }
.cr-float-2 { left: 9%; top: 52%; animation-delay: -2s; }
.cr-float-3 { right: 6%; top: 24%; animation-delay: -4s; }
@keyframes cr-flotar { 50% { transform: translateY(-10px); } }

/* ---------- 12. Teléfono y movimiento reducido ---------- */
@media (max-width: 720px) {
  .cr-hero-stage { grid-template-columns: 1fr 1.3fr 1fr; margin-top: -10px; }
  .cr-bento-2 { grid-template-columns: 1fr; }
  .cr-steps img { width: min(100%, 170px); }
  .cr-van { margin-bottom: 20px; }
  .cr-float { padding: 8px 10px; font-size: 12px; }
  .cr-float svg { width: 20px; height: 20px; }
  :root[data-theme="claro"] .site-header { inset: 6px 6px auto 6px; }
}
@media (max-width: 519px) {
  /* Como Streaming (#0638): en el teléfono el desenfoque cuesta batería y emborrona lo
     de detrás; se quita y el cristal pasa a casi opaco para que la letra siga leyéndose. */
  :root[data-theme="claro"] .cr-glass,
  :root[data-theme="claro"] .product-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, .88); }
  .cr-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cr-float { animation: none; }
  :root[data-theme="claro"] .product-card:hover { transform: none; }
}
