.carousel {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.carousel-item {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-mission,
.card-vision,
.card-values {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
article {
   background: none;
   color: rgb(51,51,51);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background 0.3s, color 0.3s;
}

.card-mission {
  width: 100vw;
  min-height: 600px;
  padding: 0;
  background-image: url("/images/mission.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-left: calc(-50vw + 50%);
  margin-top: 0;
}

/* ===== Carousel layout override for image-left / text-right ===== */
.carousel {
  position: relative;
  width: 100%;
  min-height: 450px; /* altura base del carrusel */
  overflow: hidden;
  display: block;
}
.carousel-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out;
}
.carousel-item.active {
  opacity: 1;
  pointer-events: auto;
}
.slide-image {
  flex: 0 0 50%;
  height: 100%;
}
.slide-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.slide-content {
  flex: 1 1 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  justify-content: flex-start;
  background: rgba(255, 255, 255, 0.85);
}
.slide-header .about-title{
  font-size: 2rem;
  font-weight: bold;
  text-decoration: underline;
  color: rgba(2, 122, 251, 0.8);
}
.slide-body {
  flex: 1;
  display: flex;
  align-items: center; /* el texto ocupa la altura de la imagen y se centra verticalmente */
}
/* Fix móvil: asegurar texto visible y apilado bajo imagen en carrusel */
@media (max-width: 768px) {
  .carousel {
    height: auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .carousel-item {
    position: relative;
    display: block;
  }
  .slide-image {
    width: 100%;
    height: auto;
    order: 1;
  }
  .slide-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
  .slide-content {
    width: 100%;
    height: auto;
    order: 2;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.92);
  }
  .slide-header .about-title {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }
  .slide-body {
    align-items: flex-start;
  }
  .carousel-indicators {
    position: static;
    transform: none;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .slide-image img {
    aspect-ratio: 4 / 3;
    max-height: 45vh;
  }
  .slide-content {
    padding: 0.75rem;
  }
  .slide-body .main-desc,
  .slide-body ul {
    font-size: clamp(0.95rem, 3.6vw, 1.05rem);
    line-height: 1.6;
  }
}
.slide-body {
  align-items: flex-start;
}
.carousel-indicators {
  position: absolute;
  bottom: 1rem; /* restaurado como estaba */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}
.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.3);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.indicator.active {
  background-color: rgba(2, 122, 251, 0.9);
}
.indicator:focus {
  outline: 2px solid rgba(2, 122, 251, 0.9);
}

@media (max-width: 768px) {
  /* Layout en grid: imagen arriba, texto abajo */
  .carousel-item { 
    display: grid !important; 
    grid-template-columns: 1fr; 
    grid-template-rows: auto auto; 
    position: relative !important; 
    inset: auto !important;
    height: auto !important;
    opacity: 1; /* el activo se verá; el JS controla el .active */
  }
  .slide-image, .slide-content { width: 100%; }

  /* Limitar altura de la imagen para que haya espacio para el texto */
  .slide-image img { 
    width: 100%; 
    height: auto !important; 
    max-height: 42vh; 
    aspect-ratio: auto; 
    object-fit: cover; 
  }

  /* Texto debajo, legible y con fondo */
  .slide-content { 
    padding: 0.9rem; 
    background: rgba(255,255,255,0.95); 
    color: #1f2937 !important; 
    z-index: 1; 
    min-height: 160px; 
  }
  .slide-header .about-title { font-size: clamp(1.2rem, 5vw, 1.6rem); color: #1f2937 !important; }
  .slide-body { display: block; }
  .slide-body .main-desc, .slide-body ul { font-size: clamp(0.95rem, 3.6vw, 1.05rem); line-height: 1.6; color: #374151 !important; }

  /* Indicadores bajo el contenido para que no tapen */
  .carousel-indicators { position: static !important; transform: none !important; margin-top: 0.5rem; }
}

@media (max-width: 480px) {
  .slide-image img { max-height: 38vh; }
  .slide-content { min-height: 140px; padding: 0.75rem; }
}
.slide-body {
  align-items: flex-start;
}
.carousel-indicators {
  position: absolute;
  bottom: 1rem; /* restaurado como estaba */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}
.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.3);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.indicator.active {
  background-color: rgba(2, 122, 251, 0.9);
}
.indicator:focus {
  outline: 2px solid rgba(2, 122, 251, 0.9);
}

@media (max-width: 768px) {
  /* Variante overlay: el texto se superpone a la imagen */
  .carousel { position: relative !important; overflow: hidden; }
  .carousel-item { position: relative !important; }
  .slide-image { position: relative; }
  .slide-image img { display: block; width: 100%; height: auto !important; max-height: 60vh; object-fit: cover; }
  .slide-content { 
    position: absolute !important; 
    left: 0; right: 0; bottom: 0; 
    display: block !important; 
    background: rgba(255,255,255,0.92) !important; 
    color: #1f2937 !important; 
    padding: 0.9rem !important; 
    z-index: 10; 
    box-shadow: 0 -6px 16px rgba(0,0,0,0.08);
  }
  .slide-header .about-title { font-size: clamp(1.2rem, 5vw, 1.6rem); }
  .slide-body { display: block !important; }
  .slide-body .main-desc, .slide-body ul { font-size: clamp(0.95rem, 3.6vw, 1.05rem); line-height: 1.6; }
  .carousel-indicators { position: static !important; transform: none !important; margin-top: 0.5rem; }
}

@media (max-width: 480px) {
  .slide-image img {
    aspect-ratio: 4 / 3;
    max-height: 45vh;
  }
  .slide-content {
    padding: 0.75rem;
  }
  .slide-body .main-desc,
  .slide-body ul {
    font-size: clamp(0.95rem, 3.6vw, 1.05rem);
    line-height: 1.6;
  }
}
.slide-body {
  align-items: flex-start;
}
.carousel-indicators {
  position: absolute;
  bottom: 1rem; /* restaurado como estaba */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}
.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.3);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.indicator.active {
  background-color: rgba(2, 122, 251, 0.9);
}
.indicator:focus {
  outline: 2px solid rgba(2, 122, 251, 0.9);
}

@media (max-width: 768px) {
  /* Revertir overlay: texto debajo de la imagen en móviles */
  /* Restaurar visibilidad del carrusel en móviles: solo item activo visible */
  @media (max-width: 768px) {
    /* No forzar display en .carousel-item; controlar qué items se muestran */
    .carousel-item { position: relative !important; height: auto !important; }
    /* Mostrar los elementos involucrados en la transición */
    .carousel-item.active,
    .carousel-item-next,
    .carousel-item-prev { display: block !important; }
    /* Ocultar el resto para evitar apilado vertical */
    .carousel-item:not(.active):not(.carousel-item-next):not(.carousel-item-prev) { display: none !important; }
  
    /* Apilar imagen y texto en flujo normal */
    .slide-image, .slide-content { position: static !important; }
    .slide-image img { width: 100%; height: auto !important; max-height: 40vh; object-fit: cover; }
    .slide-content { display: block !important; padding: 0.9rem; background: rgba(255,255,255,0.95); color: #1f2937; }
  
    /* Indicadores sin superposición en móviles */
    .carousel .carousel-indicators { position: static !important; transform: none !important; margin-top: 0.5rem; }
  }
  .slide-image img {
    aspect-ratio: 4 / 3;
    max-height: 45vh;
  }
  .slide-content {
    padding: 0.75rem;
  }
  .slide-body .main-desc,
  .slide-body ul {
    font-size: clamp(0.95rem, 3.6vw, 1.05rem);
    line-height: 1.6;
  }
}
.slide-body {
  align-items: flex-start;
}
.carousel-indicators {
  position: absolute;
  bottom: 1rem; /* restaurado como estaba */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}
.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.3);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.indicator.active {
  background-color: rgba(2, 122, 251, 0.9);
}
.indicator:focus {
  outline: 2px solid rgba(2, 122, 251, 0.9);
}

@media (max-width: 768px) {
  /* Forzar layout en bloque y asegurar altura automática */
  .carousel-item { height: auto; }
  .slide-content { display: block; position: relative; z-index: 1; }
  .slide-body { display: block; }

  /* Asegurar contraste y visibilidad del texto */
  .slide-content, .slide-content * { color: #1f2937 !important; opacity: 1 !important; visibility: visible !important; text-shadow: none; }
  .slide-header .about-title { color: #1f2937 !important; }
  .slide-body .main-desc, .slide-body li { color: #374151 !important; }

  /* Evitar que los indicadores tapen el contenido */
  .carousel .carousel-indicators { position: static !important; transform: none !important; margin-top: 0.5rem; }
}
