/* ==========================================================================
   GEEKU · LANDINGS "REDISEÑO DE SITIO WEB" y "MEJORAMOS TU SITIO WEB"
   --------------------------------------------------------------------------
   Se cargan después de styles.css y tipos.css (usan sus variables).

   1. COMPARADOR ANTES / DESPUÉS (deslizable)
   2. PESTAÑAS COMPUTADORA / CELULAR
   3. CHIPS DE TIPOS DE SITIO
   4. LOS 4 PILARES (mejorar sitio)
   5. MEDIDORES DE VELOCIDAD
   6. ¿MEJORAR O REDISEÑAR?
   7. RESPONSIVE
   ========================================================================== */


/* ---------- 1. COMPARADOR ANTES / DESPUÉS ----------
   Dos imágenes una encima de otra. La de "después" se recorta según
   la variable --pos, que mueve assets/js/comparador.js. */
.ba {
  --pos: 50%;
  position: relative; overflow: hidden; border-radius: 18px;
  box-shadow: var(--shadow); background: var(--bg-soft);
  user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.ba img { display: block; width: 100%; height: auto; pointer-events: none; }
.ba__after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.ba__after img { width: 100%; height: 100%; object-fit: cover; }
/* Línea y manija */
.ba__line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 0 1px rgba(11,27,43,.15); pointer-events: none;
}
.ba__handle {
  position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(11,27,43,.35); color: var(--ink);
}
.ba__handle svg { width: 26px; height: 26px; }
/* Etiquetas ANTES / DESPUÉS */
.ba__tag {
  position: absolute; top: 14px; padding: 6px 12px; border-radius: 999px;
  font: 700 .75rem var(--font-title); letter-spacing: .1em; text-transform: uppercase; pointer-events: none;
}
.ba__tag--before { left: 14px; background: rgba(11,27,43,.8); color: #fff; }
.ba__tag--after  { right: 14px; background: var(--cyan); color: var(--ink); }
/* El range invisible que se arrastra (accesible con teclado) */
.ba__range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.ba:has(.ba__range:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 4px; }
.ba-note { margin: 14px 0 0; text-align: center; font-size: .88rem; color: var(--muted); }

/* Animación de "invitación": la manija se mueve sola una vez */
.ba.is-hint { animation: ba-hint 1.6s var(--ease) .4s 1; }
@keyframes ba-hint { 0%,100% { --pos: 50%; } 35% { --pos: 30%; } 70% { --pos: 68%; } }
@property --pos { syntax: "<percentage>"; inherits: true; initial-value: 50%; }


/* ---------- 2. PESTAÑAS COMPUTADORA / CELULAR ---------- */
.ba-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 22px; }
.ba-tabs button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: 500 .95rem var(--font-title);
}
.ba-tabs button svg { width: 18px; height: 18px; }
.ba-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ba-panel[hidden] { display: none; }
.ba-panel--pc  { max-width: 1000px; margin: 0 auto; }
.ba-panel--cel { max-width: 340px; margin: 0 auto; }
.ba-panel--cel .ba { border-radius: 30px; border: 10px solid var(--ink); }


/* ---------- 3. CHIPS DE TIPOS DE SITIO ---------- */
.site-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 900px; margin: 0 auto; }
.site-types li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  font: 500 .95rem var(--font-title); color: var(--ink);
}
.site-types svg { width: 18px; height: 18px; color: var(--cyan-600); }


/* ---------- 4. LOS 4 PILARES ---------- */
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.pillar {
  position: relative; padding: 30px; border-radius: 22px; background: #fff; border: 1px solid var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pillar__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pillar__head .card__icon { margin: 0; }
.pillar__head h3 { margin: 0; }
.pillar > p { color: var(--muted); }
.pillar .checks { margin: 16px 0 0; }
.pillar .checks li { font-size: .97rem; }


/* ---------- 5. MEDIDORES DE VELOCIDAD ---------- */
.gauges { display: flex; justify-content: center; align-items: center; gap: clamp(20px, 5vw, 56px); flex-wrap: wrap; }
.gauge { text-align: center; }
.gauge__ring {
  --v: 50; --c: var(--cyan);
  width: 150px; height: 150px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), #e6eef3 0);
  transition: --v 1.4s var(--ease);
}
.gauge__ring::before { content: ""; grid-area: 1 / 1; width: 118px; height: 118px; border-radius: 50%; background: #fff; }
.gauge__ring span { grid-area: 1 / 1; position: relative; font: 700 2.4rem var(--font-title); color: var(--ink); }
.gauge--bad .gauge__ring { --c: #e5484d; }
.gauge--good .gauge__ring { --c: #1fbf6a; }
.gauge strong { display: block; font-family: var(--font-title); color: var(--ink); }
.gauge small { color: var(--muted); }
.gauges__arrow { width: 42px; height: 42px; color: var(--cyan-600); }
@property --v { syntax: "<number>"; inherits: true; initial-value: 0; }
/* Arrancan en 0 y suben cuando aparecen en pantalla */
.gauge[data-reveal] .gauge__ring { --v: 0; }
.gauge[data-reveal].is-visible .gauge__ring { --v: var(--to); }


/* ---------- 6. ¿MEJORAR O REDISEÑAR? ---------- */
.choose { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 980px; margin: 0 auto; }
.choose__col { padding: 30px; border-radius: 22px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; }
.choose__col--dark { background: var(--ink); border-color: var(--ink); color: #c9d6e2; }
.choose__col--dark h3, .choose__col--dark strong { color: #fff; }
.choose__col .checks { flex: 1; margin: 16px 0 22px; }
.choose__col .btn { align-self: flex-start; }


/* ---------- 7. RESPONSIVE ---------- */
@media (max-width: 900px) {
  .pillars, .choose { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ba__handle { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .pillar, .choose__col { padding: 24px 20px; }
  .gauge__ring { width: 120px; height: 120px; }
  .gauge__ring::before { width: 94px; height: 94px; }
  .gauge__ring span { font-size: 2rem; }
  .gauges__arrow { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ba.is-hint { animation: none; }
  .gauge[data-reveal] .gauge__ring { --v: var(--to); }
}
