:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #f72585;
  --text-color: #2b2d42;
  --light-color: #f8f9fa;
  --card-bg: #ffffff;
  --gradient-1: linear-gradient(135deg, #4361ee, #3a0ca3);
  --gradient-2: linear-gradient(135deg, #f72585, #7209b7);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.06);
  --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
  --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
  --button-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(67, 97, 238, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(247, 37, 133, 0.05) 0%, transparent 50%);
  color: var(--text-color);
  line-height: 1.6;
  padding: 2rem;
  font-size: 16px;
}

.container {
  max-width: 1900px;
  margin: 0 auto;
  position: relative;
}

h1 {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--secondary-color);
  font-weight: 800;
  font-size: 3rem;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient-2);
  border-radius: 2px;
}

/* Estilos del carrusel */
.carousel-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 3rem 0;
  overflow: hidden;
}

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 40%;
  gap: 2rem;
  list-style: none;
  padding: 1.5rem;
  
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Ocultar scrollbar en Firefox */
  
  /* Comportamiento de desplazamiento suave */
  @media (prefers-reduced-motion: no-preference) {
    scroll-behavior: smooth;
  }
  
  /* Ocultar scrollbar en Chrome */
  &::-webkit-scrollbar {
    display: none;
  }
}

.carousel > li {
  scroll-snap-align: center;
  scroll-snap-stop: always;
  min-width: 0;
  position: relative;
  perspective: 1000px;
}

/* Estilos de las tarjetas */
.card {
  position: relative;
  background-color: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(0) rotateY(0);
  transform-style: preserve-3d;
  margin: 0 auto;
  width: 100%;
}

.card:hover {
  transform: translateY(-15px) rotateY(5deg);
  box-shadow: var(--hover-shadow);
}

.card-image {
  position: relative;
  overflow: hidden;
}

.card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover img {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.1);
}

.card-badge {
  position: absolute;
  top: 20px;
  right: -60px;
  background: var(--gradient-2);
  color: white;
  padding: 8px 60px;
  font-size: 0.85rem;
  font-weight: 600;
  transform: rotate(45deg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-content {
  padding: 1.8rem;
  background: var(--card-bg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.card h3 {
  margin-bottom: 0.8rem;
  color: var(--secondary-color);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.card p {
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 1.05rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-tag {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-button {
  background: var(--gradient-1);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--button-shadow);
  outline: none;
}

.card-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.2);
}

/* Estilos para los botones de desplazamiento */
.carousel::scroll-button(left),
.carousel::scroll-button(right) {
  width: 4rem;
  height: 4rem;
  background: var(--gradient-1);
  border-radius: 50%;
  border: none;
  box-shadow: var(--shadow);
  color: white;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  transition: var(--transition);
  opacity: 0.9;
}

.carousel::scroll-button(left) {
  content: "❮";
  left: 1.5rem;
}

.carousel::scroll-button(right) {
  content: "❯";
  right: 1.5rem;
}

.carousel::scroll-button(*):hover {
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.carousel::scroll-button(*):disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%) scale(1);
  box-shadow: var(--shadow);
}

/* Estilos para los marcadores de desplazamiento */
.carousel {
  scroll-marker-group: after;
  scroll-marker-inline-end: auto;
  scroll-marker-inline-start: auto;
  scroll-marker-block-start: 1rem;
}

.carousel::scroll-marker-group {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  height: 20px;
  margin-block-start: 1.2rem;
  margin-block-end: 0.5rem;
}

.carousel li::scroll-marker {
  content: ' ';
  border: 2px solid #b0b0b0;
  border-radius: 100%;
  height: 16px;
  width: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.carousel li::scroll-marker:hover,
.carousel li::scroll-marker:focus-visible {
  background: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.carousel li::scroll-marker:target-current {
  background: var(--accent-color);
  border-color: var(--accent-color);
  height: 18px;
  width: 18px;
  box-shadow: 0 3px 6px rgba(247, 37, 133, 0.3);
}

/* Añadir efecto de brillo a las tarjetas */
.card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 10;
  transition: all 0.7s ease-in-out;
  opacity: 0;
}

.card:hover::after {
  animation: shine 1.5s ease-out;
  opacity: 1;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) rotate(45deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .carousel {
    grid-auto-columns: 100%;
    gap: 1rem;
  }
  
  .card img {
    height: 180px;
  }
  
  .carousel::scroll-button(left),
  .carousel::scroll-button(right) {
    display: none;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  .card-badge {
    font-size: 0.7rem;
    padding: 6px 50px;
  }
  
  .card-content {
    padding: 1.2rem;
  }
  
  .card h3 {
    font-size: 1.4rem;
  }
  
  .card p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .carousel {
    grid-auto-columns: 50%;
  }
  
  .card img {
    height: 220px;
  }
}

@media (min-width: 1024px) {
  .carousel {
    grid-auto-columns: 40%;
  }
  
  .card img {
    height: 250px;
  }
  
  .carousel::scroll-marker-group {
    display: flex; /* Mostrar solo en desktop */
  }
}
