.home-products {
    padding: 3.5rem 1rem 4rem;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.85), #f7f7f7 60%);
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.home-products__heading {
    text-align: center;
    margin-bottom: 2.5rem;
}


.home-products__title {
    font-size: 32px;
    margin: 0;
    color: #1b1b1b;
}

.home-products__grid {
    display: grid;
    gap: 2rem;
    /* Usamos auto-fill en lugar de auto-fit para que las columnas reserven el espacio
       aunque estén vacías, evitando que 1 solo producto se estire al 100% del ancho. */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.product-card__media {
    position: relative;
    background: #f7f7f7;
    text-align: center;
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

.product-card__placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    display: inline-block;
}

.product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #111;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.product-card__body {
    padding: 1.4rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card__body h3 {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.35;
    margin: 0;
    color: #1b1b1b;
    display: -webkit-box;
    text-align: center;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__separator {
    width: 100%;
    height: 1px;
    background: var(--brand-primary);
    margin: 0.5rem auto 1rem;
    border-radius: 2px;
    opacity: 0.45;
}

.product-card__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-card__price {
    flex: 0 0 auto;
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    color: var(--brand-primary);
    white-space: nowrap;
}

.product-card__actions {
    flex: 1;
    margin-left: 0;
    display: flex;
    justify-content: flex-end;
}

.product-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 130px;
    width: 100%;
    padding: 0.6rem 0.5rem;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    white-space: normal;
    line-height: 1.1;
    font-size: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card__button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.product-card--out-of-stock .product-card__button {
    background: #dedede;
    color: #555;
}

.view-cart-button {
    background: #dedede;
    color: #555;
}

@media (max-width: 720px) {
    .home-products {
        padding-top: 2.5rem;
    }

    .product-card__media {
        min-height: 190px;
    }

    .product-card__body {
        padding: 1.2rem 1.2rem 1.4rem;
    }
}