/* ===== 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;
    height: 220px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.3rem 0 0.3rem;  /* Superior mÃ­nimo, sin inferior */
}

.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: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4a5568;  /* âœ… Gris medio */
    margin: 0 0 0.75rem 0;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== STOCK Y PRECIO AL PIE ===== */
.producto-stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;    /* Espacio solo si hay contenido */
    padding-top: 0.5rem;
    border-top: 1px solid #edf2f7;
    min-height: 0;
    gap: 0.5rem;
}

/* Si no hay stock ni precio, ocultamos todo (línea + espacio) */
.producto-stock-row:empty {
    display: none;
}
.producto-stock-row.hidden {
    display: none;
}


/* Precio */
.producto-precio {
    font-weight: 700;
    color: var(--color-primario);
    font-size: 1rem;
}

.producto-precio .moneda {
    font-size: 0.7rem;
    font-weight: 400;
    color: #718096;
    margin-right: 0.2rem;
}

/* ===== COLORES DE STOCK (mantener) ===== */
.stock-disponible { color: #10b981; }
.stock-bajo { color: #f59e0b; }
.stock-agotado { color: #9ca3af; }

/* ===== 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;
    }
}

@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;
    }
}