:root {
  --carousel-gap: 24px;
  --cards-per-view: 3;
}

/* ======================
   Contenedor general
   ====================== */
.cards-carousel {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.cards-viewport {
  overflow: hidden;
  width: 100%;
  padding: 20px 10px;
}

.cards-track {
  display: flex;
  gap: var(--carousel-gap);
  transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

/* ======================
   Botones prev / next
   ====================== */
.carousel-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d8dce3;
  background: #ffffff;
  color: #1f2430;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 20, 30, 0.08);
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  z-index: 2;
}

.carousel-btn:hover:not(:disabled) {
  background: #f0f2f6;
}

.carousel-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.carousel-btn:focus-visible {
  outline: 2px solid #4a7dff;
  outline-offset: 2px;
}

/* ======================
   Card dentro del carrusel:
   ancho calculado para que entren --cards-per-view por vista
   ====================== */
.cards-simple-container {
  flex: 0 0 auto;
  width: calc((100% - (var(--cards-per-view) - 1) * var(--carousel-gap)) / var(--cards-per-view));
}

/* ======================
   Mobile: sin carrusel, cards apiladas a ancho completo
   ====================== */
@media (max-width: 768px) {
  .cards-carousel {
    padding: 0 16px;
    gap: 0;
  }

  .carousel-btn {
    display: none;
  }

  .cards-viewport {
    overflow: visible;
  }

  .cards-track {
    flex-direction: column;
    gap: 20px;
    transform: none !important;
  }

  .cards-simple-container {
    width: 100%;
  }
}