/* Estilos específicos para la página Nosotros */

/* Sección con imagen de fondo */
.nosotros-image-section {
  width: 100%;
  min-height: 500px;
  background-image: url('../../img/nosotros/nosotros.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start; /* Pegado a la izquierda */
  padding-top: 80px;
}

.nosotros-image-content {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  padding: 40px 60px;
  margin-left: 60px; /* Margen a la izquierda */
}

.nosotros-image-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: 2px;
}

/* Convertir títulos h2 a mayúsculas en las secciones de dos columnas */
.two-column-section .content-title h2 {
  text-transform: uppercase;
}

/* Sección del botón para abrir video */
.video-trigger-section {
  padding: 100px 20px;
  text-align: center;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.open-video-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 20px 50px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.open-video-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}

.open-video-btn i {
  font-size: 1.3rem;
}

/* Modal de Video */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.video-modal.active {
  display: flex;
}

.video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
}

.video-modal-content {
  position: relative;
  width: 90%;
  height: 90%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
}

.video-modal-close:hover {
  background: white;
  transform: rotate(90deg);
}

.video-modal-close i {
  font-size: 1.5rem;
  color: #333;
}

.video-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Estilos específicos para la sección Historia (Nosotros) --- */
.historia-section .crema-bg {
  background-color: #E8E1DA;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* --- Estilos para la sección Misión y Visión --- */
/* Forzamos a la columna izquierda a comportarse como la derecha (centrado flex) */
.mision-vision-section .column-left.center-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* --- Ajuste de altura EXCLUSIVO para la sección Valores --- */
section.two-column-section.valores-section {
  height: 40vh; /* Alto solo para PC */
  min-height: 250px;
}

/* --- Estilos para la sección Valores (Cuadrícula de colores) --- */
.val-box-1 { background-color: #E8E1DA !important; }
.val-box-2 { background-color: #6F9BBC !important; }
.val-box-3 { background-color: #376A8D !important; }
.val-box-4 { background-color: #86943C !important; }
.val-box-5 { background-color: #575221 !important; }
.val-box-6 { background-color: #332E1D !important; }

/* Nos aseguramos de que cada cuadro sirva como "ancla" para la imagen */
.valores-section .val-box {
  position: relative;
  overflow: hidden; /* Esto evita que la imagen se salga del cuadro si es muy grande */
}

/* Forzamos la imagen para que se pegue al borde inferior (bottom: 0) */
.bottom-line-img {
  position: absolute;
  bottom: -1px; /* El -1px ayuda a evitar líneas blancas fantasma en algunos navegadores */
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  z-index: 1; /* Queda de fondo por si luego le ponemos texto encima */
}

/* --- Estilos para el Título de Valores (Cuadro 1) --- */
.val-box-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.valores-title-wrapper {
  position: relative;
  z-index: 2; /* Mantiene el texto por encima de la línea de fondo */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 40px; /* Separación entre el ícono y la palabra */
}

.valores-icon img {
  width: 90px;
  height: auto;
  display: block;
}

.valores-label {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #666666; /* Gris oscuro para que contraste con el crema */
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.valores-label i {
  font-size: 1.8rem;
  color: #86A329; /* Verde corporativo de los botones */
}

/* --- Estilos para los textos de los Valores (Cuadros 2 al 6) --- */
/* Importante: mayor especificidad para que no sea sobreescrito por el CSS base */
.valores-section .column-left,
.valores-section .column-right {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Pega todo el bloque a la derecha */
  padding: 40px 60px !important; /* Separación de los bordes igual para todos */
}

.valor-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Pega el texto a la derecha */
  text-align: right; /* Asegura que los párrafos se lean justificados a la derecha */
  gap: 15px;
}

.valor-title {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff; /* Texto blanco para contrastar con los fondos oscuros */
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
}


.valor-text p {
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Responsive - Global y Valores */
@media (max-width: 992px) {
  .valores-title-wrapper {
    gap: 20px;
  }
  .valores-label {
    font-size: 2rem;
  }
  .valor-title {
    font-size: 1.4rem;
  }
}

/* Responsive - Tablets */
@media (max-width: 768px) {
  .nosotros-image-section {
    min-height: 400px;
    background-attachment: scroll;
    padding-top: 60px;
    justify-content: flex-start;
  }

  .nosotros-image-content {
    margin-left: 20px;
    margin-right: 20px;
    padding: 25px 25px;
    max-width: calc(100% - 40px);
    box-sizing: border-box;
  }

  .nosotros-image-content h2 {
    font-size: 1.75rem;
    letter-spacing: 1px;
    word-break: break-word;
  }

  .open-video-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
  }

  .video-modal-content {
    width: 95%;
    height: 95%;
  }

  .video-modal-close {
    width: 40px;
    height: 40px;
    top: 10px;
    right: 10px;
  }

  .video-modal-close i {
    font-size: 1.2rem;
  }

  /* Reset defensivo de columnas para las secciones de Nosotros */
  .historia-section,
  .mision-vision-section {
    height: auto !important;
    flex-direction: column !important;
  }

  .historia-section .column-left,
  .historia-section .column-right,
  .mision-vision-section .column-left,
  .mision-vision-section .column-right {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Imagen de la sección Historia en mobile (va en column-right) */
  .historia-section .column-right {
    padding: 0 !important;
    background-color: transparent !important;
  }

  .historia-section .column-right img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
  }

  /* Aseguramos que los padding se mantengan correctos en pantallas medianas */
  .historia-section .crema-bg,
  .mision-vision-section .column-left.center-content {
    padding: 40px 20px !important;
  }

  .mision-vision-section .column-right {
    padding: 40px 20px !important;
  }

  /* Sección Valores: stackear cajas y reducir alto por caja */
  section.two-column-section.valores-section {
    height: auto !important;
    flex-direction: column !important;
  }
  section.two-column-section.valores-section .column-left,
  section.two-column-section.valores-section .column-right {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 25vh;
  }
  
  .val-box-1 {
    padding: 40px 20px;
  }

  .valores-title-wrapper {
    flex-direction: column; /* En celulares lo apilamos verticalmente */
    text-align: center;
    gap: 15px;
  }
  .valores-icon img {
    width: 70px;
  }
  .valores-label i {
    transform: rotate(90deg); /* Giramos la flecha hacia abajo en celular */
  }

  /* Ajustes en tablets para los textos de valores (cajas 2 a 6) */
  .val-box-2, .val-box-3, .val-box-4, .val-box-5, .val-box-6 {
    padding: 30px 30px;
  }
}

/* Responsive - Móviles */
@media (max-width: 480px) {
  .nosotros-image-section {
    padding-top: 40px;
  }

  .nosotros-image-content {
    margin-left: 15px;
    margin-right: 15px;
    padding: 20px 20px;
    max-width: calc(100% - 30px);
    box-sizing: border-box;
  }

  .nosotros-image-content h2 {
    font-size: 1.4rem;
    letter-spacing: 0.5px;
  }

  .nosotros-image-content p {
    font-size: 1rem;
  }

  .open-video-btn {
    padding: 12px 30px;
    font-size: 1rem;
  }

  /* Evitamos que afecte a Misión, Visión e Historia en Celulares */
  section.two-column-section.valores-section .column-left,
  section.two-column-section.valores-section .column-right {
    min-height: 20vh;
  }

  /* Ajustes móviles para los cuadros de valores */
  .val-box-2, .val-box-3, .val-box-4, .val-box-5, .val-box-6 {
    padding: 30px 20px;
    justify-content: center; /* En móvil queda mejor centrado porque falta espacio a la derecha */
  }

  .valor-content {
    align-items: center; /* Centramos en móvil */
    text-align: center; /* Centramos el texto en móvil */
  }

  .valor-title i {
    transform: rotate(90deg); /* La flechita apunta hacia abajo en celular */
  }
}