.product-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: #fff;
    transition: border-color 0.18s ease;
}

.product-card:hover,
.product-card:focus-within {
    border-color: var(--border-strong);
}

.product-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
    contain: paint;
}

.product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.product-card:hover .product-card__media img {
    transform: scale(1.03);
}

.product-card__badges,
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.product-card__badges {
    position: absolute;
    inset: 0.55rem 0.55rem auto;
    pointer-events: none;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.product-badge.sale {
    background: #dc2626;
}

.product-badge.recommended {
    background: #0f766e;
}

.product-badge.featured {
    background: var(--accent-strong);
}

.product-card__body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    padding: 0.9rem;
}

.product-card__title {
    display: -webkit-box;
    margin: 0 0 0.45rem;
    overflow: hidden;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card__title a {
    color: inherit;
    text-decoration: none;
}

.product-card__desc {
    display: -webkit-box;
    margin: 0 0 0.75rem;
    overflow: hidden;
    color: var(--text-light);
    font-size: 0.82rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.product-price__current {
    color: var(--accent-strong);
    font-size: 1.16rem;
    font-weight: 800;
    line-height: 1.2;
}

.product-price__compare {
    color: var(--text-light);
    font-size: 0.82rem;
    text-decoration: line-through;
}

.stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: auto 0 0.85rem;
}

.stockBadge {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.stockBadge.in-stock {
    background: #ecfdf5;
    color: #047857;
}

.stockBadge.low-stock {
    background: #fffbeb;
    color: #b45309;
}

.stockBadge.sold-out {
    background: #f1f5f9;
    color: #64748b;
}

.stockBadge.pending {
    background: #eff6ff;
    color: #1d4ed8;
}

.product-card .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
}

@media (max-width: 540px) {
    .product-card--standard {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .product-card--standard .product-card__media {
        aspect-ratio: auto;
        min-height: 166px;
    }

    .product-card--standard .product-card__badges .product-badge:not(:first-child) {
        display: none;
    }

    .product-card--standard .product-card__desc {
        display: none;
    }

    .product-card--standard .product-card__title {
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }

    .product-card--standard .product-price {
        margin-bottom: 0.3rem;
    }

    .product-card--standard .stock-row {
        margin-bottom: 0.4rem;
    }

    .product-card--standard .btn {
        min-height: 44px;
    }
}

@media (max-width: 420px) {
    .product-card__body {
        padding: 0.8rem;
    }

    .product-card--compact .product-card__body {
        padding: 0.65rem;
    }

    .product-card--compact .product-card__title {
        font-size: 0.85rem;
    }

    .product-card--compact .product-card__desc {
        display: none;
    }

    .product-card--compact .product-price__current {
        font-size: 1rem;
    }

    .product-card--compact .product-badge {
        padding: 0.16rem 0.45rem;
        font-size: 0.64rem;
    }

    .product-card--compact .stockBadge {
        padding: 0.2rem 0.48rem;
        font-size: 0.68rem;
    }

    .product-card--compact .btn {
        min-height: 44px;
        padding-inline: 0.45rem;
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card__media img {
        transition: none;
    }
}
