/* ==========================================================================
   SHARED PRODUCT CARD — Bonebana
   Used by: Sale, Shop, Collections, Home grid sections
   Class prefix: .bb-product-card
   ========================================================================== */

/* ── Card wrapper ── */
.bb-product-card {
    display: block;
    min-width: 0;
    box-sizing: border-box;
    /* Reset WooCommerce article overrides */
    width: 100% !important;
    float: none !important;
    clear: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Anchor ── */
.bb-product-card__link {
    display: block;
    text-decoration: none !important;
    color: inherit;
}

/* ── Image container — 3:4 ratio, always uniform ── */
.bb-product-card__image-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #ECE9E3;
    margin-bottom: 0.8rem;
    /* Fallback padding-bottom for browsers without aspect-ratio */
    padding-bottom: 133.33%; /* 4÷3 = 1.3333 */
    display: block;
}
@supports (aspect-ratio: 3 / 4) {
    .bb-product-card__image-wrap {
        padding-bottom: 0;
        aspect-ratio: 3 / 4;
        height: auto;
    }
}

/* ── Product image ── */
.bb-product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@supports (aspect-ratio: 3 / 4) {
    .bb-product-card__img {
        position: static;
    }
}
.bb-product-card__link:hover .bb-product-card__img {
    transform: scale(1.04);
}

/* ── Discount badge ── */
.bb-product-card__badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background-color: var(--im-color-text, #1C1B18);
    color: #fff;
    font-family: var(--im-font-body);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.45rem;
    line-height: 1.5;
    z-index: 2;
    pointer-events: none;
}

/* ── Info block (name + price + swatches) ── */
.bb-product-card__info {
    padding: 0;
}

/* ── Product name ── */
.bb-product-card__name {
    font-family: var(--im-font-body, sans-serif);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--im-color-text, #1C1B18);
    line-height: 1.35;
    margin: 0 0 0.35rem;
    text-transform: none;
    letter-spacing: 0;
    /* Allow 2 lines, clip after */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Fixed height for 2 lines so grid rows stay uniform */
    min-height: calc(0.9rem * 1.35 * 2);
}

/* ── Prices row: sale + regular side-by-side ── */
.bb-product-card__prices {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* Sale / current price */
.bb-product-card__price-sale {
    font-family: var(--im-font-body, sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--im-color-text, #1C1B18);
    line-height: 1;
}
.bb-product-card__price-sale .woocommerce-Price-amount,
.bb-product-card__price-sale ins {
    text-decoration: none !important;
    font-weight: 600;
    color: var(--im-color-text, #1C1B18) !important;
}

/* Regular / original price — strikethrough */
.bb-product-card__price-regular {
    font-family: var(--im-font-body, sans-serif);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--im-color-muted, #6B6862);
    line-height: 1;
    text-decoration: line-through;
}
.bb-product-card__price-regular .woocommerce-Price-amount,
.bb-product-card__price-regular bdi,
.bb-product-card__price-regular del,
.bb-product-card__price-regular del bdi {
    text-decoration: line-through !important;
    color: var(--im-color-muted, #6B6862) !important;
    opacity: 1 !important;
}

/* WooCommerce del/ins inside the sale span */
.bb-product-card__prices del {
    color: var(--im-color-muted, #6B6862) !important;
    opacity: 1 !important;
    font-size: 0.75rem;
    text-decoration: line-through !important;
}
.bb-product-card__prices ins {
    text-decoration: none !important;
    font-weight: 600;
    color: var(--im-color-text, #1C1B18) !important;
}

/* ── Color swatches ── */
.bb-product-card__swatches {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}
.bb-product-card__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(28, 27, 24, 0.15);
    flex-shrink: 0;
}
.bb-product-card__swatch-more {
    font-size: 0.62rem;
    color: var(--im-color-muted, #6B6862);
    font-weight: 600;
    white-space: nowrap;
    margin-left: 2px;
}

/* ── Hidden (JS filter) ── */
.bb-product-card.is-hidden {
    display: none !important;
}
