/* Capa final de detalles: micro-interacciones, profundidad y acabado.
   No cambia estructura ni contenido; solo pule lo existente. */

:root {
  --pv-ease: cubic-bezier(.22, .61, .36, 1);
  --pv-shadow-s: 0 2px 6px rgba(20, 20, 20, .05);
  --pv-shadow-m: 0 10px 28px -12px rgba(20, 20, 20, .22);
  --pv-shadow-l: 0 26px 60px -26px rgba(230, 0, 18, .32);
  --pv-glass: rgba(255, 255, 255, .82);
}

::selection { background: rgba(230, 0, 18, .16); color: #141414; }

/* --- Scrollbar discreta --- */
@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: #d8d8d8 transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border: 3px solid #fff;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--pv-red, #e60012); }

/* --- Foco visible y consistente --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--pv-red, #e60012);
  outline-offset: 3px;
  border-radius: 8px;
}

/* --- Encabezado: se afina al hacer scroll --- */
.site-header {
  transition: box-shadow .35s var(--pv-ease), background .35s var(--pv-ease), height .35s var(--pv-ease);
  background: var(--pv-glass);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
body.is-scrolled .site-header {
  box-shadow: 0 10px 30px -18px rgba(20, 20, 20, .45);
}
.site-header .brand img { transition: transform .4s var(--pv-ease); }
.site-header .brand:hover img { transform: translateY(-1px) scale(1.02); }

/* Subrayado animado en la navegación */
.modern-nav > a,
.site-header nav > a { position: relative; transition: color .25s var(--pv-ease); }
.modern-nav > a:not(.active-link)::after,
.site-header nav > a:not(.active-link)::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 12px;
  left: 50%;
  height: 2px;
  border-radius: 999px;
  background: var(--pv-red, #e60012);
  transition: left .28s var(--pv-ease), right .28s var(--pv-ease);
}
.modern-nav > a:hover::after,
.site-header nav > a:hover::after { left: 0; right: 0; }

/* Barra de progreso de lectura */
.pv-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 120;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #e60012, #ff5b64);
  pointer-events: none;
}

/* --- Botones: brillo al pasar el cursor --- */
.button,
.isp-solid-cta,
.header-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .28s var(--pv-ease), box-shadow .28s var(--pv-ease), filter .28s var(--pv-ease);
}
.button::after,
.isp-solid-cta::after,
.header-cta::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  z-index: -1;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg);
  transition: left .55s var(--pv-ease);
}
.button:hover::after,
.isp-solid-cta:hover::after,
.header-cta:hover::after { left: 130%; }
.button:hover,
.isp-solid-cta:hover,
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--pv-shadow-l);
}
.button:active { transform: translateY(0) scale(.99); }
.button span,
.button b { transition: transform .28s var(--pv-ease); }
.button:hover span,
.button:hover b { transform: translateX(3px); }

/* --- Tarjetas: elevación y borde vivo --- */
.service-strip article,
.connection-card-grid article,
.isp-card,
.isp-core,
.isp-speed,
.support-grid a,
.regional .benefits article,
.showcase-grid article,
.plan-card {
  transition: transform .35s var(--pv-ease), box-shadow .35s var(--pv-ease), border-color .35s var(--pv-ease);
}
.service-strip article:hover,
.connection-card-grid article:hover,
.connection-card-grid article:focus-visible,
.isp-card:hover,
.support-grid a:hover,
.regional .benefits article:hover,
.showcase-grid article:hover,
.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pv-shadow-m);
  border-color: rgba(230, 0, 18, .28);
}

/* Acento superior que se despliega en las tarjetas de servicio */
.service-strip article,
.connection-card-grid article { position: relative; overflow: hidden; }
.service-strip article::before,
.connection-card-grid article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #e60012, #ff7a80);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .4s var(--pv-ease);
  z-index: 3;
}
.service-strip article:hover::before,
.connection-card-grid article:hover::before,
.connection-card-grid article:focus-visible::before { transform: scaleX(1); }

/* Imágenes de tarjeta con un ligero acercamiento */
.connection-card-grid .service-media,
.isp-media,
.plan-photo,
.showcase-image { transition: transform .6s var(--pv-ease); }
.connection-card-grid article:hover .service-media,
.isp-card:hover .isp-media,
.plan-card:hover .plan-photo,
.showcase-grid article:hover .showcase-image { transform: scale(1.045); }

/* Enlaces "conocer más" con flecha que avanza */
.service-strip a,
.connection-card-grid a,
.isp-card a,
.tv-guide-link { transition: color .25s var(--pv-ease), gap .25s var(--pv-ease); }
.service-strip a b, .service-strip a span,
.connection-card-grid a b,
.isp-card a b,
.tv-guide-link b { display: inline-block; transition: transform .28s var(--pv-ease); }
.service-strip a:hover b, .service-strip a:hover span,
.connection-card-grid a:hover b,
.isp-card a:hover b,
.tv-guide-link:hover b { transform: translateX(4px); }

/* --- Numeración de sección con línea guía --- */
.section-no {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-no::after {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: .45;
}

/* --- Formularios --- */
form input,
form select,
form textarea {
  transition: border-color .25s var(--pv-ease), box-shadow .25s var(--pv-ease), background .25s var(--pv-ease);
}
form input:hover,
form select:hover,
form textarea:hover { border-color: #c9c9c9; }
form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--pv-red, #e60012);
  box-shadow: 0 0 0 4px rgba(230, 0, 18, .1);
  outline: none;
}
form label { transition: color .25s var(--pv-ease); }
form label:focus-within { color: var(--pv-red, #e60012); }
.check input[type="checkbox"] { accent-color: var(--pv-red, #e60012); }

/* --- Foto regional: encuadre más vivo --- */
.network-photo img { transition: transform .8s var(--pv-ease); }
.network-photo:hover img { transform: scale(1.04); }
.network-photo figcaption { box-shadow: var(--pv-shadow-s); }

/* --- Guía de TV --- */
.tv-guide { transition: transform .45s var(--pv-ease), filter .45s var(--pv-ease); }
.tv-guide:hover { transform: translateY(-5px); filter: drop-shadow(0 26px 44px rgba(230, 0, 18, .22)); }

/* --- Pie de página --- */
.site-footer-clean a,
footer a { transition: color .22s var(--pv-ease), transform .22s var(--pv-ease); }
.site-footer-clean a:hover,
footer a:hover { color: #ff5b64; transform: translateX(2px); }
footer .footer-legal { letter-spacing: .01em; }

/* --- Aparición al hacer scroll --- */
.pv-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--pv-ease), transform .7s var(--pv-ease);
  will-change: opacity, transform;
}
.pv-reveal.is-in { opacity: 1; transform: none; }

/* --- Botón flotante de WhatsApp --- */
.pv-wa {
  position: fixed;
  right: clamp(14px, 2.2vw, 26px);
  bottom: clamp(14px, 2.2vw, 26px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 20px;
  border-radius: 999px;
  background: #1f9d55;
  color: #fff;
  font: 700 .82rem 'Manrope', sans-serif;
  text-decoration: none;
  box-shadow: 0 16px 34px -14px rgba(31, 157, 85, .8);
  transition: transform .3s var(--pv-ease), box-shadow .3s var(--pv-ease);
}
.pv-wa:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -16px rgba(31, 157, 85, .9); }
.pv-wa svg { width: 21px; height: 21px; fill: currentColor; flex: 0 0 auto; }
@media (max-width: 560px) {
  .pv-wa { height: 50px; padding: 0 16px; }
  .pv-wa span { display: none; }
}

/* --- Volver arriba --- */
.pv-top {
  position: fixed;
  right: clamp(14px, 2.2vw, 26px);
  bottom: calc(clamp(14px, 2.2vw, 26px) + 66px);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--pv-line, #e6e6e6);
  border-radius: 50%;
  background: #fff;
  color: #141414;
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  box-shadow: var(--pv-shadow-m);
  transition: opacity .3s var(--pv-ease), transform .3s var(--pv-ease), visibility .3s;
}
body.is-scrolled .pv-top { opacity: 1; visibility: visible; transform: none; }
.pv-top:hover { color: var(--pv-red, #e60012); border-color: rgba(230, 0, 18, .4); }

@media (prefers-reduced-motion: reduce) {
  .pv-reveal { opacity: 1 !important; transform: none !important; }
  * { transition-duration: .01ms !important; }
}
