/* ===========================
   CARRUSEL DE NOTICIAS
   Diseño profesional y responsive
   =========================== */
/* 🚨 ATENCIÓN: El uso de !important debe ser estratégico. 
   Este código fuerza la prioridad de los estilos de expansión. */

/* Estilos necesarios para el extracto de 8 líneas */
.noticia-expandible-wrapper {
    /* Define la altura máxima para simular 8 líneas. 
       Ajusta el valor (ej: 12rem) según el tamaño de tu fuente. */
    max-height: 12rem !important; 
    overflow: hidden !important;
    position: relative !important;
    transition: max-height 0.4s ease-out !important; /* Transición suave para la expansión */
}

/* Clase que se añade al expandir */
.noticia-expandible-wrapper.expanded {
    /* Un valor muy grande para asegurar que se expande por completo */
    max-height: 4000px !important; 
}

/* El degradado (fade-out) solo se muestra si NO está expandido */
.noticia-expandible-wrapper::after {
    content: "" !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3rem !important; /* Altura del degradado */
    /* Asegúrate de ajustar el color de fondo para que coincida con el color de fondo de tu tarjeta */
    background: linear-gradient(transparent, #ffffff) !important; 
    pointer-events: none !important; 
}

.noticia-expandible-wrapper.expanded::after {
    content: none !important; /* Eliminar el degradado cuando está expandido */
}

/* ---------------------------------------------------- */
/* Estilos para el carrusel (Altura Dinámica) */
/* ---------------------------------------------------- */

.licepay-carrusel-noticias,
.carrusel-container {
    height: auto !important; /* Sobrescribe cualquier altura fija */
    overflow: visible !important; 
    transition: height 0.3s ease-out !important; 
}

.carrusel-track {
    height: auto !important; 
}


.licepay-carrusel-noticias {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

.carrusel-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.carrusel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carrusel-slide {
  min-width: 100%;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Tarjeta de noticia */
.noticia-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.noticia-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(228, 30, 38, 0.15);
}

.noticia-imagen {
  width: 100%;
  height: 300px;
  overflow: hidden;
  position: relative;
}

.noticia-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.noticia-card:hover .noticia-imagen img {
  transform: scale(1.05);
}

.noticia-contenido {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.noticia-etiqueta {
  display: inline-block;
  background-color: #E41E26;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  width: fit-content;
}

.noticia-titulo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #212121;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.noticia-excerpt {
  color: #424242;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.noticia-link {
  display: inline-flex;
  align-items: center;
  color: #E41E26;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  width: fit-content;
}

.noticia-link::after {
  content: '→';
  margin-left: 0.5rem;
  transition: margin-left 0.3s ease;
}

.noticia-link:hover {
  color: #B71C1C;
}

.noticia-link:hover::after {
  margin-left: 1rem;
}

/* Botones de navegación */
.carrusel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.95);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #E41E26;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 10;
}

.carrusel-btn:hover {
  background-color: #E41E26;
  color: #FFFFFF;
  transform: translateY(-50%) scale(1.1);
}

.carrusel-btn-prev {
  left: 1rem;
}

.carrusel-btn-next {
  right: 1rem;
}

.carrusel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carrusel-btn:disabled:hover {
  background-color: rgba(255, 255, 255, 0.95);
  color: #E41E26;
  transform: translateY(-50%) scale(1);
}

/* Indicadores (dots) */
.carrusel-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.carrusel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #E0E0E0;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carrusel-dot:hover {
  background-color: #9E9E9E;
  transform: scale(1.2);
}

.carrusel-dot.active {
  background-color: #E41E26;
  width: 32px;
  border-radius: 6px;
}

/* Versión grid para múltiples noticias */
@media (min-width: 768px) {
  .carrusel-track.grid-mode {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
  
  .carrusel-track.grid-mode .carrusel-slide {
    min-width: auto;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .noticia-imagen {
    height: 200px;
  }
  
  .noticia-contenido {
    padding: 1.5rem;
  }
  
  .noticia-titulo {
    font-size: 1.25rem;
  }
  
  .carrusel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .carrusel-btn-prev {
    left: 0.5rem;
  }
  
  .carrusel-btn-next {
    right: 0.5rem;
  }
}

/* Animaciones */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.carrusel-slide.active {
  animation: slideIn 0.5s ease;
}

/* Accesibilidad */
.carrusel-btn:focus,
.carrusel-dot:focus {
  outline: 2px solid #E41E26;
  outline-offset: 2px;
}

/* Loading state */
.carrusel-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.carrusel-loading::after {
  content: '';
  width: 50px;
  height: 50px;
  border: 4px solid #E0E0E0;
  border-top-color: #E41E26;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
