/* Variables */
:root {
  --bg-body: #fff;
  --primary-color: #40953d;
  --secondary-color: #c0eba6;
  --tertiary-color: #fccd2a;
  --text-blue: #2d3055;
  --bone-white: #fffdf6;
}

/* Clases universales */
body {
  font-family: "Stack Sans Headline", sans-serif;
  background-color: var(--bone-white);
  padding-top: 45px; /* Evita que la NavBar tape el contenido */
}
html {
  font-size: 95%; /* Reduce sutilmente el tamaño base de todo el sitio */
}

.btn-prevencion {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}
.btn-prevencion:hover {
  background-color: #2e6e2c; /* Un verde un poco más oscuro para dar feedback visual */
  border-color: #2e6e2c;
  color: #ffffff;
}

/* BARRA DE NAVEGACIÓN */
nav.bg-prevencion {
  background: var(--bone-white);
  padding: 5px;
}

nav.bg-prevencion ul li a {
  color: var(--text-blue);
  position: relative;
}
nav.bg-prevencion ul li a.active {
  color: var(--primary-color) !important;
  font-weight: 600 !important;
}

nav.bg-prevencion ul li a::after {
  width: 0%;
  height: 2px;
  background: transparent;
  content: "";
  position: absolute;
  bottom: 2px;
  left: 10px;
  transition: 0.4s;
}
nav.bg-prevencion ul li a.active::after {
  background: var(--primary-color);
  width: 40%;
}
nav .navbar-brand img {
  width: 220px;
}
nav.bg-prevencion ul li a:hover {
  color: var(--primary-color);
}
nav.bg-prevencion ul li a:hover::after {
  background: var(--primary-color);
  width: 40%;
}
nav.bg-prevencion ul li.soli-info a {
  display: block;
  padding: 10px 30px;
  color: #fff;
  background: var(--primary-color);
  border-radius: 4px;
  margin-left: 15px;
  width: 170px;
  text-align: center;
}
.soli-info a::after {
  display: none !important;
}
nav.bg-prevencion ul li.soli-info a:hover {
  background-color: #264b2b;
}

nav .navbar-brand img.logo1 {
  width: 47px;
}
nav .navbar-brand img.logo2 {
  width: 220px;
  margin-left: 6px;
}
nav.bg-prevencion div.navbarNavClass {
  font-size: 16px;
  padding: 10px 10px 0px 10px;
}
.nav-item {
  padding: 6px;
}

/* Asegurar que en pantallas de escritorio el ícono y el texto vayan siempre lado a lado y no se quiebren */
@media (min-width: 992px) {
  nav.bg-prevencion .navbar-nav .nav-link {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
  }

  nav.bg-prevencion .navbar-nav .nav-link i {
    margin-right: 6px !important;
  }
}

/* PORTADA */
#hero {
  padding: 60px 0px;
  position: relative;
  height: auto;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Estilo para el video de fondo dentro del hero */
#hero .bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}

/* Capa oscura opcional para que los textos se lean perfectamente sobre el video */
#hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 25, 44, 0.6);
  z-index: 1;
}

/* Asegurar que tu contenido quede por encima del video y de la capa oscura */
#hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  color: white;
}
.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1.7rem;
}

.hero-content p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 65px;
}
.btn-hero {
  font-size: 0.9rem;
  padding: 0.3rem 1.2rem;
  border-radius: 5px;
  font-weight: 500;
}

.btn-outline-light.btn-hero {
  border-width: 2px;
}

.btn-outline-light.btn-hero:hover {
  background-color: white;
  color: var(--text-blue);
}

/* FORMULARIO DE CONTACTO */
#contacto {
  position: relative;
  z-index: 10;
  margin-top: -70px;
  padding-bottom: 50px;
  scroll-margin-top: 120px;
}
#contacto .container {
  max-width: 1030px;
  background-color: #fff;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.contacto-info h2 {
  color: var(--text-blue);
  margin-top: 10px;
  font-size: 1.35rem;
  line-height: 1.4;
}

.contacto-info {
  padding-right: 20px;
}

.contacto-info span {
  color: var(--primary-color);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* Reducir tamaños de formularios */
#contacto .form-control,
#contacto .form-select {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

#contacto button[type="submit"] {
  font-size: 0.85rem;
  padding: 0.5rem;
}

/* Estilo para las tarjetas de servicios en el inicio */
.service-card {
  border-radius: 10px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  background-color: #fff;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.service-card .service-img {
  height: 180px;
  object-fit: cover;
}

/* Botón flotante de WhatsApp */
.btn-whatsapp-flotante {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1000;
  width: 55px;
  height: 55px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}

.btn-whatsapp-flotante:hover {
  transform: scale(1.1);
  background-color: #20ba5a;
  color: #fff;
}

/* Estilos del Widget de WhatsApp */
.whatsapp-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1029;
  font-family: inherit;
}

.whatsapp-toggle-btn {
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

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

.whatsapp-box {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 280px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.whatsapp-box.activo {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.whatsapp-header {
  background-color: #075e3a;
}

.whatsapp-message {
  border-left: 4px solid #25d366;
  font-size: 0.9rem;
}

.whatsapp-header h6 {
  font-size: 0.85rem;
}

.whatsapp-header small {
  font-size: 0.75rem;
}

.whatsapp-message p {
  font-size: 0.85rem;
}

.whatsapp-footer .btn {
  font-size: 0.85rem;
}

[data-aos="fade-up-left"] {
  transform: translate3d(15px, 15px, 0);
}

[data-aos="fade-up-left"].aos-animate {
  transform: translate3d(0, 0, 0);
}

/* FOOTER */
.footer-prevencion {
  background-color: var(--text-blue);
  color: var(--bone-white);
  font-size: 0.85rem;
}

.footer-logo {
  width: 45px;
  height: auto;
}
.footer-logo-2 {
  width: 210px;
  height: auto;
  filter: brightness(0) invert(1);
  margin-left: 10px;
}
.footer-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  position: relative;
}

.footer-title::after {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  background-color: var(--primary-color);
  margin-top: 6px;
}

.text-muted-custom {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.8rem;
  transition:
    color 0.3s ease,
    padding-left 0.3s ease;
}

.footer-links a.activo {
  color: var(--secondary-color);
  font-weight: bold;
  text-shadow:
    0px 0px 8px rgba(64, 149, 61, 0.8),
    0px 0px 12px rgba(64, 149, 61, 0.5);
}
.footer-links a:hover {
  color: var(--secondary-color);
  padding-left: 5px;
}

.footer-contact li {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}

.color-verde {
  color: var(--primary-color);
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.15);
}

/* HERO SECUNDARIOS */
#hero-servicios,
#hero-sobre-mi,
#hero-contacto {
  background-color: var(--text-blue);
  padding: 80px 0;
  min-height: 364px;
  display: flex;
  align-items: center;
}

#hero-servicios h1,
#hero-sobre-mi h1,
#hero-contacto h1 {
  font-size: 3rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

#hero-servicios p,
#hero-sobre-mi p,
#hero-contacto p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 950px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ACORDEON DE SERVICIOS */
.accordion-button {
  font-size: 0.9rem;
  font-weight: 600;
}

.accordion-body {
  font-size: 0.85rem;
  color: #555;
}

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

.accordion-button::before {
  content: "\002B";
  font-weight: bold;
  margin-right: 15px;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.accordion-button:not(.collapsed)::before {
  content: "\2212";
}

.accordion-button:not(.collapsed) {
  background-color: rgba(64, 149, 61, 0.1);
  color: var(--primary-color);
  box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0
    var(--bs-accordion-border-color);
}

.accordion-button:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(64, 149, 61, 0.25);
}

/* PAGINA DE CONTACTO */
#info-contacto {
  scroll-margin-top: 100px;
}

/* RESPONSIVE / MEDIA QUERIES */
@media (max-width: 768px) {
  #hero {
    min-height: 60vh;
    padding: 60px 0px;
  }

  .hero-content h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
  }

  #hero p,
  .hero-content p,
  #hero .lead {
    font-size: 0.9rem !important;
    margin-bottom: 1.5rem;
  }
  .hero-content .d-flex {
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
  }
  .btn-hero {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    width: 80%;
    text-align: center;
  }

  #contacto {
    margin-top: -40px;
  }

  #contacto .container {
    width: auto;
    margin: 0px 10px;
    padding: 20px;
  }

  #hero-servicios,
  #hero-sobre-mi,
  #hero-contacto {
    padding: 50px 15px;
    min-height: 250px;
  }

  #hero-servicios h1,
  #hero-sobre-mi h1,
  #hero-contacto h1 {
    font-size: 2.3rem;
  }

  #hero-servicios p,
  #hero-sobre-mi p,
  #hero-contacto p {
    font-size: 0.9rem;
  }
}

/* MENÚ RESPONSIVE Y OFFCANVAS (Hasta 991px) */
@media (max-width: 991px) {
  nav.bg-prevencion ul li a::after {
    display: none !important;
  }

  .navbar-toggler {
    border-color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
    border-width: 1.8px;
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(64, 149, 61, 0.25);
  }

  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2340953d' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }

  nav .navbar-brand img.logo2 {
    width: 210px;
  }

  nav .navbar-brand img.logo1 {
    width: 40px;
  }

  .offcanvas-start {
    background-color: var(--bone-white);
    width: 82%;
    max-width: 340px;
  }

  .offcanvas-header {
    padding: 1.2rem 1.2rem 0.8rem 1.2rem;
  }

  .offcanvas-body {
    padding: 1rem 1.2rem;
  }

  .menu-lat-link {
    display: flex;
    align-items: center;
    padding: 12px 15px !important;
    color: var(--text-blue) !important;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 6px;
    transition:
      background-color 0.2s ease,
      color 0.2s ease;
  }

  .menu-lat-link i {
    font-size: 1.2rem;
    color: var(--text-blue);
  }

  .menu-lat-link.active {
    background-color: #e9f3e8;
    color: var(--primary-color) !important;
    border-left: 4px solid var(--primary-color);
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
  }

  .menu-lat-link.active i {
    color: var(--primary-color) !important;
  }

  .menu-lateral-footer .info-texto p {
    color: var(--text-blue);
    line-height: 1.35;
  }

  .columna-contacto {
    padding-left: 2.2rem;
    padding-right: 2.2rem;
  }
}
