/**
 * [RMP:PRODUCT] — product card placeholders hydrated client-side.
 * Mirrors the RMP listing ProductCard / ListingCard chrome (vanilla CSS).
 *
 * Theme hooks:
 *   .rmp-product-card, .rmp-product-card__shell, .rmp-product-card__image,
 *   .rmp-product-card__title, .rmp-product-card__subtitle, .rmp-product-card__summaries,
 *   .rmp-product-card__footer-label
 */

.rmp-product-card {
    --rmp-accent: hsl(49 81% 34%);
    --rmp-fg: hsl(240 10% 3.9%);
    --rmp-muted: hsl(240 3.8% 46.1%);
    --rmp-surface: hsl(0 0% 100%);
    --rmp-image-bg: hsl(240 4.8% 95.9%);
    --rmp-radius: 0.75rem;
    --rmp-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --rmp-duration: 200ms;

    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 20rem;
    min-width: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.rmp-product-card *,
.rmp-product-card *::before,
.rmp-product-card *::after {
    box-sizing: border-box;
}

.rmp-product-card--loading {
    min-height: 18rem;
}

.rmp-product-card--error {
    min-height: 0;
    padding: 0.75rem 1rem;
    border-radius: calc(var(--rmp-radius) - 2px);
    background: hsl(0 84% 97%);
    color: hsl(0 72% 35%);
    font-size: 0.875rem;
}

.rmp-product-card__shell {
    display: flex;
    min-height: 0;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--rmp-radius);
    background: var(--rmp-surface);
    text-decoration: none;
    color: inherit;
}

.rmp-product-card__shell--interactive {
    cursor: pointer;
}

.rmp-product-card__shell--interactive:focus-visible {
    outline: none;
}

.rmp-product-card__shell--interactive:hover .rmp-product-card__title,
.rmp-product-card__shell--interactive:focus-visible .rmp-product-card__title {
    color: var(--rmp-accent);
}

.rmp-product-card__image {
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    border-radius: 0.5rem;
    background: var(--rmp-image-bg);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
}

.rmp-product-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rmp-product-card__body {
    display: flex;
    margin-top: 1rem;
    min-height: 0;
    width: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.rmp-product-card__info {
    position: relative;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
    text-align: center;
}

.rmp-product-card__title {
    margin: 0.125rem 0 0;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 700;
    color: var(--rmp-fg);
    transition: color var(--rmp-duration) var(--rmp-ease);
}

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

.rmp-product-card__subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    line-height: 1.25;
    font-weight: 500;
    color: var(--rmp-muted);
}

.rmp-product-card__summaries {
    margin: 0.5rem auto 0;
    max-width: 90%;
    text-align: center;
    font-size: 0.6875rem;
    line-height: 1.625;
    font-weight: 400;
    color: var(--rmp-muted);
}

.rmp-product-card__footer {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
}

.rmp-product-card__footer-label {
    visibility: hidden;
    opacity: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rmp-accent);
    text-decoration: underline;
    transition:
        opacity 150ms var(--rmp-ease),
        visibility 150ms var(--rmp-ease);
}

@media (prefers-reduced-motion: reduce) {
    .rmp-product-card__footer-label {
        transition: none;
    }
}

.rmp-product-card__shell--interactive:hover .rmp-product-card__footer-label,
.rmp-product-card__shell--interactive:focus-visible .rmp-product-card__footer-label {
    visibility: visible;
    opacity: 1;
}
