/* =============================================
   Carousel Pro for WooCommerce — by Ferrasol SAC
   ============================================= */

.cpw-carousel-wrap {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-bottom: 40px;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.cpw-carousel-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
  padding: 0;
}
.cpw-carousel-subtitle {
  font-size: 14px;
  color: #888;
  margin: 0 0 18px;
}

/* Slider */
.cpw-slider-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Nav buttons */
.cpw-nav {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  transition: all .18s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}
.cpw-nav:hover { background: #f5f5f5; border-color: #aaa; color: #111; }
.cpw-nav:disabled { opacity: .3; cursor: not-allowed; }

/* Track */
.cpw-track-wrap {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.cpw-track {
  display: flex;
  gap: 16px;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  align-items: stretch;
}

/* ── Card — igual a la ficha de producto WooCommerce ── */
.cpw-card {
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.cpw-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
  transform: translateY(-2px);
}

.cpw-card-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* Imagen cuadrada, ocupa todo el ancho de la tarjeta */
.cpw-img-wrap {
  position: relative;
  background: #f5f5f5;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}
.cpw-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 12px;
  box-sizing: border-box;
}

/* Badges */
.cpw-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  z-index: 1;
}
.cpw-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  line-height: 1.4;
  display: inline-block;
}
.cpw-badge-pct  { color: #fff; }
.cpw-badge-topdeal { background: #1a3a6b; color: #fff; }

/* Brand */
.cpw-brand {
  border-top: 1px solid #f0f0f0;
  padding: 6px 12px;
  min-height: 34px;
  display: flex;
  align-items: center;
}
.cpw-brand img {
  max-height: 22px;
  max-width: 90px;
  object-fit: contain;
  display: block;
}
.cpw-brand-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #222;
  text-transform: uppercase;
}

/* Card body */
.cpw-card-body {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.cpw-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cpw-from {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0;
}
.cpw-price { margin: 0; }
.cpw-price .price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.cpw-price .price ins { text-decoration: none; font-weight: 700; color: #111; }
.cpw-price .price del { color: #999; font-size: .85em; }
.cpw-price .woocommerce-Price-amount { font-weight: 600; }

/* ── Botón Añadir al carrito ── */
.cpw-card-footer {
  padding: 0 14px 14px;
}
.cpw-add-cart {
  display: block;
  width: 100%;
  background: #2271b1;
  color: #fff !important;
  text-align: center;
  padding: 10px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  letter-spacing: .3px;
  text-transform: uppercase;
  transition: background .18s;
  box-sizing: border-box;
}
.cpw-add-cart:hover { background: #135e96; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .cpw-nav { width: 30px; height: 30px; font-size: 20px; }
  .cpw-track { gap: 12px; }
}
@media (max-width: 600px) {
  .cpw-carousel-title { font-size: 20px; }
  .cpw-nav { width: 28px; height: 28px; font-size: 18px; }
  .cpw-track { gap: 10px; }
}

/* ─── Móvil (≤480px): 1 tarjeta ancho completo ─── */
@media (max-width: 480px) {
  .cpw-carousel-wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .cpw-nav { display: none; }
  .cpw-track { gap: 0; }
  .cpw-card {
    border-radius: 8px;
  }
  .cpw-product-name { font-size: 16px !important; line-height: 1.45; }
  .cpw-price        { font-size: 16px !important; }
  .cpw-price .price del { font-size: 13px; }
  .cpw-from         { font-size: 12px; }
  .cpw-card-body    { padding: 14px 16px 10px; gap: 6px; }
  .cpw-card-footer  { padding: 0 16px 16px; }
  .cpw-add-cart     { font-size: 14px; padding: 12px; }
  .cpw-badge        { font-size: 12px; }
  .cpw-brand img    { max-height: 22px; }
  .cpw-carousel-wrap::after {
    content: "‹  desliza  ›";
    display: block;
    text-align: center;
    font-size: 11px;
    color: #bbb;
    letter-spacing: 2px;
    margin-top: 8px;
  }
}
