/* ==========================================================================
   FUMIGACIONES RT / GRUPO CODIPSE - ESTILOS PERSONALIZADOS & RESPONSIVE
   Diseño no genérico, paleta de identidad corporativa y adaptabilidad móvil
   ========================================================================== */

:root {
  --color-rt-primary: #1e3a8a;       /* Azul primario RT */
  --color-rt-accent: #2563eb;        /* Azul brillante */
  --color-rt-light: #eff6ff;         /* Azul tenue fondo */
  --color-codipse-green: #15803d;    /* Verde institucional Codipse */
  --color-codipse-light: #f0fdf4;    /* Verde fondo suave */
  --color-alert-red: #dc2626;        /* Rojo de urgencia plagas activas */
  --color-dark-slate: #0f172a;       /* Slate oscuro textos principales */
  --color-light-bg: #f8fafc;         /* Slate ultraclaro */
}

/* Tipografía base fluida con Plus Jakarta Sans */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--color-dark-slate);
  background-color: var(--color-light-bg);
}

h1, h2, h3, .font-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.025em;
}

/* Efecto de cristal esmerilado suave (Glassmorphism) */
.glass-nav {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card-dark {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Badge de Urgencia Pulso */
@keyframes pulse-red-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.urgencia-pulse {
  animation: pulse-red-ring 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* Badge de WhatsApp Botón Flotante Pulso */
@keyframes pulse-wa-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

.whatsapp-pulse {
  animation: pulse-wa-ring 2.2s infinite ease-out;
}

/* Hover de tarjetas de servicios con elevación elegante */
.card-hover-lift {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Gradientes de marca propios */
.gradient-rt-brand {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
}

.gradient-hero-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.45) 50%, rgba(15, 23, 42, 0.84) 100%);
}

@media (max-width: 768px) {
  .gradient-hero-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.52) 50%, rgba(15, 23, 42, 0.86) 100%);
  }
}

/* ==========================================================================
   HERO CAROUSEL SUAVE (CROSSFADE CINEMATOGRÁFICO CON VIDEO)
   ========================================================================== */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 8s ease-out;
  transform: scale(1);
  pointer-events: none;
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1.03);
  pointer-events: auto;
}
/* En móviles (< 768px), desactivar scale(1.03) continuo para evitar blur de GPU y mantener nitidez cristalina */
@media (max-width: 767px) {
  .hero-slide, .hero-slide.active {
    transform: none !important;
  }
}
/* Evitar repaints de transformación en videos para fluidez a 60fps */
.hero-slide-video {
  transform: none !important;
}
.hero-slide-video.active {
  transform: none !important;
}
.hero-slide picture,
.hero-slide img,
.hero-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-dot {
  position: relative;
  width: 38px;
  height: 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: width 0.35s ease, background 0.3s ease;
}
.hero-dot:hover:not(.active) {
  background: rgba(255, 255, 255, 0.45);
}
.hero-dot.active {
  width: 60px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
}
.hero-dot .hero-dot-progress {
  display: block;
  height: 100%;
  width: 0%;
  background: #34d399; /* emerald-400 */
  border-radius: 9999px;
}
.hero-dot.active .hero-dot-progress {
  animation: heroDotFill 6s linear forwards;
}

@keyframes heroDotFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Botón con brillo sutil interactivo */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 30%
  );
  transform: rotate(30deg);
  animation: shimmer-effect 4s infinite linear;
}

@keyframes shimmer-effect {
  0% { transform: translate(-100%, -100%) rotate(30deg); }
  100% { transform: translate(100%, 100%) rotate(30deg); }
}

/* Custom scrollbar limpia */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   ENLACES NAVBAR CON ANIMACIÓN ACTIVA (INDICADOR DE LÍNEA SUBRAYADA SUAVE)
   ========================================================================== */
.nav-desktop-link {
  position: relative;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  color: #334155;
  font-weight: 600;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-desktop-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 3px;
  background: #1e3a8a;
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
}

.nav-desktop-link:hover {
  color: #1e3a8a;
}

.nav-desktop-link:hover::after {
  width: 100%;
}

.nav-desktop-link.active {
  color: #1e3a8a !important;
  font-weight: 700 !important;
}

.nav-desktop-link.active::after {
  width: 100% !important;
  background: #1e3a8a !important;
}

/* ==========================================================================
   MASCOTA INSPECTOR CODIPSE (PEEK-A-BOO FLOTANTE ULTRA-CLEAN)
   ========================================================================== */
.mascot-peek-character {
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.65);
  transform-origin: bottom center;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
}

#mascotSpeechBubble {
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
  transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* SOLO en PC / Desktop con ratón real (evita el molesto hover pegajoso al tocar en celulares) */
@media (hover: hover) and (pointer: fine) {
  .group\/mascot:hover .mascot-peek-character {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(-56px) scale(1.15) !important;
  }

  .group\/mascot:hover #mascotSpeechBubble {
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }
}

/* Activación temporal controlada en Móvil mediante JS (solo una vez: 2s delay, 5s duración) */
.mascot-peek-character.mobile-peek-show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(-44px) scale(1.08) !important;
}

#mascotSpeechBubble.mobile-peek-show {
  opacity: 1 !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

/* Animación alegre de bienvenida de la mascota al abrir el modal */
@keyframes mascotModalWave {
  0% {
    transform: scale(0.85) rotate(-5deg);
    opacity: 0.8;
  }
  60% {
    transform: scale(1.06) rotate(3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.mascot-modal-img {
  animation: mascotModalWave 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ==========================================================================
   DRAWER MÓVIL ULTRA-PREMIUM (APERTURA Y CIERRE SEDOSO BIDIRECCIONAL)
   ========================================================================== */
.hamburger-btn {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ham-bar {
  display: block;
  width: 17px;
  height: 2px;
  background-color: #ffffff;
  border-radius: 9999px;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.20s ease;
  transform-origin: center;
}

.hamburger-btn.is-active .ham-bar-top {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-btn.is-active .ham-bar-mid {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.is-active .ham-bar-bot {
  transform: translateY(-6px) rotate(-45deg);
}

#mobileMenu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 50;
  background-color: #ffffff !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.22) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top-color: transparent !important;
  transform: translateY(-8px);
  pointer-events: none;
  visibility: hidden;
  transition: max-height 0.34s cubic-bezier(0.32, 1, 0.23, 1),
              opacity 0.24s ease,
              padding 0.30s cubic-bezier(0.32, 1, 0.23, 1),
              border-color 0.20s ease,
              transform 0.30s cubic-bezier(0.32, 1, 0.23, 1),
              visibility 0s linear 0.34s;
  will-change: max-height, opacity, transform;
}

#mobileMenu.menu-open {
  opacity: 1;
  padding-top: 0.85rem !important;
  padding-bottom: 1.5rem !important;
  border-top-color: rgba(226, 232, 240, 0.8) !important;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.26s ease,
              padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 0s;
}

/* Items individuales: transición fluida */
.menu-stagger-item {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

#mobileMenu.menu-open .menu-stagger-item {
  opacity: 1;
  transform: translateY(0);
}

/* Cascada armónica escalonada en APERTURA (orden exacto visual) */
#mobileMenu.menu-open > div:first-child.menu-stagger-item { transition-delay: 0.04s; }
#mobileMenu.menu-open nav > a:nth-child(1) { transition-delay: 0.08s; }
#mobileMenu.menu-open nav > a:nth-child(2) { transition-delay: 0.12s; }
#mobileMenu.menu-open nav > a:nth-child(3) { transition-delay: 0.16s; }
#mobileMenu.menu-open nav > a:nth-child(4) { transition-delay: 0.20s; }
#mobileMenu.menu-open nav > a:nth-child(5) { transition-delay: 0.24s; }
#mobileMenu.menu-open > div:last-child.menu-stagger-item { transition-delay: 0.28s; }

/* ==========================================================================
   ESTILIZACIÓN DARK MODE NATIVO PARA SELECTS DEL COTIZADOR (DESKTOP & MÓVIL)
   ========================================================================== */
#cotizador select {
  color-scheme: dark;
  background-color: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.15rem;
  padding-right: 2.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#cotizador select:hover {
  background-color: rgba(30, 41, 59, 0.98);
  border-color: rgba(96, 165, 250, 0.5);
}

#cotizador select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

#cotizador select option {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 12px 16px;
  font-size: 0.925rem;
}

#cotizador select option:hover,
#cotizador select option:focus,
#cotizador select option:checked {
  background-color: #1e3a8a !important;
  color: #ffffff !important;
}

/* Corrección de encuadre cinematográfico en móvil para Video Promocional 2 (elimina franjas negras) */
@media (max-width: 639px) {
  .hero-slide-video-2 video {
    transform: scale(1.18) !important;
    transform-origin: center center;
  }
}


