/* ============================================================
   Higiofi · index.html  ·  rediseño visual + animaciones
   ------------------------------------------------------------
   Se carga DESPUÉS de styles.css para sobrescribir reglas clave.
   Solo afecta a index.html (no se enlaza desde otras páginas).
   100% CSS + JS nativo (sin frameworks, sin CDNs externos).
   ============================================================ */

/* ---- tokens de movimiento, color y elevación ----------------- */
:root {
  --r-deep:        #0b1438;
  --r-grad-cta:    linear-gradient(135deg, #2d4a9e 0%, #1e2a6e 60%, #0b1438 100%);
  --r-grad-hero:   linear-gradient(135deg, #0b1438 0%, #18255f 45%, #2d4a9e 100%);
  --r-grad-soft:   linear-gradient(135deg, #f0f6fc 0%, #ddeeff 100%);
  --r-grad-em:     linear-gradient(120deg, #ddeeff 0%, #5b9fd4 60%, #5b9fd4 100%);

  --r-sh-1: 0 4px 14px rgba(20, 32, 90, 0.06);
  --r-sh-2: 0 10px 28px rgba(20, 32, 90, 0.10);
  --r-sh-3: 0 22px 48px rgba(20, 32, 90, 0.16);
  --r-sh-cta: 0 14px 32px rgba(30, 42, 110, 0.32);

  --r-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --r-dur-fast: 0.18s;
  --r-dur:      0.32s;
  --r-dur-slow: 0.55s;
}

html { scroll-behavior: smooth; }

/* ---- accesibilidad: anillo de foco visible ------------------- */
*:focus-visible {
  outline: 3px solid var(--azul-claro);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- respeta prefers-reduced-motion -------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   1. Cabeceras de sección
   ============================================================ */
.section-label {
  position: relative;
  display: inline-block;
  padding-left: 22px;
}
.section-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 2px;
  background: var(--azul-claro);
  border-radius: 2px;
}

.section-title em {
  position: relative;
  display: inline-block;
  font-style: normal;
}
.section-title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  height: 8px;
  background: linear-gradient(180deg, transparent 50%, rgba(91, 159, 212, 0.32) 50%);
  border-radius: 4px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--r-ease) 0.25s;
}
.section-title.is-revealed em::after,
.is-revealed .section-title em::after,
.visible .section-title em::after {
  transform: scaleX(1);
}

/* ============================================================
   2. HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
}

/* halo radial suave por encima de los círculos existentes */
.hero .hero-content::before {
  content: "";
  position: absolute;
  inset: -10% -5% -10% -5%;
  pointer-events: none;
  background: radial-gradient(ellipse at 35% 30%, rgba(91, 159, 212, 0.18), transparent 55%);
  opacity: 0;
  animation: r-fade-in 1.4s ease-out 0.2s forwards;
  z-index: -1;
}
@keyframes r-fade-in { to { opacity: 1; } }

/* entrada escalonada del contenido del hero */
.hero-content { position: relative; }
.hero-content > * {
  opacity: 0;
  transform: translateY(28px);
  animation: r-rise 0.85s var(--r-ease) forwards;
}
.hero-tag  { animation-delay: 0.08s; }
.hero h1   { animation-delay: 0.20s; }
.hero-desc { animation-delay: 0.36s; }
.hero-btns { animation-delay: 0.52s; }
@keyframes r-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* h1 em: gradiente sutil para destacar */
.hero h1 em {
  background: linear-gradient(120deg, #ffffff 0%, #ddeeff 40%, #5b9fd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-style: normal;
  font-weight: 500;
}

.hero-tag {
  letter-spacing: 1.2px;
}

/* botón primario: gradiente + brillo al pasar el cursor */
.hero-btns .btn-primary {
  background: linear-gradient(135deg, #ffffff 0%, #f0f6fc 100%);
  color: var(--azul-oscuro);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease);
}
.hero-btns .btn-primary::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
  transform: skewX(-22deg);
  transition: left 0.65s var(--r-ease);
  pointer-events: none;
}
.hero-btns .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}
.hero-btns .btn-primary:hover::before { left: 130%; }
.hero-btns .btn-primary:active { transform: translateY(-1px); }

.hero-btns .btn-outline {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform var(--r-dur) var(--r-ease),
              border-color var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease);
}
.hero-btns .btn-outline:hover { transform: translateY(-3px); }

/* indicador de scroll: removido por feedback (quedaba pegado al borde) */
.hero::before, .hero::after { /* no tocar: ya gestionados por styles.css */ }

/* ============================================================
   3. CATEGORÍAS
   ============================================================ */
.categoria-card {
  overflow: hidden;
  border-radius: var(--radio-lg);
  box-shadow: var(--r-sh-1);
  transition: transform var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
  will-change: transform;
}
.categoria-card .categoria-img {
  transition: transform 0.8s var(--r-ease);
}
.categoria-card:hover { box-shadow: var(--r-sh-3); }
.categoria-card:hover .categoria-img {
  transform: scale(1.06);
}

.categoria-overlay {
  transition: background var(--r-dur) var(--r-ease);
}
.categoria-card:hover .categoria-overlay {
  background: linear-gradient(180deg, rgba(11, 20, 56, 0.10) 0%, rgba(11, 20, 56, 0.78) 100%);
}

.categoria-btn {
  transition: gap 0.25s var(--r-ease), color 0.25s var(--r-ease);
}
.categoria-card:hover .categoria-btn { gap: 12px; }
.categoria-btn svg {
  transition: transform 0.3s var(--r-ease);
}
.categoria-card:hover .categoria-btn svg {
  transform: translateX(4px);
}

/* ============================================================
   4. DIVISOR DECORATIVO
   ============================================================ */
.divisor-decorativo {
  position: relative;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(45, 74, 158, 0.18) 30%,
    rgba(45, 74, 158, 0.18) 70%,
    transparent 100%);
}
.divisor-decorativo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(91, 159, 212, 0.18) 0%, transparent 70%);
}

/* ============================================================
   5. NOSOTROS
   ============================================================ */
.nosotros-logo img {
  transition: transform 0.6s var(--r-ease);
}
.nosotros-logo:hover img {
  transform: translateY(-4px);
}

.nosotros-parrafo {
  line-height: 1.75;
}

/* ============================================================
   6. DATOS CLAVE
   ============================================================ */
.dato-item {
  position: relative;
  padding: 28px 20px;
  border-radius: var(--radio-lg);
  background: var(--blanco);
  box-shadow: var(--r-sh-1);
  transition: transform var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.dato-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--r-sh-2);
}

.dato-icono {
  transition: transform 0.4s var(--r-ease-bounce);
}
.dato-item:hover .dato-icono {
  transform: scale(1.08) rotate(-3deg);
}

.dato-num {
  background: linear-gradient(135deg, var(--azul-medio), var(--azul-oscuro));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   7. PROVEEDORES
   ============================================================ */
.proveedores-label {
  position: relative;
  padding-bottom: 14px;
}
.proveedores-label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 2px;
  background: var(--azul-claro);
  border-radius: 2px;
}

.proveedores-logos img {
  filter: grayscale(20%);
  opacity: 0.9;
  transition: filter 0.3s var(--r-ease), opacity 0.3s var(--r-ease), transform 0.3s var(--r-ease);
}
.proveedores-logos img:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.06);
}

.proveedores-flecha {
  transform: translateY(-50%);
  transition: opacity 0.22s ease, background 0.15s ease,
              box-shadow 0.25s var(--r-ease);
}
.proveedores-flecha:hover {
  box-shadow: 0 10px 22px rgba(30, 42, 110, 0.24);
}

/* ============================================================
   8. ZONAS (mapa)
   ============================================================ */
.zonas {
  position: relative;
}

/* reveal del encabezado de zonas (lo activa JS via .is-revealed) */
.zonas-header {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--r-ease), transform 0.7s var(--r-ease);
}
.zonas-header.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.zonas-cta {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--r-ease) 0.15s, transform 0.6s var(--r-ease) 0.15s;
}
.zonas-cta.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.btn-zonas {
  position: relative;
  overflow: hidden;
  transition: background 0.25s var(--r-ease),
              border-color 0.25s var(--r-ease),
              transform 0.25s var(--r-ease),
              box-shadow 0.25s var(--r-ease);
}
.btn-zonas:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

/* ============================================================
   9. CATÁLOGOS · BANNER
   ============================================================ */
.catalogo-banner {
  position: relative;
  overflow: hidden;
}
.catalogo-banner-overlay {
  background: linear-gradient(120deg,
    rgba(11, 20, 56, 0.55) 0%,
    rgba(30, 42, 110, 0.50) 60%,
    rgba(45, 74, 158, 0.42) 100%);
}

.catalogo-banner-mockup img {
  animation: r-float 4.5s var(--r-ease) infinite;
  will-change: transform;
  filter: drop-shadow(6px 12px 26px rgba(0, 0, 0, 0.45));
}
@keyframes r-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.catalogo-banner-texto h2 {
  line-height: 1.15;
}

.btn-banner {
  position: relative;
  overflow: hidden;
  transition: transform var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.btn-banner::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(30, 42, 110, 0.18) 50%, transparent 100%);
  transform: skewX(-22deg);
  transition: left 0.6s var(--r-ease);
}
.btn-banner:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}
.btn-banner:hover::before { left: 130%; }

/* ============================================================
   10. CONTACTO
   ============================================================ */
.contacto-form {
  border-radius: var(--radio-lg);
  box-shadow: var(--r-sh-2);
  transition: box-shadow 0.3s var(--r-ease);
}
.contacto-form:focus-within {
  box-shadow: var(--r-sh-3);
}

.contacto-form input,
.contacto-form select,
.contacto-form textarea {
  transition: border-color 0.2s var(--r-ease),
              box-shadow 0.2s var(--r-ease),
              background 0.2s var(--r-ease);
}
.contacto-form input:focus,
.contacto-form select:focus,
.contacto-form textarea:focus {
  border-color: var(--azul-medio);
  box-shadow: 0 0 0 4px rgba(91, 159, 212, 0.18);
  outline: none;
}

.btn-submit {
  position: relative;
  overflow: hidden;
  background: var(--r-grad-cta);
  box-shadow: var(--r-sh-cta);
  letter-spacing: 0.3px;
  transition: transform 0.2s var(--r-ease),
              box-shadow 0.25s var(--r-ease),
              background 0.25s var(--r-ease);
}
.btn-submit::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.30), transparent);
  transform: skewX(-22deg);
  transition: left 0.65s var(--r-ease);
}
.btn-submit:hover {
  background: var(--r-grad-cta);
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(30, 42, 110, 0.38);
}
.btn-submit:hover::before { left: 130%; }
.btn-submit:active { transform: translateY(0); }

.contact-icon--link {
  transition: transform 0.25s var(--r-ease-bounce),
              background 0.25s var(--r-ease);
}
.contact-icon--link:hover {
  transform: scale(1.08) rotate(-3deg);
}

.tel-btn {
  transition: transform 0.2s var(--r-ease),
              background 0.2s var(--r-ease),
              box-shadow 0.2s var(--r-ease);
}
.tel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(30, 42, 110, 0.18);
}

/* ============================================================
   11. AJUSTES FINOS GLOBALES
   ============================================================ */

/* selección de texto coherente con la marca */
::selection {
  background: var(--azul-medio);
  color: #fff;
}

/* botones por encima de la mascara/overflow */
.btn-primary, .btn-banner, .btn-submit, .btn-zonas, .btn-modal {
  isolation: isolate;
}

/* ============================================================
   12. MAPA · pista de zoom con Ctrl
   ============================================================ */
.mapa-pista-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 20, 56, 0.55);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--r-ease), visibility 0.22s;
  z-index: 800;
}
.mapa-pista-zoom.is-visible {
  opacity: 1;
  visibility: visible;
}
.zonas-mapa { position: relative; }

/* ============================================================
   13. NIVEL ÉPICO · hero con malla animada, h1 con stagger por palabra,
       categorías con tilt 3D, datos clave con número monumental.
   ============================================================ */

/* --- 13.1 Hero: fondo y círculos atmosféricos originales (styles.css)
       se conservan; aquí solo elevamos el contenido sobre la capa
       decorativa. ------------------------------------------------ */
.hero-content { position: relative; z-index: 2; }

/* --- 13.2 H1 con stagger por palabra (lo divide JS) ------------- */
.hero h1 .r-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(2deg);
  animation: r-word-rise 0.7s var(--r-ease) forwards;
}
.hero h1 .r-word--em {
  background: linear-gradient(120deg, #ffffff 0%, #ddeeff 40%, #5b9fd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-style: normal;
  font-weight: 600;
}
@keyframes r-word-rise {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}
.hero-content.r-words h1 { opacity: 1; animation: none; transform: none; }

/* h1 algo más impactante en escritorio */
@media (min-width: 1024px) {
  .hero h1 { font-size: clamp(48px, 5.8vw, 72px); letter-spacing: -1.5px; }
}

/* --- 13.3 Categorías con tilt 3D (las prepara redesign.js) ----- */
.categoria-card {
  transform-style: preserve-3d;
  transition: transform 0.25s var(--r-ease),
              box-shadow 0.3s var(--r-ease);
}
.categoria-card.r-tilt {
  /* las variables las inyecta el JS sobre el elemento */
  transform: perspective(900px)
             rotateX(var(--r-tx, 0deg))
             rotateY(var(--r-ty, 0deg))
             translateZ(0);
}
.categoria-card .categoria-overlay,
.categoria-card .categoria-img {
  transform: translateZ(0);
}
.categoria-card.r-tilt .categoria-overlay {
  transform: translateZ(20px);
}
@media (hover: none) {
  .categoria-card.r-tilt { transform: none; }
}

/* --- 13.4 Datos clave: número con impacto, pero contenido ------ */
.dato-num {
  font-size: clamp(34px, 3.6vw, 48px) !important;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.05;
  margin-bottom: 6px;
}
.dato-item {
  position: relative;
  overflow: hidden;
}
.dato-item::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 70%;
  height: 180%;
  background: radial-gradient(circle at center, rgba(91, 159, 212, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--r-ease);
  pointer-events: none;
}
.dato-item:hover::before { opacity: 1; }

/* --- 13.5 Cabeceras con número de sección sutil ---------------- */
.section-title {
  position: relative;
}

/* --- 13.6 Section reveal global más suave ---------------------- */
.section-title,
.section-label,
.zonas-desc,
.proveedores-label {
  /* dejamos que main.js/redesign.js controlen el revelado mediante
     IntersectionObserver. Aquí solo aseguramos transición. */
}

/* --- 13.7 Divisor decorativo: ahora con destello -------------- */
.divisor-decorativo {
  position: relative;
  overflow: hidden;
}
.divisor-decorativo::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -50%;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(91, 159, 212, 0.6), transparent);
  transform: translateY(-50%);
  animation: r-divisor 6s linear infinite;
}
@keyframes r-divisor {
  0%   { left: -50%; }
  100% { left: 150%; }
}

/* --- 13.8 Catalogo banner: aumento de impacto ------------------ */
.catalogo-banner {
  min-height: 360px;
}
.catalogo-banner-texto h2 {
  font-size: clamp(28px, 3.5vw, 44px);
  letter-spacing: -0.8px;
}
.catalogo-banner-img img {
  transition: transform 12s linear;
}
.catalogo-banner:hover .catalogo-banner-img img {
  transform: scale(1.05);
}
