/* =========================================================
   TARJETA DE PRODUCTO (DISEÑO LIMPIO + HOVER UNIFICADO)
   ========================================================= */

/* 1. BASE DE LA TARJETA */
ul.products li.product.product-card {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100% !important;
    float: none !important;
    display: block !important;
    box-sizing: border-box;
    /* Opcional: Añadir una transición sutil al borde o sombra de toda la tarjeta */
    transition: box-shadow 0.3s ease;
}

/* El enlace ocupa todo el ancho */
.product-card .card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative; /* Necesario para el contexto de apilamiento */
}

/* =========================================================
   2. MEDIA (IMÁGENES + EFECTO HOVER UNIFICADO)
   ========================================================= */
.product-card .card-media {
    position: relative;
    overflow: hidden; /* CLAVE: Mantiene la imagen dentro de los bordes al hacer zoom */
    aspect-ratio: 1 / 1;
    background: #f4f4f4;
    border-radius: 8px;
    margin-bottom: 12px;
    /* Arreglo para Safari para que respete el border-radius con overflow hidden */
    transform: translateZ(0); 
}

/* ESTILO BASE PARA AMBAS IMÁGENES (Principal y Hover) */
.product-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* CLAVE: Transición suave para transformación (zoom) y opacidad en AMBAS */
    /* Usamos un cubic-bezier para que el "arranque" y "frenado" del zoom se sienta premium */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    transform-origin: center center;
    backface-visibility: hidden; /* Mejora rendimiento de animación */
}

/* Imagen secundaria (Hover) - oculta por defecto */
.product-card .img-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 2; /* Asegura que quede arriba de la principal */
}

/* ====== EFECTO HOVER UNIFICADO (AL PASAR POR CUALQUIER PARTE DE LA CARD) ====== */

/* 1. EFECTO ZOOM: Se aplica a TODAS las imágenes dentro de media cuando se hace hover en la CARD */
.product-card:hover .card-media img {
    transform: scale(1.08); /* Un zoom sutil pero notorio */
}

/* 2. CAMBIO DE IMAGEN: Se muestra la segunda imagen cuando se hace hover en la CARD */
.product-card:hover .img-hover {
    opacity: 1;
}


/* =========================================================
   3. CUERPO DE TEXTO (FLEXBOX)
   ========================================================= */
.product-card .card-body {
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Título */
.woocommerce-loop-product__title {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 4px 0;
    color: #333;
    text-transform: capitalize;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

/* PRECIO ORIGINAL (El Grande) */
.product-card .price {
    font-family: 'Arial', sans-serif;
    font-weight: 800 !important;
    font-size: 20px !important;
    color: #000 !important;
    line-height: 1;
    margin: 4px 0;
    display: block !important;
}

.product-card .price del {
    display: block;
    color: #999;
    font-weight: 400;
    font-size: 12px;
    margin-bottom: 2px;
}

.product-card .price ins {
    text-decoration: none;
    color: #000;
}

/* PRECIO TRANSFERENCIA (El Chico) */
.samom-transfer-promo {
    display: block;
    margin-top: 2px;
    line-height: 1.3;
}

.samom-transfer-promo .promo-tag,
.samom-transfer-promo .promo-final {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
}

/* Cartel de Agotado */
.stock.out-of-stock {
    color: #d32f2f;
    font-weight: 700;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

/* =========================================================
   4. SWATCHES (COLORES ABAJO)
   ========================================================= */
.product-card .card-swatches {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    /* Importante: que los swatches queden arriba del link de la card para poder clickearlos */
    position: relative; 
    z-index: 5;
    pointer-events: all; /* Asegura que reciban clicks */
}

.product-card .swatch-count {
    font-size: 11px;
    color: #888;
    margin-right: 4px;
}

.product-card .swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    padding: 1px;
    background: #fff;
    cursor: pointer;
    line-height: 0;
    transition: all 0.2s ease; /* Transición rápida para el swatch */
}

.product-card .swatch:hover,
.product-card .swatch.is-current {
    border-color: #000;
    transform: translateY(-2px); /* Pequeño saltito al pasar por el color */
}

.product-card .swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.product-card .swatch.is-oos {
    opacity: 0.4;
    filter: grayscale(1);
}

/* =========================================================
   5. AJUSTES MOBILE
   ========================================================= */
@media (max-width: 600px) {
    .product-card .price {
        font-size: 18px !important; 
    }
    .woocommerce-loop-product__title {
        font-size: 13px;
        min-height: auto;
    }
    .samom-transfer-promo .promo-tag, 
    .samom-transfer-promo .promo-final {
        font-size: 11px;
    }
    .product-card .swatch {
        width: 32px;
        height: 32px;
    }
}