@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* Estilos para las nuevas tarjetas de productos */
.contenedorCards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.product-card {
  width: 100%;
  height: auto;
  min-height: 220px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  /* REMOVED: box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); */
  transition: all 0.3s ease;
  margin: 0;
  background-color: #fff;
  perspective: 1000px;
}

/* Ancho mayor dentro de los sliders de la home sin afectar el catálogo */
.splide .product-card {
  width: 100%;
  margin: 0;
}

.product-card:hover {
  transform: translateY(-5px) perspective(800px);
  /* REMOVED: box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2); */
}

.product-card .wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card .colorProd {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 180px;
  /* igual que la imagen */
  background-color: #ffffff;
  z-index: 0;
  /* fondo detrás de todo */
}

.product-card .imgProd {
  position: relative;
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 5;
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
  margin-top: 0;
  perspective: 1000px;
  will-change: transform;
}

.product-card .imgProd:hover {
  /* REMOVED: filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); */
}

/* Asegurar dimensiones uniformes para todas las imágenes */
.product-card .imgProd img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.product-card .infoProd {
  position: relative;
  left: 0;
  width: 100%;
  padding: 10px;
  background: #fff;
  text-align: center;
  font-family: 'Roboto', Arial, sans-serif;
  color: #2f2f2f;
  transition: all 0.3s ease;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
  /* por encima del fondo, por debajo de la imagen */
}

/* sin superposición, no desplazamos el bloque de info en hover */

.product-card .infoProd .nombreProd {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0px;
  color: #2f2f2f;
  text-align: center;
  text-transform: none;
}

.product-card .infoProd .extraInfo {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 15px;
}

.product-card .infoProd .actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2px;
}

/* swatches de color debajo de la imagen */
.product-card .infoProd .swatches {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin: 6px 0 4px;
}

.product-card .infoProd .swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ddd;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card .infoProd .swatch:hover {
  transform: scale(1.05);
  border-color: #999;
}

.product-card .infoProd .swatch.active {
  border-color: #333;
}

.product-card .infoProd .actions .preciosGrupo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-card .infoProd .actions .preciosGrupo .precio {
  margin: 0;
  font-weight: 700;
}

.product-card .infoProd .actions .preciosGrupo .precioOferta {
  color: #5e5e5e;
  font-size: 1.2rem;
  font-weight: bold;
}

.product-card .infoProd .actions .preciosGrupo .precioProd {
  color: #d19b9b;
  text-decoration: line-through;
  font-size: 0.9rem;
}

.product-card .infoProd .actions .preciosGrupo .precioProd:only-child {
  color: #333;
  text-decoration: none;
  font-size: 1.2rem;
}

.product-card .infoProd .actions .icono {
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-card .infoProd .actions .icono:hover {
  transform: scale(1.2);
}

.product-card .infoProd .actions .icono svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #333;
  stroke-width: 2px;
  transition: all 0.3s ease;
}

.product-card .infoProd .actions .alCarrito.added svg {
  stroke: #00a65a;
  fill: none;
}

.product-card .aFavs {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* badge descuento */
.product-card .badge-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background-color: #ffc107;
  color: #333;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.product-card .badge-new {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background-color: #ffc107;
  color: #333;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
}

.product-card .badge-offer {
  position: absolute;
  top: 12px;
  left: 98px;
  z-index: 10;
  background-color: #dc3545;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
}

.product-card .aFavs svg {
  width: 100%;
  height: 100%;
  fill: transparent;
  stroke: #333;
  stroke-width: 2px;
  transition: all 0.3s ease;
}

.product-card .aFavs:hover svg {
  stroke: #e93f3f;
  transform: scale(1.1);
}

.product-card .aFavs.active svg {
  fill: #e93f3f;
  stroke: #e93f3f;
}

.product-card .infoProd .actions .alCarrito .inCart {
  display: none;
}

.product-card .infoProd .actions .alCarrito .outCart {
  display: block;
}

.product-card .infoProd .actions .alCarrito.added .inCart {
  display: block;
}

.product-card .infoProd .actions .alCarrito.added .outCart {
  display: none;
}

.badge-new,
.badge-stock {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-new {
  background-color: #ffc107;
  color: #333;
}

.badge-stock {
  background-color: #dc3545;
  color: #fff;
}

/* Ajustes para el slider */
.splide__slide {
  display: flex;
  justify-content: center;
}

.product-flags {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.product-flags .flag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
}

.product-flags .flag-new {
  background-color: #ffc107;
  color: #333;
}

.product-flags .flag-offer {
  background-color: #dc3545;
  color: #fff;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablets and smaller (< 768px) */
@media (max-width: 767px) {
  .product-card {
    min-height: 280px;
    margin-bottom: 15px;
  }

  .product-card .colorProd {
    height: 220px;
  }

  .product-card .imgProd {
    height: 220px;
  }

  .product-card .imgProd img {
    height: 220px;
  }

  .product-card .infoProd {
    padding: 15px 12px;
    min-height: 80px;
  }

  .product-card .infoProd .nombreProd {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.3;
  }

  .product-card .infoProd .extraInfo {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  .product-card .infoProd .swatches {
    gap: 6px;
    margin: 8px 0 6px;
  }

  .product-card .infoProd .swatch {
    width: 18px;
    height: 18px;
  }

  .product-card .infoProd .actions {
    margin-top: 8px;
  }

  .product-card .infoProd .actions .preciosGrupo .precioOferta {
    font-size: 1.3rem;
  }

  .product-card .infoProd .actions .preciosGrupo .precioProd {
    font-size: 1rem;
  }

  .product-card .infoProd .actions .preciosGrupo .precioProd:only-child {
    font-size: 1.3rem;
  }

  .product-card .infoProd .actions .icono {
    width: 35px;
    height: 35px;
  }

  .product-card .aFavs {
    width: 35px;
    height: 35px;
    top: 12px;
    right: 12px;
  }

  .product-card .badge-discount,
  .product-card .badge-new,
  .product-card .badge-offer {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .product-flags .flag {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
}

/* Small mobile devices (< 576px) */
@media (max-width: 575px) {
  .product-card {
    min-height: 320px;
    margin-bottom: 20px;
  }

  .product-card .colorProd {
    height: 240px;
  }

  .product-card .imgProd {
    height: 240px;
  }

  .product-card .imgProd img {
    height: 240px;
  }

  .product-card .infoProd {
    padding: 18px 15px;
    min-height: 90px;
  }

  .product-card .infoProd .nombreProd {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .product-card .infoProd .extraInfo {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  .product-card .infoProd .swatches {
    gap: 8px;
    margin: 10px 0 8px;
  }

  .product-card .infoProd .swatch {
    width: 20px;
    height: 20px;
  }

  .product-card .infoProd .actions {
    margin-top: 10px;
  }

  .product-card .infoProd .actions .preciosGrupo .precioOferta {
    font-size: 1.4rem;
  }

  .product-card .infoProd .actions .preciosGrupo .precioProd {
    font-size: 1.05rem;
  }

  .product-card .infoProd .actions .preciosGrupo .precioProd:only-child {
    font-size: 1.4rem;
  }

  .product-card .infoProd .actions .icono {
    width: 40px;
    height: 40px;
  }

  .product-card .aFavs {
    width: 40px;
    height: 40px;
    top: 15px;
    right: 15px;
  }

  .product-card .badge-discount,
  .product-card .badge-new,
  .product-card .badge-offer {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .product-flags .flag {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  /* Ensure proper spacing in grid on mobile */
  .splide .product-card {
    margin: 0 auto;
  }
}