/* ===== CARDS DE PRODUCTOS ===== */

.producto-card {
    background: white;
    border: 1px solid #cccccc;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    border-color: #cccccc;
}

.producto-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===== IMAGEN ===== */
.producto-imagen {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.3rem 0 0.3rem;
}

.producto-imagen img {
    max-width: 100%;
    max-height: 95%;
    object-fit: contain;
    mix-blend-mode: multiply;
}


.lazy-img {
    opacity: 1;
}

/* ===== MARCA (izquierda) ===== */
.marca-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 60px;  /* ðŸ”µ Agrandado */
    height: 28px;
    background: rgba(255, 255, 255, 0.75);  /* âœ… Efecto glass */
    backdrop-filter: blur(2px);
    border-radius: 4px;
    padding: 0rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marca-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;  /* âœ… Elimina fondo blanco */
    opacity: 0.85;  /* âœ… 15% de transparencia */
}

/* ===== SKU (derecha) ===== */
.modelo-badge {
    position: absolute;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--color-primario);  /* Fondo color primario */
    color: white;  /* Texto blanco */
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.1rem 0.65rem;
    border-radius: 4px;  /* Misma forma que marca-badge */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0.95;
    backdrop-filter: none;  /* Sacamos el blur */
}

/* ===== INFO ===== */
.producto-info {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-info h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PRECIO + BOTÓN ===== */
.producto-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
}

.producto-price-row > div {
    flex: 1;
}

.precio-contenedor {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.precio-linea {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.precio-moneda {
    font-size: 0.89rem;
    font-weight: 400;
    color: #94a3b8;
}

.precio-valor {
    font-weight: 700;
    color: var(--color-primario);
    font-size: 1.05rem;
}

.precio-iva {
    font-size: 0.65rem;
    font-weight: 400;
    color: #94a3b8;
}

.precio-impuesto-interno {
    font-size: 0.65rem;
    font-weight: 400;
    color: #94a3b8;
}

.btn-agregar-carrito-icono {
    flex-shrink: 0;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    background: var(--color-primario);
    color: white;
    border: none;
    font-size: 0.7rem;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-agregar-carrito-icono:hover {
    background: #b71010;
}

.btn-agregar-carrito-icono:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-agregar-carrito-icono:disabled:hover {
    background: #d1d5db;
}

.btn-agregar-carrito-icono.en-carrito {
    background: #10b981;
}


/* Stock badge en overlay */
.stock-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: #10b981;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .marca-badge {
        width: 50px;
        height: 30px;
    }

    .modelo-badge {
        font-size: 0.7rem;
    }

    .producto-info h4 {
        font-size: 0.85rem;
    }

    .producto-precio {
        font-size: 0.9rem;
    }

    .btn-agregar-carrito-icono {
        font-size: 0;
        padding: 0.4rem;
    }

    .btn-agregar-carrito-icono svg {
        margin-right: 0 !important;
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .marca-badge {
        width: 45px;
        height: 28px;
    }

    .modelo-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
    }

    .producto-stock-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* ===== FADE-IN AL HACER SCROLL ===== */
.producto-card.card-oculta {
    opacity: 0;
    transform: translateY(14px);
    transition: none;
}
.producto-card.card-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
@media (prefers-reduced-motion: reduce) {
    .producto-card.card-oculta { opacity: 1; transform: none; }
    .producto-card.card-visible { transition: none; }
}