/**
 * Estilos para el carrusel de equipo en formato grid
 */

 .team-carousel-wrapper {
  position: inherit;
  width: 100%;
  overflow: hidden;
  margin: 30px 0;
}

.team-carousel {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.5s ease;
}

.team-carousel-page {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, auto);
  grid-gap: 20px;
  flex: 0 0 100%;
  width: 100%;
}

/* Eliminar cualquier pseudo-elemento que pueda estar causando problemas */
.team-carousel-item::before,
.team-carousel-item::after,
.team-carousel-item-inner::before,
.team-carousel-item-inner::after,
.team-image::before,
.team-image::after {
  display: none !important;
  content: none !important;
}

/* Estructura individual de cada ítem */
.team-carousel-item {
  position: relative !important;
  transition: all 0.3s ease;
  margin-bottom: 30px !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid #e0e0e0;
  border-radius: 0 !important;
  overflow: hidden !important; /* Cambiado a hidden para que no se vea nada fuera del contenedor */
  background-color: transparent !important;
}

.team-carousel-item-inner {
  position: relative;
  overflow: hidden;
  width: 100%;
  background-color: transparent !important;
}

.team-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background-color: transparent !important;
}

.team-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Estilo del overlay con efecto hover */
.team-info {
  position: absolute !important;
  bottom: -300% !important; /* Mover muy abajo para asegurarse que está oculto */
  left: 0;
  width: 100%;
  height: 100%; /* Altura normal, solo cubrirá la imagen inicialmente */
  background-color: rgba(128, 0, 32, 0.9) !important; /* Color vinotinto */
  color: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  transition: all 0.3s ease !important;
  z-index: 10 !important; /* Mayor que el recuadro azul */
  opacity: 0 !important; /* Inicialmente invisible */
}

/* Efecto hover mejorado */
.team-carousel-item:hover .team-info {
  bottom: 0 !important; /* Posición alineada con el borde inferior de la imagen */
  height: 100% !important; /* Altura solo de la imagen */
  opacity: 1 !important; /* Visible en hover */
}

/* NUEVO elemento adicional para cubrir la parte azul en hover */
.team-hover-blue-cover {
  position: absolute !important;
  bottom: -100% !important; /* Inicialmente fuera de la vista */
  left: 0;
  width: 100% !important;
  height: 60px !important; /* Misma altura que .team-position-display */
  background-color: rgba(128, 0, 32, 0.9) !important; /* Color vinotinto */
  transition: all 0.3s ease !important;
  z-index: 20 !important; /* Mayor que team-info y team-position-display */
  opacity: 0 !important; /* Inicialmente invisible */
}

/* Mostrar el cover azul en hover */
.team-carousel-item:hover .team-hover-blue-cover {
  bottom: 0 !important;
  opacity: 1 !important;
}

.team-carousel-item:hover .team-image img {
  transform: scale(1.05);
}

.team-name {
  font-size: 18px;
  font-weight: bold;
  margin: 0 0 10px 0;
  color: white !important;
}

.team-position {
  font-size: 14px;
  margin-bottom: 15px;
  color: white !important;
}

.team-description {
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.4;
  white-space: pre-line; /* Respeta saltos de línea en el texto */
  color: white !important;
}

.team-nationality {
  font-size: 12px;
  margin-top: 10px;
  font-style: italic;
  color: white !important;
}

/* Área inferior con nombre y posición */
.team-position-display {
  background-color: #2b4a80 !important;
  color: white !important;
  padding: 10px !important;
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 5 !important;
  height: 60px !important; /* Altura fija para el recuadro azul */
  overflow: hidden !important;
}

.team-name-display {
  font-size: 16px !important;
  font-weight: 600 !important;
  margin: 0 0 5px 0 !important;
  padding: 0 !important;
  color: white !important;
  display: block !important;
}

.team-position-text {
  font-size: 12px !important;
  font-weight: normal !important;
  margin: 0 !important;
  padding: 0 !important;
  color: white !important;
  display: block !important;
}

/* Controles del carrusel */
/* Modifica esta sección de controles del carrusel */
.carousel-controls {
  position: absolute;
  top: 50%; /* Centrado vertical */
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  width: 100%;
  z-index: 25;
  pointer-events: none;
}

.carousel-control {
  background-color: rgba(128, 0, 32, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.carousel-control:hover {
  opacity: 1;
}

.carousel-control.prev {
  position: absolute;
  left: -40px; /* Más hacia la izquierda, fuera del carrusel */
}

.carousel-control.next {
  position: absolute;
  right: -40px; /* Más hacia la derecha, fuera del carrusel */
}

/* Ajustamos la separación en pantallas más pequeñas */
@media (max-width: 768px) {
  .carousel-control.prev {
    left: -15px;
  }
  
  .carousel-control.next {
    right: -15px;
  }
}

/* Para pantallas muy pequeñas, aseguramos que las flechas sean visibles */
@media (max-width: 576px) {
  .carousel-control.prev {
    left: -10px;
  }
  
  .carousel-control.next {
    right: -10px;
  }
}

/* Paginación */
.carousel-pagination {
  text-align: center;
  margin-top: 15px;
}

.pagination-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.pagination-dot.active {
  background-color: rgba(128, 0, 32, 0.9);
}

/* Media queries para responsividad */
@media (max-width: 1200px) {
  .team-carousel-page {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .team-carousel-page {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .team-carousel-page {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .team-carousel-page {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: auto;
  }
}