/**
 * Shared Sunmaintain product card styles.
 *
 * Context-agnostic card styles used by product-grid block, product-card-showcase,
 * and any surface that renders Sunmaintain product cards.
 *
 * @package SunmaintainV2
 */

/* ── Card Container ── */
.sm-product-card {
    overflow: hidden;
    border: 1px solid #d7cfc3;
    border-radius: 8px;
    background: #ffffff;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.sm-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(5, 43, 102, 0.13);
}

/* ── Image ── */
.sm-product-card__image-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #f7f4ee;
}

.sm-product-card__image-wrap {
    position: relative;
}

.sm-product-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 220ms ease;
}

.sm-product-card:hover .sm-product-card__image {
    transform: scale(1.025);
}

/* ── Badges ── */
.sm-product-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    max-width: calc(100% - 24px);
}

.sm-product-card__badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #083d8f;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(5, 43, 102, 0.11);
}

.sm-product-card__badge.is-sale {
    background: #f4d34b;
    color: #2f2b27;
}

/* ── Body ── */
.sm-product-card__body {
    display: grid;
    gap: 0.55rem;
    padding: 1rem 1rem 1.05rem;
}

/* ── Title ── */
.sm-product-card__title {
    margin: 0;
    color: #2f2b27;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.2;
}

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

.sm-product-card__title a:hover {
    color: #083d8f;
}

/* ── Rating ── */
.sm-product-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #8b0f18;
    font-size: 0.82rem;
    font-weight: 850;
}

.sm-product-card__stars {
    letter-spacing: 1px;
}

.sm-product-card__rating-text {
    color: #6b6560;
    font-weight: 700;
}

.sm-product-card__review-count {
    font-weight: 600;
    opacity: 0.8;
}

/* ── Price ── */
.sm-product-card__price {
    color: #2f2b27;
    font-size: 0.98rem;
    font-weight: 850;
}

.sm-product-card__price del {
    color: #8a8278;
    font-weight: 650;
    opacity: 1;
}

.sm-product-card__price ins {
    color: #0b62c0;
    font-weight: 900;
    text-decoration: none;
}

/* ── Swatches ── */
.sm-product-card__swatches {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-top: 0.2rem;
}

.sm-product-card__swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    overflow: hidden;
}

.sm-product-card__swatch:hover,
.sm-product-card__swatch.is-selected {
    border-color: #083d8f;
    box-shadow: 0 0 0 2px rgba(8, 61, 143, 0.2);
}

.sm-product-card__swatch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sm-product-card__swatch-fallback {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #d9d1c5;
    border: 1px solid rgba(47, 43, 39, 0.22);
}

/* ── CTA ── */
.sm-product-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.3rem;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    background: #083d8f;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 150ms ease;
}

.sm-product-card__cta:hover {
    background: #052b66;
    color: #ffffff;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .sm-product-card__body {
        gap: 0.4rem;
        padding: 0.75rem 0.75rem 0.85rem;
    }

    .sm-product-card__title {
        font-size: 0.92rem;
    }

    .sm-product-card__swatch {
        width: 24px;
        height: 24px;
    }

    .sm-product-card__cta {
        padding: 0.45rem 1rem;
        font-size: 0.82rem;
    }
}
