[IMP] website_sale_aplicoop: ajustar CSS tarjeta producto — placeholder y compresión móvil

- product-img-cover: max-height → height fija para que placeholder y imagen
  real ocupen exactamente el mismo bloque (120px/90px/60px según breakpoint)
- product-img-placeholder: reemplaza SVG inline por flex centrado, más limpio
- Reducir padding/márgenes generales en card-body, title, supplier, tags y precio
- Dos breakpoints responsivos: ≤768px (tablet, imagen 90px) y ≤480px (móvil,
  imagen 60px, fuentes y márgenes mínimos)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
GitHub Copilot 2026-05-20 17:02:33 +02:00
parent a4410b9b9e
commit eb81e7db6a

View file

@ -36,13 +36,14 @@
} }
.product-img-cover { .product-img-cover {
max-height: 120px; height: 120px;
width: 100%; width: 100%;
object-fit: cover; object-fit: cover;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
box-shadow: 0 2px 8px rgba(40, 39, 39, 0.09); box-shadow: 0 2px 8px rgba(40, 39, 39, 0.09);
background: #f3f3f3; background: #f3f3f3;
display: block; display: block;
flex-shrink: 0;
} }
.product-card .card-body { .product-card .card-body {
@ -50,7 +51,7 @@
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
flex-grow: 1; flex-grow: 1;
padding: 0.6rem 0.7rem 0.7rem 0.7rem; padding: 0.4rem 0.55rem 0.5rem;
position: relative; position: relative;
background: linear-gradient(135deg, rgba(0, 123, 255, 0.07) 0%, rgba(0, 123, 255, 0.04) 100%); background: linear-gradient(135deg, rgba(0, 123, 255, 0.07) 0%, rgba(0, 123, 255, 0.04) 100%);
transition: background 0.3s; transition: background 0.3s;
@ -67,13 +68,13 @@
.product-card .card-title { .product-card .card-title {
flex-grow: 1; flex-grow: 1;
margin: 0 0 0.15rem 0; margin: 0 0 0.1rem 0;
min-height: auto; min-height: auto;
display: block; display: block;
word-wrap: break-word; word-wrap: break-word;
overflow-wrap: break-word; overflow-wrap: break-word;
font-size: 1.08rem !important; font-size: 1rem !important;
line-height: 1.1; line-height: 1.15;
text-align: center; text-align: center;
font-weight: 600; font-weight: 600;
color: #1a202c; color: #1a202c;
@ -81,9 +82,9 @@
} }
.product-card .card-text { .product-card .card-text {
margin-bottom: 0.12rem; margin-bottom: 0.08rem;
text-align: center; text-align: center;
font-size: 1rem; font-size: 0.95rem;
} }
.product-card .card-text strong { .product-card .card-text strong {
@ -97,19 +98,19 @@
text-align: center; text-align: center;
color: #4a5568; color: #4a5568;
font-weight: 400; font-weight: 400;
margin-bottom: 0.12rem; margin-bottom: 0.08rem;
font-size: 0.92rem !important; font-size: 0.85rem !important;
} }
.product-tags { .product-tags {
text-align: center; text-align: center;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.18rem; gap: 0.12rem;
justify-content: center; justify-content: center;
font-weight: 400; font-weight: 400;
font-size: 1.1rem !important; font-size: 1rem !important;
margin: 0; margin: 0 0 0.08rem 0;
padding: 0; padding: 0;
} }
@ -129,15 +130,15 @@
.card-body p.card-text { .card-body p.card-text {
text-align: center; text-align: center;
margin-bottom: 0.6rem; margin-bottom: 0.35rem;
min-height: 1.7rem; min-height: 1.5rem;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: var(--primary-color, #007bff); background-color: var(--primary-color, #007bff);
color: #fff; color: #fff;
border-radius: 0.18rem; border-radius: 0.18rem;
font-size: 1.05rem; font-size: 0.98rem;
} }
.card-body p.card-text strong { .card-body p.card-text strong {
@ -160,53 +161,73 @@
.product-img-placeholder { .product-img-placeholder {
height: 120px; height: 120px;
width: 100%; width: 100%;
object-fit: cover;
border-radius: 8px 8px 0 0; border-radius: 8px 8px 0 0;
background: #f3f3f3 background: #f3f3f3;
url('data:image/svg+xml;utf8,<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg"><rect width="100%25" height="100%25" fill="%23f3f3f3"/><text x="50%25" y="50%25" dominant-baseline="middle" text-anchor="middle" fill="%23cccccc" font-size="16">Sin imagen</text></svg>') display: flex;
no-repeat center center; align-items: center;
display: block; justify-content: center;
flex-shrink: 0;
color: #ccc;
} }
/* Responsive: mejorar altura y espaciado en móvil */ /* Responsive: tablet (≤768px) — compresión moderada */
@media (max-width: 600px) { @media (max-width: 768px) {
.product-card .product-image,
.product-img-cover,
.product-img-fixed,
.product-img-placeholder {
height: 90px;
}
.product-card .card-body {
padding: 0.35rem 0.45rem 0.4rem;
}
.card-body p.card-text {
margin-bottom: 0.25rem;
min-height: 1.4rem;
}
}
/* Responsive: móvil (≤480px) — compresión máxima */
@media (max-width: 480px) {
.product-card { .product-card {
padding: 0.25rem; padding: 0.15rem;
border-radius: 8px; border-radius: 6px;
} }
.product-card .product-image, .product-card .product-image,
.product-img-cover, .product-img-cover,
.product-img-fixed, .product-img-fixed,
.product-img-placeholder { .product-img-placeholder {
height: 70px; height: 60px;
max-height: 70px; border-radius: 5px 5px 0 0;
min-height: 70px;
border-radius: 6px 6px 0 0;
} }
.product-card .card-body { .product-card .card-body {
padding: 0.4rem 0.4rem 0.5rem 0.4rem; padding: 0.25rem 0.3rem 0.3rem;
} }
.product-card .card-title { .product-card .card-title {
font-size: 0.98rem !important; font-size: 0.82rem !important;
margin-bottom: 0.08rem; line-height: 1.15;
margin-bottom: 0.05rem;
} }
.product-card .card-text { .product-card .card-text {
font-size: 0.92rem; font-size: 0.8rem;
} }
.badge-km { .badge-km {
font-size: 0.58rem !important; font-size: 0.55rem !important;
padding: 0.13rem 0.22rem !important; padding: 0.1rem 0.18rem !important;
} }
.product-tags { .product-tags {
font-size: 0.95rem !important; font-size: 0.82rem !important;
gap: 0.08rem;
margin-bottom: 0.05rem;
} }
.card-body p.card-text { .card-body p.card-text {
min-height: 1.1rem; min-height: 1rem;
font-size: 0.95rem; font-size: 0.85rem;
margin-bottom: 0.3rem; margin-bottom: 0.2rem;
} }
.product-card .product-supplier { .product-card .product-supplier {
font-size: 0.82rem !important; font-size: 0.72rem !important;
margin-bottom: 0.05rem;
} }
} }