/* ==========================================================================
   components.css — Piezas reutilizables
   Eyebrow, cabecera de sección, botones, header/nav, menú móvil,
   selector de canales, paneles, listas, tarjetas y footer.
   ========================================================================== */

/* ---------- Eyebrow (etiqueta sobre los títulos) ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-primary);
}
/* Sobre negro: texto blanco con un "LED" rojo delante */
.on-dark .eyebrow { color: var(--color-white); }
.on-dark .eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-primary); box-shadow: 0 0 0 4px rgb(206 10 45 / .3);
}

/* ---------- Cabecera de sección ---------- */
.section-head { display: grid; gap: var(--space-4); max-width: 46rem; margin-bottom: var(--space-8); }
.section-head h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -.02em; }
.lead { color: var(--ink-70); max-width: 65ch; }
.on-dark .lead { color: var(--paper-70); }

/* ---------- Botones ----------
   Variantes: .btn (primario rojo), .btn--outline (sobre blanco), .btn--ghost (sobre negro).
   Los colores van en variables locales para que cada variante solo cambie lo necesario. */
.btn {
  --btn-bg: var(--color-primary);
  --btn-fg: var(--color-white);
  --btn-bd: var(--color-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  min-height: 48px; padding: var(--space-3) var(--space-6);
  border: 2px solid var(--btn-bd); border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font: 700 .9375rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--dur-fast) var(--ease); }
.btn:hover { --btn-bg: var(--color-primary-hover); --btn-bd: var(--color-primary-hover); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.btn:hover svg { transform: translateX(4px); }

.btn--outline { --btn-bg: transparent; --btn-fg: var(--color-black); --btn-bd: var(--color-black); }
.btn--outline:hover { --btn-bg: var(--color-black); --btn-fg: var(--color-white); --btn-bd: var(--color-black); box-shadow: var(--shadow-md); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--color-white); --btn-bd: var(--line-dark); }
.btn--ghost:hover { --btn-bg: var(--color-white); --btn-fg: var(--color-black); --btn-bd: var(--color-white); box-shadow: none; }

/* Botón con texto largo que puede partirse en dos líneas */
.btn--wrap { white-space: normal; text-align: left; }

/* ---------- Header ----------
   Negro sobre la portada; al bajar pasa a blanco translúcido (clase .is-scrolled desde main.js). */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-black); color: var(--color-white);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled {
  background: rgb(255 255 255 / .86); color: var(--color-black);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}
.site-header.is-scrolled :focus-visible { outline-color: var(--color-primary); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: var(--header-h); }

.logo { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; text-decoration: none; }
.logo svg { width: 28px; height: 28px; color: var(--color-primary); }
.logo b { color: var(--color-primary); }

/* Navegación de escritorio: subrayado rojo animado en hover y en la sección activa */
.nav { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.nav a { position: relative; display: block; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); font-weight: 600; font-size: .9375rem; text-decoration: none; }
.nav a::after {
  content: ""; position: absolute; left: var(--space-4); right: var(--space-4); bottom: 4px; height: 2px;
  background: var(--color-primary); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }

.header-cta { display: none; }
.menu-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .nav { display: block; }
  .header-cta { display: inline-flex; min-height: 44px; padding-inline: var(--space-5); }
  .menu-btn { display: none; }
}

/* ---------- Menú móvil a pantalla completa ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; gap: var(--space-7);
  padding: calc(env(safe-area-inset-top, 0px) + var(--space-4)) max(16px, env(safe-area-inset-right, 0px)) var(--space-7) max(16px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
}
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.mobile-menu ul a { font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.mobile-menu ul a:hover { color: var(--color-primary); }

/* ---------- Selector de 3 canales (portada) ----------
   Representa el auricular: un LED y un ecualizador por canal. Solo el canal activo se anima. */
.channels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
  padding: var(--space-3); min-width: 0;
  border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
  background: rgb(255 255 255 / .03);
}
.channel {
  display: grid; justify-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-1);
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--paper-50); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.channel:hover { color: var(--color-white); border-color: var(--line-dark); }
.channel[aria-pressed="true"] { color: var(--color-white); background: rgb(206 10 45 / .14); border-color: rgb(206 10 45 / .6); }
.channel__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.channels__caption { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--paper-50); text-align: center; }

.led { width: 10px; height: 10px; border-radius: 50%; background: var(--paper-50); transition: background var(--dur), box-shadow var(--dur); }
.channel[aria-pressed="true"] .led { background: var(--color-primary); box-shadow: 0 0 0 4px rgb(206 10 45 / .25), 0 0 16px var(--color-primary); }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.bars i { width: 6px; border-radius: 3px; background: currentColor; opacity: .55; transform-origin: bottom; }
.bars i:nth-child(1) { height: 45%; }
.bars i:nth-child(2) { height: 80%; }
.bars i:nth-child(3) { height: 60%; }
.bars i:nth-child(4) { height: 95%; }
.bars i:nth-child(5) { height: 40%; }
.channel[aria-pressed="true"] .bars i { background: var(--color-primary); opacity: 1; animation: eq 1.1s var(--ease) infinite alternate; }
.channel[aria-pressed="true"] .bars i:nth-child(2) { animation-delay: -.3s;  animation-duration: .9s; }
.channel[aria-pressed="true"] .bars i:nth-child(3) { animation-delay: -.6s;  animation-duration: 1.3s; }
.channel[aria-pressed="true"] .bars i:nth-child(4) { animation-delay: -.15s; animation-duration: .8s; }
.channel[aria-pressed="true"] .bars i:nth-child(5) { animation-delay: -.45s; animation-duration: 1.2s; }
@keyframes eq { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

/* ---------- Panel (tarjeta grande de contenido) ---------- */
.panel {
  display: grid; align-content: start; gap: var(--space-4); min-width: 0;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--color-white); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease);
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel h2 { font-size: var(--fs-h2-sm); font-weight: 700; letter-spacing: -.02em; }
.panel p { color: var(--ink-70); font-size: 1rem; }
.panel .panel__intro { color: var(--color-black); font-size: var(--fs-lead); font-weight: 500; line-height: 1.55; }
/* Variante oscura: el fondo se declara aquí para que gane a .panel */
.panel.on-dark { background: var(--color-black); color: var(--color-white); border-color: var(--color-black); box-shadow: var(--shadow-lg); }
.panel.on-dark p { color: var(--paper-70); }

/* ---------- Pasos numerados pequeños ---------- */
.mini-steps { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: var(--space-3); counter-reset: step; }
.mini-steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); align-items: start; font-size: .9375rem; line-height: 1.55; }
.mini-steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary); color: var(--color-white); font-weight: 800; font-size: var(--fs-small);
}

/* ---------- Tarjeta de ventajas con lista de checks ---------- */
.benefit-card {
  display: grid; align-content: start; gap: var(--space-5); min-width: 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--color-white); box-shadow: var(--shadow-md);
}
.benefit-card.on-dark { background: var(--color-black); color: var(--color-white); border-color: var(--color-black); box-shadow: var(--shadow-lg); }
.benefit-card h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -.02em; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.checks li { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-4); align-items: start; }
.checks svg { width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); }
.on-dark .checks svg { background: var(--color-primary); color: var(--color-white); }
.checks b { display: block; font-weight: 700; }
.checks span { color: var(--ink-70); font-size: 1rem; }
.on-dark .checks span { color: var(--paper-70); }

/* ---------- Tarjeta de precio ---------- */
.price {
  display: grid; gap: var(--space-4); padding: var(--space-6);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--color-white); box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.price:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgb(206 10 45 / .4); }
.price__range { font-size: var(--fs-small); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-70); }
.price__value { font-size: var(--fs-price); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.price__unit { font-size: var(--fs-small); font-weight: 500; color: var(--ink-50); }
/* Barra de volumen: cuántos tramos de cantidad cubre la tarifa */
.meter { display: flex; gap: 4px; margin-top: var(--space-2); }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.meter i.on { background: var(--color-primary); }

/* ---------- Elemento de contacto ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.contact-item {
  display: grid; grid-template-columns: 48px 1fr; gap: var(--space-4); align-items: center;
  min-height: 72px; padding: var(--space-4);
  border: 1px solid var(--line-dark); border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
a.contact-item:hover { border-color: var(--color-primary); background: rgb(206 10 45 / .08); }
.contact-item svg { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: var(--color-primary); color: var(--color-white); }
.contact-item small { display: block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-50); }
.contact-item span { font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-dark); font-size: var(--fs-small); color: var(--paper-50); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); padding-block: var(--space-6); }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-5); }
.site-footer a { color: var(--paper-70); text-decoration: none; }
.site-footer a:hover { color: var(--color-white); text-decoration: underline; text-underline-offset: 4px; }
