/* ═══════════════════════════════════════════════════════════
   420Crea LTDLF Product Carousel — Styles v1.0.1
   ═══════════════════════════════════════════════════════════ */

/* ── Swiper CSS crítico (fallback por si CDN tarda) ──────── */
.swiper { overflow: hidden; }
.swiper-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  box-sizing: content-box;
  width: 100%;
  height: 100%;
  position: relative;
  transition-property: transform;
  will-change: transform;
}
.swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
}
.swiper-button-disabled { opacity: 0.35 !important; pointer-events: none; }
.swiper-pagination-bullet {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ccc;
  opacity: 1;
  cursor: pointer;
}
.swiper-pagination-bullet-active { background: #2A7F62; }

/* ── Wrapper general ──────────────────────────────────────── */
.c420-carousel-wrapper {
  position: relative;
  width: 100%;
}

/* ── Cabecera ─────────────────────────────────────────────── */
.c420-carousel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.c420-carousel__header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.c420-carousel__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #1a3a2e;
}

.c420-carousel__subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.c420-carousel__view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #2A7F62;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease, gap 0.2s ease;
  flex-shrink: 0;
}
.c420-carousel__view-all:hover {
  border-color: #2A7F62;
  gap: 10px;
}

/* ── Swiper outer (contiene flechas + swiper) ─────────────── */
.c420-swiper-outer {
  position: relative;
  padding: 0 52px;
}

@media (max-width: 600px) {
  .c420-swiper-outer {
    padding: 0 0 0 0;
  }
}

/* ── Swiper overrides ─────────────────────────────────────── */
.c420-swiper {
  overflow: hidden;
  padding-bottom: 6px; /* espacio para sombras de card */
}

.c420-swiper .swiper-wrapper {
  align-items: stretch;
}

.c420-swiper .swiper-slide {
  height: auto;
}

/* ── CARD ─────────────────────────────────────────────────── */
.c420-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.c420-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(42,127,98,0.14);
}

/* Sin stock */
.c420-product-card.c420-out-of-stock {
  opacity: 0.7;
}

/* ── Imagen ───────────────────────────────────────────────── */
.c420-product-card__img-wrap {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f8fafc;
  aspect-ratio: 1/1; /* overridden inline */
  flex-shrink: 0;
}

.c420-product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
  display: block;
}
.c420-product-card:hover .c420-product-card__img {
  transform: scale(1.05);
}

/* ── Badge ────────────────────────────────────────────────── */
.c420-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #2A7F62;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: 0.2px;
}
.c420-badge--oos {
  background: #94a3b8;
  left: auto;
  right: 12px;
}

/* ── Body ─────────────────────────────────────────────────── */
.c420-product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 16px;
  gap: 6px;
}

/* Categoría */
.c420-product-card__category,
.c420-product-card__cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #2A7F62;
  text-decoration: none;
}
.c420-product-card__category a {
  color: inherit;
  text-decoration: none;
}

/* Nombre */
.c420-product-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: #1a3a2e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.c420-product-card__name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.c420-product-card__name a:hover {
  color: #2A7F62;
}

/* Rating */
.c420-product-card__rating {
  min-height: 18px;
}
.c420-product-card__rating .star-rating {
  font-size: 13px;
  float: none;
  display: inline-flex;
}

/* Precio */
.c420-product-card__price {
  margin-top: auto;
  padding-top: 4px;
}
.c420-product-card__price .price {
  font-size: 17px;
  font-weight: 700;
  color: #2A7F62;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.c420-product-card__price ins {
  text-decoration: none;
}
.c420-product-card__price ins .amount {
  color: #2A7F62;
  font-weight: 700;
  font-size: 17px;
}
.c420-product-card__price del .amount {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 400;
}

/* ── Botón añadir al carrito ──────────────────────────────── */
.c420-atc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px 16px;
  margin-top: 10px;
  background: #2A7F62;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 3px 12px rgba(42,127,98,0.25);
  letter-spacing: 0.2px;
  line-height: 1;
}
.c420-atc-btn:hover {
  background: #1a3a2e;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(42,127,98,0.35);
  color: #fff;
}
.c420-atc-btn:active {
  transform: translateY(0);
}

/* Estado cargando */
.c420-atc-btn.c420-loading {
  opacity: 0.75;
  pointer-events: none;
}
.c420-atc-btn.c420-loading .c420-atc-label::after {
  content: '…';
}

/* Estado añadido */
.c420-atc-btn.c420-added {
  background: #1a3a2e;
}

/* Variable / sin stock */
.c420-atc-btn--variable,
.c420-atc-btn--oos {
  background: #f1f5f9;
  color: #475569;
  box-shadow: none;
}
.c420-atc-btn--variable:hover,
.c420-atc-btn--oos:hover {
  background: #e2e8f0;
  color: #1e293b;
  box-shadow: none;
}

.c420-atc-icon {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

/* ── Flechas de navegación ────────────────────────────────── */
.c420-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  color: #2A7F62;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
  padding: 0;
  flex-shrink: 0;
}
.c420-arrow:hover {
  background: #2A7F62;
  color: #fff;
  box-shadow: 0 6px 24px rgba(42,127,98,0.30);
}
.c420-arrow.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.c420-arrow-prev { left: 0; }
.c420-arrow-next { right: 0; }

@media (max-width: 600px) {
  .c420-arrow {
    display: none;
  }
  .c420-swiper-outer {
    padding: 0;
  }
}

/* ── Dots de paginación ───────────────────────────────────── */
.c420-carousel-wrapper .swiper-pagination {
  position: relative;
  bottom: auto;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.c420-carousel-wrapper .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  opacity: 1;
  transition: background 0.2s, width 0.2s;
  cursor: pointer;
}

.c420-carousel-wrapper .swiper-pagination-bullet-active {
  background: #2A7F62;
  width: 24px;
  border-radius: 4px;
}

/* ── Toast "Añadido al carrito" ───────────────────────────── */
.c420-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a3a2e;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  pointer-events: none;
}
.c420-toast.c420-toast--show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.c420-toast a {
  color: #6EE7B7;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
