/* Product Card Component */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    transition: transform var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-2px);
}

/* Image */
.product-card__image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.product-card__link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-smooth);
}

.product-card__img--hover {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.product-card:hover .product-card__img--hover {
    opacity: 1;
}

.product-card:hover .product-card__img:not(.product-card__img--hover) {
    opacity: 0;
}

.product-card__placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: var(--font-size-overline);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

/* Badge */
.product-card__badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-overline);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    z-index: 2;
}

/* Content */
.product-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__header {
    margin-bottom: var(--space-xs);
}

.product-card__category {
    margin-bottom: var(--space-xs);
}

.product-card__category a {
    color: var(--color-secondary);
    text-decoration: none;
}

.product-card__category a:hover {
    color: var(--color-text);
}

.product-card__title {
    margin: 0;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);

    /* Single line ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.product-card__title a:hover {
    opacity: 0.8;
}

/* Price */
.product-card__price {
    margin: var(--space-xs) 0;
    font-weight: var(--font-weight-medium);
}

.product-card__price .woocommerce-Price-amount {
    font-size: var(--font-size-body);
}

.product-card__price del {
    color: var(--color-secondary);
    margin-right: var(--space-xs);
}

.product-card__price ins {
    text-decoration: none;
}

/* Actions */
.product-card__actions {
    margin-top: auto;
    padding-top: var(--space-sm);
}

.product-card__add-to-cart {
    width: 100%;
    position: relative;
}

.product-card__add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-card__add-to-cart.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: var(--space-xs);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Stock */
.product-card__stock {
    margin-top: auto;
    padding-top: var(--space-sm);
}

.product-card__out-of-stock {
    color: var(--color-secondary);
    font-size: var(--font-size-overline);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    font-weight: var(--font-weight-medium);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-card__title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}