/* carousel.css v2.0 — Estilos reconstruidos para carrusel infinito */

/* ========== CARRUSEL INFINITO ========== */
.ci-carousel {
  position: relative;
  max-width: 1400px;  /* Ancho máximo del carrusel */
  width: 100%;
  margin: 48px auto;  /* Centrado horizontal con margen auto */
  overflow: visible; /* deja asomar flechas; cards se contienen en viewport interno */
  background: #fff;
  padding: 15px 15px;  /* espacio lateral extra para alojar botones sin cortarlos */
}

.ci-viewport {
  position: relative;
  overflow: hidden; /* limita las cards */
  width: 100%;
  height: 590px;
  padding: 10px 0px 0px 0px;
}

.ci-carousel::before,
.ci-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  pointer-events: none;
  z-index: 5;
}

.ci-carousel::before {
  left: 0;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.ci-carousel::after {
  right: 0;
  background: linear-gradient(270deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

@media (max-width: 768px) {
  .ci-carousel {
    padding: 32px 20px;
  }
}

.ci-track {
  display: flex !important;
  gap: 28px !important;
  flex-wrap: nowrap !important;
  will-change: transform;
  animation: none; /* Resetear cualquier animación previa */
}

@keyframes carousel-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ci-slide {
  flex: 0 0 380px;
  width: 380px;
  min-width: 380px;
  max-width: 380px;
  transition: transform 0.3s ease;
}

.ci-slide:hover {
  transform: scale(1.02);
}

/* Botones de control */
.ci-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.ci-carousel__btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.ci-carousel__btn--prev {
  left: 16px;
  transform: translate(-85%, -50%); /* se asoma más gracias al overflow visible del contenedor */
}

.ci-carousel__btn--prev:hover {
  transform: translate(-85%, -50%) scale(1.1);
}

.ci-carousel__btn--next {
  right: 16px;
  transform: translate(85%, -50%);
}

.ci-carousel__btn--next:hover {
  transform: translate(85%, -50%) scale(1.1);
}

@media (max-width: 768px) {
  .ci-carousel__btn--prev {
    left: 8px;
    transform: translateY(-50%);
  }
  .ci-carousel__btn--next {
    right: 8px;
    transform: translateY(-50%);
  }
}

/* ========== TARJETAS DE PRODUCTO ========== */
.carousel-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 25px 60px rgba(16,15,20,0.18);
  transition: transform .32s cubic-bezier(.4,.2,.2,1), box-shadow .32s;
  will-change: transform;
  cursor: pointer;
}

.carousel-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 30px 70px -14px rgba(0,0,0,.3);
}

.carousel-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
}

.carousel-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-card__body {
  padding: 18px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
}

.carousel-card__eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: .12em;
  color: #9a97a7;
  font-weight: 700;
}

.carousel-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f1f29;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.9em;
}

.carousel-card__price {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #5c5a66;
}

.carousel-card__price-stack{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.carousel-card__footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.carousel-card__favorites {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #5a556a;
  font-size: 0.85rem;
}

.carousel-card__favorites svg path {
  fill: #f8b4d9;
}

.carousel-card__favorites-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #b3adbf;
}

.carousel-card__cta {
  font-weight: 700;
  color: #cc0066;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.carousel-card__cta::after {
  content: "↗";
  font-size: 1rem;
}

/* Botón de favoritos */
.carousel-fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s;
  cursor: pointer;
}

.carousel-fav-btn:hover {
  transform: scale(1.12);
}

.carousel-fav-btn[aria-pressed="true"] .carousel-like-icon path {
  fill: #cc0066;
}

.carousel-fav-btn[aria-pressed="false"] .carousel-like-icon path {
  fill: #e2e8f0;
}

.carousel-like-icon path {
  transition: fill .2s;
}

/* Utilidades */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .ci-slide {
    flex: 0 0 300px;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
  }
  
  .ci-carousel__btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .carousel-card__body {
    padding: 16px;
  }
}
