/* ================= Card ================= */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.10);
    overflow: hidden;
    max-height: min-content;
    transition: transform .18s ease, box-shadow .18s ease;
}
.recommended-card{
    min-height: min-content !important;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 5px rgba(0, 0, 0, .10)
}

.product-media {
    position: relative;
    aspect-ratio: 16/15;
    background: #f4f4f5;
    overflow: hidden;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spec-batch {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 10px;
    justify-content: end;
    width: 100%;
    align-items: end;
    padding: 10px;
}

/* Badges on image */
.badge-discount {
    width: max-content;
    text-align: center;
    background: #FFC2C2;
    border: 1px solid #FF0000;
    color: #FF0000;
    font-weight: 700;
    font-size: .82rem;
    border-radius: 10px;
    padding: 4px 8px;
    margin-bottom: 10px;
}


.badge-sold {
    height: 75px;
    width: 75px;
    text-align: center;
    background: #E85900;
    border: 3px solid rgba(255, 219, 197, 0.72);
    color: #ffffff;
    font-weight: 500;
    font-size: .75rem;
    border-radius: 999px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

}

.margin-remove {
    margin-top: -5px;
}

.badge-sold .fa-fire-flame-curved {
    margin-top: 3px;
    font-size: 1.3em;
}

/* Body */
.product-body {
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-title {
    font-size: .9rem;
    line-height: 1.25rem;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    min-height: calc(2 * 1.25rem);
    max-height: calc(2 * 1.25rem);

    padding-bottom: 2px;

}

.product-by {
    min-height: 22px;
    font-size: .8rem;
    color: #6b7280;
}

.product-by strong {
    color: #111827;
}

/* Meta row (rating + sold pill) */
.meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.rating {
    font-size: .88rem;
    color: #f59e0b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rating span {
    color: #4b5563;
}

.meta-pill {
    font-size: .78rem;
    color: #389721;
    /*background: #d1f7df;*/
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* Divider like the screenshot */
.product-body hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.46);
    margin: 2px 0 2px
}

/* Footer (price + button) */
.product-footer {
    display: flex;
    flex-direction: column;
}

.lbl-discount {
    text-decoration: line-through;
    color: #8e8e8e;
}

.price {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
}

.btn-buy {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: .88rem;
    text-decoration: none;
    font-weight: 600;
}

.btn-addToCart {
    display: inline-block;
    background: #fff;
    color: #16a34a;
    border: 1px solid #16a34a;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: .88rem;
    text-decoration: none;
    font-weight: 600;
}

/* ================= Responsiveness tweaks ================= */
@media (max-width: 425px) {
    .product-title {
        margin-bottom: 0 !important;
    }

    .product-body {
        padding: 12px 5px 14px;
    }

    .meta {
        flex-direction: row;
    }

    .rating {
        font-size: .68rem;
    }

    .meta-pill {
        font-size: .68rem;
    }

    .more-link {
        font-size: 12px;
    }
}


@media (max-width: 320px) {
    .meta {
        flex-direction: column;
        align-items: start;
        justify-content: start;
    }
}

@media (max-width: 375px) {
    .more-link {
        font-size: 10px;
    }
}

@media (max-width: 991.98px) {
    .product-title {
        font-size: .98rem;
    }
}

@media (max-width: 575.98px) {
    .product-title {
        font-size: .95rem;
        line-height: 1.2rem;
        min-height: calc(2 * 1.2rem);
        max-height: calc(2 * 1.2rem);
    }

    .meta {
        min-height: 24px;
    }
}

/* Optional: subtle focus outlines for a11y when cards get focus */
.product-card:focus-within,
.product-card:focus {
    outline: 2px solid #c7f0d5;
    outline-offset: 2px;
}