/* --- COMPORTAMIENTO GENERAL --- */
/* ===================================================================
   PALETA DE COLOR CORPORATIVA (azules)
   =================================================================== */
:root {
  --brand-primary: #0d6efd;      /* Azul primario */
  --brand-primary-dark: #0b5ed7; /* Azul primario hover */
  --brand-deep: #0a192f;         /* Azul profundo (marca) */
  --brand-deep-2: #0b1a2e;       /* Azul profundo secundario */
  --brand-soft: #f2f7ff;         /* Fondo azul muy suave (casi blanco) */
  --brand-soft-2: #e8f1fd;       /* Fondo azul suave alterno */
  --brand-text: #223a5e;         /* Texto sobre fondos claros */
  --brand-muted: #5a6b85;        /* Texto secundario */

  /* Acentos por servicio/característica */
  --color-security: #0d6efd; /* Azul  - Seguridad electrónica */
  --color-it: #16a34a;       /* Verde - Infraestructura & TI */
  --color-web: #7c3aed;      /* Morado - Desarrollo web */
}

html {
    /* Hace que el salto entre secciones sea un deslizamiento suave */
    scroll-behavior: smooth; 
}

/* Fondo general con un tinte azul muy suave para "iluminar" la página */
body {
  background-color: #fbfdff;
}

/* --- FONDOS DE SECCIÓN CON TINTE AZUL --- */
/* Sustituye los grises/blancos planos de Bootstrap por azules suaves */
#services-section {
  background: linear-gradient(180deg, var(--brand-soft) 0%, #ffffff 100%) !important;
}
#features-section {
  background-color: #ffffff;
}
#clients-section.bg-light {
  background: linear-gradient(180deg, #ffffff 0%, var(--brand-soft-2) 100%) !important;
}
#valores.bg-light {
  background-color: var(--brand-soft) !important;
}

/* Títulos de sección con el azul de marca */
.section .text-primary,
h3.text-primary { color: var(--brand-primary) !important; }

/* --- AJUSTE PARA EL MENÚ FIJO --- */
/* Esto le dice al navegador que se detenga 100px antes al hacer clic en un enlace interno */
section[id] {
    scroll-margin-top: 100px; 
}
/* --- HERO (VIDEO DE FONDO MODERNIZADO) --- */
.hero-container {
  position: relative;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
}

/* Video de fondo */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Fondo azul de marca mientras el video carga (evita el negro/foto) */
  background: linear-gradient(160deg, var(--brand-deep-2, #0b1a2e) 0%, var(--brand-deep, #0a192f) 100%);
}
.hero-video video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  background: transparent;
}

/* Overlay con gradiente diagonal corporativo */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(120deg, rgba(10, 25, 47, 0.92) 0%, rgba(11, 26, 46, 0.65) 45%, rgba(10, 25, 47, 0.35) 100%),
    radial-gradient(circle at 70% 30%, rgba(13, 110, 253, 0.25) 0%, transparent 55%);
}

/* Contenido centrado */
.hero-wrapper {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Compensa el navbar fijo (arriba) y el indicador de scroll (abajo) */
  padding: 90px 1rem 80px;
}
.hero-logo {
  width: auto;
  height: 190px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}
.hero-title {
  margin-top: 14px;
  font-size: clamp(22px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0.5rem;
  text-align: center;
  overflow-wrap: break-word;
}
.hero-text {
  font-size: clamp(16px, 1.6vw, 20px);
  max-width: 46ch;
  margin: 1rem auto 0;
  padding: 0 0.5rem;
  text-align: center;
}
.text-white-75 { color: rgba(255, 255, 255, 0.82); }

/* Botones CTA */
.hero-cta {
  margin-top: 2.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
/* Selectores reforzados con .btn para ganarle a la especificidad de Bootstrap */
.hero-cta .btn-hero-primary,
.hero-cta .btn-hero-outline {
  padding: 0.8rem 2rem;
  border-radius: 50rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.hero-cta .btn-hero-primary {
  background-color: #0d6efd;
  border: 2px solid #0d6efd;
  color: #fff;
  box-shadow: 0 10px 25px rgba(13, 110, 253, 0.45);
}
.hero-cta .btn-hero-primary:hover,
.hero-cta .btn-hero-primary:focus {
  background-color: #0b5ed7;
  border-color: #0b5ed7;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(13, 110, 253, 0.55);
}
.hero-cta .btn-hero-outline {
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  background-color: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(2px);
}
.hero-cta .btn-hero-outline:hover,
.hero-cta .btn-hero-outline:focus {
  background-color: #fff;
  color: #0a192f;
  transform: translateY(-3px);
}

/* Indicador de scroll animado */
.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.hero-scroll-mouse {
  display: block;
  width: 26px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  position: relative;
}
.hero-scroll-wheel {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  background: #fff;
  border-radius: 2px;
  animation: scrollWheel 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

/* Contenedor del hero: centra todo su contenido en cualquier ancho */
.animated-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

/* Animación de entrada suave (fade-up escalonado) */
.animated-hero > * {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s ease-out forwards;
}
.animated-hero > *:nth-child(1) { animation-delay: 0.1s; }
.animated-hero > *:nth-child(2) { animation-delay: 0.3s; }
.animated-hero > *:nth-child(3) { animation-delay: 0.5s; }
.animated-hero > *:nth-child(4) { animation-delay: 0.7s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .animated-hero > *,
  .hero-scroll-wheel,
  .cursor { animation: none; }
  .animated-hero > * { opacity: 1; transform: none; }
}

@media (max-width: 992px) {
  .hero-wrapper { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero-title { font-size: clamp(22px, 4.5vw, 34px); max-width: 26ch; }
}

@media (max-width: 800px) {
  .hero-logo { height: 150px; }
  .hero-title { font-size: clamp(20px, 6vw, 30px); }
  .hero-cta { margin-top: 1.5rem; }
  .hero-cta .btn-hero-primary,
  .hero-cta .btn-hero-outline { padding: 0.65rem 1.4rem; }
}

/* Efecto de parpadeo para el cursor de la máquina de escribir */
.cursor {
    animation: blink 1s step-end infinite;
    font-weight: bold;
}

@keyframes blink {
    50% { opacity: 0; }
}
/* --- ESTILOS DEL CARRUSEL DE MARCAS --- */
.slider {
    height: 100px;
    margin: auto;
    overflow: hidden;
    position: relative;
    width: 100%;
    background: white;
}

.slider::before,
.slider::after {
    background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%);
    content: "";
    height: 100px;
    position: absolute;
    width: 150px;
    z-index: 2;
}

.slider::before { left: 0; top: 0; }
.slider::after { right: 0; top: 0; transform: rotateZ(180deg); }

.slide-track {
    animation: scroll 30s linear infinite;
    display: flex;
    align-items: center;
}

.slide {
    height: 100px;
    width: 250px; 
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-250px * 5)); } 
}
/* --- ESTILOS DEL FOOTER --- */
#main-footer a {
    transition: color 0.3s ease;
}
#main-footer a:hover {
    color: #0d6efd !important; /* Azul primario de Bootstrap */
    text-decoration: underline !important;
}

/* --- TARJETAS DE SERVICIOS --- */
.service-card {
  position: relative;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 6px 20px rgba(10, 25, 47, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* Franja de color superior por servicio */
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--accent, #0d6efd);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(10, 25, 47, 0.14);
}

/* Acento por tema */
.service-security { --accent: var(--color-security); }
.service-it       { --accent: var(--color-it); }
.service-web      { --accent: var(--color-web); }

/* Ícono con círculo de color */
.service-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent, #0d6efd);
  background: color-mix(in srgb, var(--accent, #0d6efd) 12%, transparent);
  margin-bottom: 1.25rem;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.service-card:hover .service-icon {
  transform: scale(1.08) rotate(-4deg);
  background: var(--accent, #0d6efd);
  color: #fff;
}

/* Lista de "qué hacemos" */
.service-items .service-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  color: #334155;
  font-size: 0.95rem;
}
.service-items .service-item i {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--accent, #0d6efd);
  background: color-mix(in srgb, var(--accent, #0d6efd) 14%, transparent);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fallback para navegadores sin color-mix */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .service-icon { background: rgba(13, 110, 253, 0.12); }
  .service-items .service-item i { background: rgba(13, 110, 253, 0.14); }
}

/* --- CARACTERÍSTICAS --- */
.feature-row { --accent: #0d6efd; }
.feature-row[data-feature="security"] { --accent: var(--color-security, #0d6efd); }
.feature-row[data-feature="it"]       { --accent: var(--color-it, #16a34a); }
.feature-row[data-feature="web"]      { --accent: var(--color-web, #7c3aed); }

/* Ícono con color por tema */
.feature-icon {
  width: 64px;
  height: 64px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.feature-row:hover .feature-icon {
  transform: scale(1.08);
  background: var(--accent);
  color: #fff;
}

/* Imagen con realce y zoom al hover */
.feature-image img {
  transition: transform 0.5s ease;
}
.feature-image:hover img {
  transform: scale(1.06);
}

/* Animación de entrada al hacer scroll */
.feature-row {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.feature-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .feature-row { opacity: 1; transform: none; transition: none; }
  .feature-image img { transition: none; }
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .feature-icon { background: rgba(13, 110, 253, 0.12); }
}

/* --- TARJETAS DE CLIENTES --- */
.client-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 100%;
  min-height: 180px;
  padding: 1.75rem 1rem;
  background: #fff;
  border: 1px solid #e9eef5;
  border-radius: 1rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(10, 25, 47, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.client-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 38px rgba(13, 110, 253, 0.16);
  border-color: rgba(13, 110, 253, 0.4);
}
.client-card img {
  max-height: 80px;
  max-width: 75%;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.75;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
.client-card:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}
.client-name {
  font-weight: 600;
  color: #0a192f;
  font-size: 0.95rem;
  text-align: center;
}
.client-visit {
  font-size: 0.78rem;
  color: #0d6efd;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.client-card:hover .client-visit {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .client-card, .client-card img, .client-visit { transition: none; }
}

/* --- BLOQUES OSCUROS DE MARCA --- */
.brand-deep-bg {
  background: linear-gradient(160deg, var(--brand-deep-2) 0%, var(--brand-deep) 100%) !important;
  position: relative;
}
/* Los contadores de "Soluciones" en verde -> azul claro de marca para coherencia */
#solution-section .counter-value,
#solution-section .counter-number { color: #ffffff !important; }
#solution-section .text-success { color: #4da3ff !important; }

/* Texto secundario más legible en fondos claros */
.text-muted { color: var(--brand-muted) !important; }

/* Botones primarios de Bootstrap alineados a la marca */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-primary:hover {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

/* Navbar: al hacer scroll usa el azul de marca (no negro puro) */
.nav-sticky {
  background: var(--brand-deep) !important;
  box-shadow: 0 4px 20px rgba(10, 25, 47, 0.25);
}

/* --- BOTÓN DE WHATSAPP (footer) --- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  background-color: transparent;
  border: 2px solid #25d366;
  color: #25d366;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 50rem;
  text-decoration: none;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.btn-whatsapp i {
  font-size: 1.25rem;
  color: #25d366;
  transition: color 0.25s ease;
}
.btn-whatsapp:hover,
.btn-whatsapp:focus {
  background-color: #25d366;
  color: #fff;
  transform: translateY(-2px);
}
.btn-whatsapp:hover i,
.btn-whatsapp:focus i { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .btn-whatsapp { transition: none; }
}
