/* ════════════════════════════════════════════════════════
   De La Roca Ascensores — Estilos compartidos
   Animaciones, componentes y patrones del design system.
   ════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

/* ════════════════════════════════════════
   ACCESIBILIDAD
════════════════════════════════════════ */
/* Enlace "saltar al contenido" (visible solo con Tab) */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; }
.skip-link:focus {
  left: 12px; top: 12px;
  background: #011a39; color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-weight: 700; font-size: 14px;
}

/* Foco visible al navegar con teclado */
:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

/* ── Iconos ── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* ════════════════════════════════════════
   HEADER ESMERILADO (frosted glass)
════════════════════════════════════════ */
.frosted-header {
  background: linear-gradient(180deg, rgba(1, 26, 57, 0.55), rgba(1, 26, 57, 0.40));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* Link de navegación con subrayado animado */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: #7dd3fc;
  transition: width 0.25s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ════════════════════════════════════════
   HERO — overlay vignette radial cinematográfico
════════════════════════════════════════ */
.hero-overlay {
  background:
    radial-gradient(ellipse 95% 75% at 50% 38%,
      rgba(1, 26, 57, 0.28) 0%,
      rgba(1, 26, 57, 0.55) 55%,
      rgba(1, 26, 57, 0.88) 100%),
    linear-gradient(to bottom,
      transparent 0%, transparent 65%,
      rgba(1, 26, 57, 0.55) 100%);
}

/* Velo más claro para el hero de Inicio: foto más vívida; el texto se sostiene con su drop-shadow */
.hero-overlay--bright {
  background:
    radial-gradient(ellipse 110% 85% at 50% 42%,
      rgba(1, 26, 57, 0.10) 0%,
      rgba(1, 26, 57, 0.34) 58%,
      rgba(1, 26, 57, 0.72) 100%),
    linear-gradient(to bottom,
      transparent 0%, transparent 52%,
      rgba(1, 26, 57, 0.52) 100%);
}

/* ════════════════════════════════════════
   BANNER URGENCIAS — foto + gradiente azul
════════════════════════════════════════ */
.urgencias-banner {
  position: relative;
  background-image: url('../img/urgencias.webp');
  background-size: cover;
  background-position: center right;
  overflow: hidden;
  isolation: isolate;
}
.urgencias-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    #011a39 0%, #011a39 35%,
    rgba(1, 26, 57, 0.93) 50%,
    rgba(1, 26, 57, 0.55) 80%,
    rgba(1, 26, 57, 0.30) 100%);
  z-index: 0;
}
.urgencias-banner > * { position: relative; z-index: 1; }

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card-hover {
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), border-color 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px -12px rgba(1, 26, 57, 0.30);
}

/* Icono que flota cuando se hace hover en su card */
.icon-hover { transition: transform 0.4s cubic-bezier(.2,.8,.2,1), color 0.3s ease; }
.card-hover:hover .icon-hover { transform: translateY(-3px) scale(1.08); }

/* Botón con brillo deslizante */
.btn-shimmer { position: relative; overflow: hidden; }
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

/* Botón emergencia: glow rojo pulsante */
.pulse-emergency { animation: glow-red 1.8s ease-in-out infinite; }

/* Botón flotante WhatsApp: glow verde pulsante */
.pulse-whatsapp { animation: glow-green 2.2s ease-in-out infinite; }

/* ════════════════════════════════════════
   MARQUEE DE LOGOS — desplazamiento continuo
   2 grupos idénticos al 50%; cada grupo llena el ancho
   con space-around, por eso nunca quedan huecos.
════════════════════════════════════════ */
.logos-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}
.logos-marquee__track {
  display: flex;
  width: max-content;
  animation: logos-scroll 30s linear infinite;
}
.logos-marquee:hover .logos-marquee__track { animation-play-state: paused; }
.logos-marquee__group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
}
.logos-marquee__group img {
  flex-shrink: 0;
  filter: grayscale(1);
  opacity: 0.65;
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.logos-marquee__group img:hover { filter: grayscale(0); opacity: 1; }
@keyframes logos-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ════════════════════════════════════════
   SCROLL REVEAL — las secciones entran al scrollear
   (requiere assets/site.js; sin JS todo queda visible)
════════════════════════════════════════ */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ════════════════════════════════════════
   ANIMACIONES
════════════════════════════════════════ */
@keyframes fadeInUp   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn    { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse      { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.15); } }
@keyframes shimmer    { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes glow-red   { 0%,100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.65); } 50% { box-shadow: 0 0 24px 6px rgba(230,57,70,0.55); } }
@keyframes glow-green { 0%,100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.55); } 50% { box-shadow: 0 0 22px 6px rgba(37,211,102,0.45); } }
@keyframes bell-ring  { 0%,50%,100% { transform: rotate(0); } 10%,30% { transform: rotate(-18deg); } 20%,40% { transform: rotate(18deg); } }
@keyframes hero-reveal{ 0% { opacity: 0; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes hero-enter { 0% { opacity: 0; transform: translateY(60px) scale(0.94); filter: blur(8px); } 60% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }
@keyframes bounce-down { 0%,20%,50%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-9px); } 60% { transform: translateY(-4px); } }

.anim-fade-in-down { animation: fadeInDown 0.6s ease-out both; }
.anim-fade-in-up   { animation: fadeInUp 0.7s ease-out both; }
.anim-fade-in      { animation: fadeIn 0.8s ease-out both; }
.anim-scale-in     { animation: scaleIn 0.6s ease-out both; }
.anim-pulse-dot    { animation: pulse 2s ease-in-out infinite; }
.anim-bell         { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.anim-hero-reveal  { animation: hero-reveal 1.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-hero-enter   { animation: hero-enter 1.2s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-bounce-down  { animation: bounce-down 2.2s ease-in-out infinite; }

.anim-delay-1 { animation-delay: 0.10s; }
.anim-delay-2 { animation-delay: 0.25s; }
.anim-delay-3 { animation-delay: 0.40s; }
.anim-delay-4 { animation-delay: 0.55s; }
.anim-delay-5 { animation-delay: 0.70s; }
.anim-delay-6 { animation-delay: 0.85s; }
.anim-delay-7 { animation-delay: 1.00s; }
.anim-delay-8 { animation-delay: 1.15s; }

/* Respeta usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  html.js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}
