/**
 * Featured products carousel — home
 */

.section-featured-products {
  padding: clamp(2.5rem, 5vw, 3.75rem) 0;
  background: #ffffff;
}

.section-featured-products .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-header-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.35rem;
}

.section-featured-products .kicker {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dc2626;
}

.section-featured-products .section-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
}

.btn-carousel-prev,
.btn-carousel-next {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-carousel-prev:hover,
.btn-carousel-next:hover,
.btn-carousel-prev:focus-visible,
.btn-carousel-next:focus-visible {
  border-color: #dc2626;
  color: #dc2626;
  outline: none;
}

.btn-carousel-prev:disabled,
.btn-carousel-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.products-carousel-wrapper {
  /* Base del ancho visible del carrusel (no del track max-content) */
  --featured-card-basis: calc((100cqw - 40px) / 3); /* 3 tarjetas escritorio */
  container-type: inline-size;
  container-name: featured-carousel;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 10px 0 20px 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

/* Ocultar barra de scroll estética */
.products-carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.products-carousel-track {
  display: flex;
  gap: 20px;
  width: max-content;
  min-width: 100%;
  align-items: stretch;
}

/* Tamaño de las tarjetas en el carrusel */
.products-carousel-track .product-card {
  flex: 0 0 var(--featured-card-basis);
  width: var(--featured-card-basis);
  max-width: none;
  box-sizing: border-box;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  height: auto;
}

/* Adaptación Responsive */
@media (max-width: 992px) {
  .products-carousel-wrapper {
    --featured-card-basis: calc((100cqw - 20px) / 2); /* 2 tarjetas en tablet */
  }
}

@media (max-width: 576px) {
  .products-carousel-wrapper {
    --featured-card-basis: 85cqw; /* 1 tarjeta + pista de la siguiente en móvil */
  }
}

/* Mantener alineación de botones al fondo */
.products-carousel-track .product-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.products-carousel-track .product-card-actions,
.products-carousel-track .btn-cotizar {
  margin-top: auto;
  width: 100%;
}

.featured-products-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  .products-carousel-wrapper {
    scroll-behavior: auto;
  }
}
