/* ======================================================= */
/* 1. CONFIGURACIÓN GLOBAL Y VARIABLES
/* ======================================================= */
:root {
  --color-principal: #2c3e50;
  --color-acento: #ca0505;
  --color-fondo: #ecf0f1;
  --color-texto: #34495e;
  --color-blanco: #fff;
}

/* Base de tipografía y layout (MOBILE-FIRST) */
body {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  color: var(--color-texto);
  background-color: var(--color-blanco);
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Evita el scroll horizontal */
}

h2 {
  font-size: 2em; /* Tamaño base para móviles */
  font-weight: bold;
  color: var(--color-texto);
  margin-bottom: 20px;
}

/* Estilo para títulos h3, para que sean consistentes con h2 */
h3 {
  font-size: 2em; /* Tamaño de fuente base para móviles, igual que h2 */
  font-weight: bold;
  color: var(--color-texto);
  margin-bottom: 20px;
  text-align: center;
}

/* Ajustes para todas las imágenes */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ======================================================= */
/* 2. BARRA DE NAVEGACIÓN
/* ======================================================= */
.main-nav {
  padding-top: 15px;
  padding-bottom: 15px;
}

.logo-img {
  height: 51px; /* Tamaño para móviles */
}

.company-name {
  margin-left: 5px;
  font-size: 0.85em; /* Tamaño para móviles */
  font-weight: bold;
  color: var(--color-principal);
}

.nav-links .nav-link {
  font-weight: bold;
  color: var(--color-texto);
  margin: 0 10px;
  transition: color 0.3s ease;
  text-align: center; /* Centrado en menú móvil */
  padding: 8px 0; /* Padding en menú móvil */
}

.nav-links .nav-link:hover {
  color: var(--color-acento);
}

/* ======================================================= */
/* 3. SECCIÓN HERO (PORTADA)
/* ======================================================= */
.hero-section {
  position: relative;
  color: var(--color-blanco);
  /* Configuración para pantallas grandes (desktop) - Sin degradado azul */
  background: url('/images/hero.webp') no-repeat center 20%/cover;
  padding: 8vh 0;
  min-height: calc(var(--vh, 1vh) * 100 - 92px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center; /* Alineación centrada por defecto para móviles */
}

/* Color del texto principal del Hero */
.animated-text {
  height: auto; /* Altura automática para evitar cortes */
  overflow: visible; /* Permite que el contenido excedente se muestre */
  color: var(--color-blanco); /* CAMBIO: Color del texto a blanco nuevamente */
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); /* Mantenemos la sombra para el texto */
}

.text-slide-in {
  position: relative; /* Posición relativa para el apilamiento */
  opacity: 1; /* Visible por defecto */
  transform: none; /* Sin transformación por defecto */
  font-size: 5vw; /* Tamaño fluido para móviles */
  font-weight: bold;
  line-height: 1.2;
  width: 100%;
  left: 0;
}

.text-slide-in.active { /* Sobrescribe la animación solo en pantallas grandes */
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.hero-bottom-content {
  margin-top: 20px;
}

/* Color del texto "DESDE 1992" */
.hero-bottom-content p {
  font-size: 4vw; /* Tamaño fluido para móviles */
  font-family: 'Montserrat', sans-serif;
  color: var(--color-blanco); /* CAMBIO: Color del texto a blanco nuevamente */
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8); /* Mantenemos la sombra para el texto */
}

.btn {
  background: var(--color-acento);
  color: var(--color-blanco);
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1.2em;
  border: none;
}

.btn:hover {
  background-color: #b30404;
  color: var(--color-blanco);
}

/* ======================================================= */
/* 4. ESTILOS DE SECCIONES ESPECÍFICAS
/* ======================================================= */
.dark-bg {
  background-color: var(--color-principal);
  color: var(--color-blanco);
}

.dark-bg h2, .dark-bg h3, .dark-bg p {
  color: var(--color-blanco);
}

.aval-subheading {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--color-acento);
  margin-bottom: 0.5rem;
}

/* --- Sección Quiénes Somos (Texto expandible) --- */
#quienes-somos .row {
  align-items: center;
}

#quienes-somos .text-content p {
  text-align: justify;
  font-size: 1.1em;
}

@media (max-width: 768px) {
    #quienes-somos .text-content p {
        font-size: 0.8em; /* Reduce el tamaño en pantallas pequeñas para evitar desbordamientos */
    }
}
.full-text {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.full-text.show {
  max-height: 500px;
  opacity: 1;
}

.ver-mas-btn {
  background-color: transparent;
  color: var(--color-acento);
  border: none;
  padding: 5px 0;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  outline: none;
  text-decoration: underline;
}

.ver-mas-btn:hover {
  color: #b30404;
}

/* --- Sección Misión, Visión y Valores (Estilos Finales) --- */
#mision-vision-valores {
  background-color: #ffffff;
}

/* Regla adicional para los textos del acordeón */
#mision-vision-valores .accordion-body p {
  text-align: justify;
  font-size: 1.12em;
}

.accordion-item.mvv-item {
  background-color: transparent;
  border-radius: 10px;
  overflow: hidden;
  height: auto;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.accordion-item.mvv-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.accordion-header {
  height: 300px;
  position: relative;
  z-index: 1;
}

.accordion-button {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 1;
  display: block;
}

.accordion-button::after {
  display: none;
}

.mvv-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-principal);
  color: var(--color-blanco);
  text-align: center;
  padding: 15px 0;
  font-size: 1.5em;
  font-weight: bold;
  pointer-events: none;
  transition: background-color 0.3s ease;
  z-index: 2;
}

.accordion-button:hover .overlay-text {
  background: var(--color-acento);
}

.accordion-body {
  background-color: var(--color-blanco);
  color: var(--color-texto);
  padding: 1.5rem;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.accordion-collapse.show .accordion-body {
  max-height: 500px;
}
/* ======================================================= */
/* --- SECCIÓN SERVICIOS CON FLIP CARDS (CÓDIGO FINAL 2.0) --- */
/* ======================================================= */

.services-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-top: 2rem;
    padding: 0 50px;
}

.services-carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 30px;
    padding-bottom: 15px;
}

.services-carousel-slides .service-item {
    flex: 0 0 300px;
    width: 300px;
    height: 400px;
    background-color: transparent;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    color: var(--color-blanco);
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.service-item:hover .flip-card-inner,
.service-item:focus .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.flip-card-front {
    color: var(--color-blanco);
}

.flip-card-front p {
    font-weight: bold;
    font-size: 1.2em;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0 10px;
}

.flip-card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.flip-card-back {
    background-color: var(--color-blanco);
    color: var(--color-principal);
    transform: rotateY(180deg);
    border: 2px solid var(--color-blanco);
    box-sizing: border-box;
    -webkit-transform: rotateY(180deg) translateZ(0);
    transform: rotateY(180deg) translateZ(0);
}

.flip-card-back h4 {
    font-size: 1.3em;
    color: var(--color-principal);
    border-bottom: 2px solid var(--color-acento);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: bold;
}

.flip-card-back p {
    color: var(--color-texto);
    font-size: 0.95em;
    text-align: center;
    padding: 0 10px;
}

.vigilancia-bg { background-image: url('/images/vigilancia_proteccion.webp'); }
.monitoreo-bg { background-image: url('/images/monitoreo.webp'); }
.instalacion-bg { background-image: url('/images/camara.webp'); }
.acompaniamiento-bg { background-image: url('/images/vehiculos.webp'); }
.traslado-bg { background-image: url('/images/servicio_acompa.webp'); }
.investigacion-bg { background-image: url('/images/investigacion.webp'); background-position: 90% 50%; }

.services-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-acento);
    color: var(--color-blanco);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5em;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    line-height: 1;
}

.services-carousel-btn:hover {
    background-color: #b30404;
}

.services-prev-btn { left: 5px; }
.services-next-btn { right: 5px; }

@media (max-width: 767px) {
    .services-carousel-container {
        padding: 0 20px;
    }
    .services-carousel-slides .service-item {
        flex: 0 0 280px;
        width: 280px;
    }
    .services-carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }
}

@media (max-width: 400px) {
    .services-carousel-slides .service-item {
        flex: 0 0 240px;
        width: 240px;
        height: 360px;
    }
    .flip-card-front p { font-size: 1.1em; }
    .flip-card-back h4 { font-size: 1.2em; }
    .flip-card-back p { font-size: 0.9em; }
}

/* --- Sección Clientes (Carrusel) --- */
.clients-intro, .clients-end {
    font-size: 1.2em;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    margin: 20px auto;
    padding: 0 40px;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
    align-items: center;
    margin-left: 0;
}

.carousel-slides img {
    flex-shrink: 0;
    width: 100px;
    height: auto;
    margin: 0 10px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.carousel-slides img.active-logo {
    filter: grayscale(0%);
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-acento);
    color: var(--color-blanco);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5em;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    line-height: 1; /* Asegura que el carácter de la flecha esté centrado verticalmente */
}

.carousel-btn:hover {
    background-color: #b30404;
}

.carousel-btn.prev-btn { left: 3px; }
.carousel-btn.next-btn { right: 3px; }

/* --- Sección Contacto --- */
.contact-info {
  padding: 20px;
  background-color: var(--color-blanco);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  text-align: left;
}

.contact-info h3 {
  text-align: left;
}

.contact-info p {
  font-size: 1.1em;
  margin: 15px 0;
}

.contact-info i {
  color: var(--color-acento);
  margin-right: 10px;
}

.contact-map iframe {
  border-radius: 8px;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

/* --- SECCIÓN DE PERMISOS (servicios-entes.html) --- */
.permisos-logos, .permisos-laborales-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px; /* Espacio entre los logos */
  margin-top: 30px;
}

.logo-container {
  text-align: center;
  max-width: 120px;
  position: relative;
  overflow: hidden;
}

.logo-container img {
  height: auto;
  max-width: 100%;
  margin-bottom: 0;
  transition: filter 0.3s ease;
  filter: brightness(100%);
}

.logo-container .logo-name {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--color-blanco);
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-size: 0.8em;
  font-weight: bold;
  padding: 5px;
}

.logo-container:hover .logo-name {
  opacity: 1;
  visibility: visible;
}

.logo-container:hover img {
  filter: brightness(60%);
}

.permisos-bomberos-content {
  display: flex;
  flex-direction: column; /* Apilados en móviles */
  align-items: center;
  gap: 30px;
  margin-top: 20px;
  
  /* Reglas para centrar el contenedor */
  max-width: 500px; /* Ancho máximo para que no se vea demasiado grande */
  margin-left: auto;
  margin-right: auto;
}

.permisos-bomberos-content img {
  height: auto;
  width: 100%;
  max-width: 250px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.permisos-bomberos-titulo {
  text-align: center;
  margin-top: 3rem; /* Añade un margen superior para separarlo de la sección anterior */
}

#logo-bomberos {
  background-color: transparent; /* Asegura que el fondo del elemento sea transparente */
  outline: none; /* Elimina cualquier contorno potencial */
  border: none; /* Asegura que no haya bordes */
  box-shadow: none; /* Elimina cualquier sombra */
}

/* ======================================================= */
/* 5. FOOTER
/* ======================================================= */
.footer {
  background-color: var(--color-principal);
  color: var(--color-blanco);
  text-align: center;
  padding: 20px;
}

.footer a {
  color: var(--color-blanco);
  text-decoration: none;
}

/* ======================================================= */
/* 6. WIDGETS Y ANIMACIONES
/* ======================================================= */
.whatsapp-btn {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  background-color: #25d366;
  color: var(--color-blanco);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ======================================================= */
/* 7. MEDIA QUERIES (DESKTOP-FIRST para sobrescribir)
/* ======================================================= */
@media (min-width: 768px) {
  h2 {
    font-size: 2.5em;
  }
  .carousel-slides img {
    width: 150px; /* Tamaño de logo en tablet y escritorio */
    margin: 0 20px;
  }
  .permisos-bomberos-content {
    flex-direction: row; /* Diseño en fila para escritorios */
    justify-content: center; /* Centra los elementos horizontalmente */
    max-width: none;
    width: 100%; /* Asegura que ocupe todo el ancho disponible */
  }
}

@media (min-width: 992px) {
  .main-nav {
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .logo-img {
    height: 90px;
    margin-left: 50px;
  }
  .company-name {
    font-size: 1.2em;
    margin-left: 4px;
  }
  .navbar-collapse {
    position: static;
    background-color: transparent;
    margin-top: 0; 
    padding: 0;
    border-top: none;
  }
  .hero-content {
    text-align: left;
  }
  .animated-text {
    height: 8rem;
    overflow: hidden;
  }
  .text-slide-in {
    position: absolute;
    opacity: 0;
    transform: translateY(100%);
    font-size: 3.5rem;
  }
  .text-slide-in.active {
    opacity: 1;
    transform: translateY(0);
  }
  .hero-bottom-content p {
    font-size: 2.2em;
  }
}

/* Media Query para pantallas pequeñas (móviles) */
@media (max-width: 767px) {
    .services-carousel-container {
        padding: 0 40px;
    }
    .services-carousel-slides .service-item {
        flex: 0 0 260px;
        width: 260px;
    }
    .services-carousel-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 400px) {
  .company-name {
    font-size: 0.7em; /* Reduce el tamaño de la fuente */
  }
}

/* Corrección de alineación vertical para el logo de Fonacit */
.fonacit-logo-container img {
  margin-top: 30px;
}

@media (max-width: 576px) {
  .row {
    margin-left: 0;
    margin-right: 0;
  }
}

/* --- NUEVOS ESTILOS PARA EL FOOTER --- */
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-logo-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.footer-logo-img {
  height: 50px;
  margin-right: 10px;
}

.footer-company-name {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--color-blanco);
}

.footer-social a {
  color: var(--color-blanco);
  font-size: 2.5em;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--color-acento);
}

.copyright-text, .footer-extra-links {
  margin-top: 5px;
  margin-bottom: 0;
}

/* Modificación para pantallas más grandes */
@media (min-width: 768px) {
  .footer-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .footer-logo-container {
    margin-bottom: 0;
  }
  .footer-extra-links {
    text-align: center;
    margin-top: 10px;
  }
  .footer-social {
    margin-top: 10px;
  }
}

/* Media Query para pantallas más pequeñas (móviles y tablets) */
@media (max-width: 991px) {
  .hero-section {
    /* Usamos 'hero_moviles.jpeg' para móviles y tablets, sin degradado azul */
    background: url('/images/hero_moviles.webp') no-repeat center center / cover;
    min-height: calc(var(--vh, 1vh) * 90 - 92px); /* Restauramos la altura mínima */
    padding: 8vh 0; /* Restauramos el padding vertical */
  }
  .hero-content {
    /* Eliminamos el fondo para el texto y otros estilos para que no aparezca el contenedor gris */
    background-color: transparent; /* Quitamos el fondo */
    padding: 0; /* Quitamos el padding */
    border-radius: 0; /* Quitamos el borde redondeado */
  }
}

/* ======================================================= */
/* 8. ESTILOS DEL MAPA DE PRESENCIA NACIONAL
/* ======================================================= */
.map-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

#vzla-map {
  width: 100%;
  height: auto;
  stroke-width: 1.2;
  stroke: #2c3e50;
}

#vzla-map .venezuela-features {
  fill: #e0e0e0;
  stroke: #2c3e50;
  transition: fill 0.3s ease;
}

#vzla-map .venezuela-features:hover {
  fill: #cccccc;
}

#vzla-map .pin {
  fill: #ca0505;
  stroke: #ffffff;
  stroke-width: 2px;
  r: 8px;
  cursor: pointer;
  transition: r 0.3s ease, fill 0.3s ease;
  -webkit-transform: translate(0);
  transform: translate(0);
}

#vzla-map .pin:hover,
#vzla-map .pin:focus {
  r: 12px;
  fill: #ff3d3d;
  outline: none;
}

#tooltip {
  position: absolute;
  background-color: var(--color-principal);
  color: var(--color-blanco);
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.9em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  z-index: 10;
}

#tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -140%);
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-container {
  min-height: 65px;
}

@media (max-width: 600px) {
  #vzla-map .pin {
    r: 9px;
    stroke-width: 1.5px;
  }
  #vzla-map .pin:hover,
  #vzla-map .pin:focus {
    r: 12px;
  }
  #tooltip {
    font-size: 0.8em;
    padding: 6px 10px;
  }
}

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