/* =========================================================
   Binoise modern product cards
   Archive + linked products (upsells/cross-sells)
   ========================================================= */
:root {
    --bpc-orange: #fa7921;
    --bpc-red: #f55157;
    --bpc-ink: #252746;
    --bpc-muted: #7b8089;
    --bpc-line: #e6e8ec;
    --bpc-soft: #f4f5f6;
}

.bpc-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--bpc-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(26, 30, 37, .025);
    display: flex;
    flex-direction: column;
    height: 100%;
    direction: rtl;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.bpc-card:hover {
    transform: translateY(-4px);
    border-color: rgba(250, 121, 33, .5);
    box-shadow: 0 15px 35px rgba(26, 30, 37, .09);
}

/* Out-of-stock cards: visibly inactive without disabling product discovery. */
.bpc-card.is-out-of-stock {
    border-color: #e4e6e9;
    background: #fafafa;
    box-shadow: none;
}

.bpc-card.is-out-of-stock:hover {
    transform: none;
    border-color: #dfe2e6;
    box-shadow: 0 5px 16px rgba(26, 30, 37, .035);
}

.bpc-card.is-out-of-stock .bpc-media,
.bpc-card.is-out-of-stock .bpc-copy,
.bpc-card.is-out-of-stock .bpc-meta-row,
.bpc-card.is-out-of-stock .bpc-colors {
    filter: grayscale(1);
    opacity: .58;
}

.bpc-card.is-out-of-stock:hover .bpc-image {
    transform: none;
}

.bpc-card.is-out-of-stock .bpc-view-cue {
    background: rgba(255,255,255,.94);
    color: #727780;
}


.bpc-media {
    position: relative;
    margin: 10px 10px 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 17px;
    background: linear-gradient(145deg, #f6f6f7 0%, #eeeeef 100%);
}

.bpc-image-link {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.bpc-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    mix-blend-mode: multiply;
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
}

.bpc-card:hover .bpc-image {
    transform: scale(1.045);
}

.bpc-badges {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.bpc-badge {
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(28, 31, 38, .08);
}

.bpc-badge--sale {
    background: var(--bpc-red);
    color: #fff;
}

.bpc-badge--new {
    background: #fff;
    color: var(--bpc-orange);
    border: 1px solid rgba(250, 121, 33, .22);
}

.bpc-wishlist {
    position: absolute;
    z-index: 7;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
}

/* YITH Wishlist - current button markup */
.bpc-wishlist .yith-add-to-wishlist-button-block,
.bpc-wishlist .yith-wcwl-add-to-wishlist,
.bpc-wishlist .yith-wcwl-add-button,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse {
    margin: 0 !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    display: block !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button,
.bpc-wishlist .yith-wcwl-add-to-wishlist a,
.bpc-wishlist .yith-wcwl-add-button a,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse a,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse a,
.bpc-wishlist-fallback {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid rgba(38, 42, 52, .09) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 5px 16px rgba(34, 38, 45, .08) !important;
    backdrop-filter: blur(7px);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #666b75 !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease !important;
}

/* Keep the real YITH SVG heart visible. */
.bpc-wishlist .yith-wcwl-icon-svg__wrapper,
.bpc-wishlist .yith-wcwl-icon,
.bpc-wishlist .yith-wcwl-icon-svg__wrapper svg,
.bpc-wishlist .yith-wcwl-add-to-wishlist-button svg {
    display: block !important;
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
    color: #666b75 !important;
    fill: currentColor !important;
    stroke: currentColor !important;
    margin: 0 !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button--added,
.bpc-wishlist .yith-wcwl-add-to-wishlist-button--added .yith-wcwl-icon-svg__wrapper svg,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse a,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse a {
    color: var(--bpc-red) !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button:hover,
.bpc-wishlist a:hover,
.bpc-wishlist-fallback:hover {
    transform: translateY(-2px);
    border-color: rgba(250, 121, 33, .34) !important;
    background: #fffaf6 !important;
    color: var(--bpc-orange) !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button__label,
.bpc-wishlist .feedback,
.bpc-wishlist .separator,
.bpc-wishlist .view-wishlist {
    display: none !important;
}

/* Fallback only when YITH is unavailable. */
.bpc-wishlist-fallback::before {
    content: "♡";
    color: #666b75;
    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
}

.bpc-view-cue {
    position: absolute;
    z-index: 3;
    right: 50%;
    bottom: 12px;
    transform: translate(50%, 8px);
    opacity: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.72);
    color: #3f4350;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 7px 18px rgba(25, 29, 36, .09);
    backdrop-filter: blur(8px);
    transition: opacity .23s ease, transform .23s ease;
}

.bpc-card:hover .bpc-view-cue {
    opacity: 1;
    transform: translate(50%, 0);
}

.bpc-view-cue__arrow {
    color: var(--bpc-orange);
    font-size: 14px;
}

.bpc-body {
    flex: 1;
    min-height: 208px;
    padding: 15px 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.bpc-copy {
    min-width: 0;
}

.bpc-category {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--bpc-orange);
    font-size: 11px;
    line-height: 1.5;
    font-weight: 800;
    text-decoration: none;
}

.bpc-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 30px;
    color: #24262d;
    font-size: 15px;
    line-height: 1.85;
    font-weight: 800;
    text-decoration: none;
    transition: color .2s ease;
}

.bpc-title:hover {
    color: var(--bpc-orange);
}

.bpc-brand-row {
    margin-top: 9px;
}

.bpc-brand {
    color: #8a8e96;
    font-size: 10px;
    font-weight: 650;
    text-decoration: none;
}

.bpc-bottom {
    min-height: 50px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f1f3;
}

.bpc-colors {
    min-height: 26px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.bpc-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bpc-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #d9dce1;
}

.bpc-color-more {
    color: #8a8e96;
    font-size: 9px;
    font-weight: 800;
}

.bpc-price {
    min-width: 105px;
    margin-right: auto;
    text-align: left;
    direction: rtl;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.bpc-price-current {
    color: #292c34;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 900;
    white-space: nowrap;
}

.bpc-price.is-sale .bpc-price-current {
    color: var(--bpc-red);
}

.bpc-price-prefix {
    margin-left: 3px;
    color: #8b8f97;
    font-size: 9px;
    font-weight: 700;
}
.bpc-price-regular {
    color: #a2a6ad;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 600;
    text-decoration: line-through;
    white-space: nowrap;
}
.bpc-price-contact {
    color: #4f535c;
    font-size: 12px;
    font-weight: 800;
}

.bpc-price-stockout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 11px;
    border: 1px solid #dfe2e6;
    border-radius: 999px;
    background: #f0f1f3;
    color: #777d86;
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

/* Single-product linked sections keep their existing 6/4/scroll grid, but use the same card design. */
.sp-related-grid.bpc-linked-grid {
    gap: 12px !important;
    padding: 14px !important;
    border-top: 1px solid #eceef0;
}

.sp-related-grid.bpc-linked-grid .bpc-card {
    border: 1px solid #e8eaed;
    min-width: 0;
}

.sp-related-grid.bpc-linked-grid .bpc-body {
    min-height: 190px;
    padding: 12px 12px 14px;
}

.sp-related-grid.bpc-linked-grid .bpc-title {
    min-height: 44px;
    font-size: 12px;
}

.sp-related-grid.bpc-linked-grid .bpc-price-current {
    font-size: 13px;
}

.sp-related-grid.bpc-linked-grid .bpc-media {
    margin: 8px 8px 0;
}

@media (max-width: 1180px) {
    .bpc-body {
        padding: 14px;
    }

    .bpc-price-current {
        font-size: 15px;
    }
}

@media (max-width: 820px) {
    .sp-related-grid.bpc-linked-grid {
        gap: 10px !important;
        padding: 10px !important;
    }

    .sp-related-grid.bpc-linked-grid .bpc-card {
        scroll-snap-align: start;
    }
}

@media (max-width: 639px) {
    .archive-products-panel .bpc-card {
        display: grid;
        grid-template-columns: 42% minmax(0, 1fr);
        border-radius: 18px;
        min-height: 178px;
    }

    .archive-products-panel .bpc-card:hover {
        transform: none;
    }

    .archive-products-panel .bpc-media {
        height: 100%;
        min-height: 176px;
        margin: 0;
        border-radius: 17px;
        aspect-ratio: auto;
    }

    .archive-products-panel .bpc-image-link {
        padding: 15px;
    }

    .archive-products-panel .bpc-body {
        min-height: 176px;
        padding: 12px 12px 11px;
        gap: 8px;
    }

    .archive-products-panel .bpc-title {
        min-height: 40px;
        font-size: 12px;
        line-height: 1.75;
    }

    .archive-products-panel .bpc-category {
        margin-bottom: 4px;
        font-size: 9px;
    }

    .archive-products-panel .bpc-brand-row {
        margin-top: 5px;
    }

    .archive-products-panel .bpc-bottom {
        min-height: 42px;
        padding-top: 8px;
        gap: 8px;
    }

    .archive-products-panel .bpc-price {
        min-width: 86px;
    }

    .archive-products-panel .bpc-price-current {
        font-size: 13px;
    }

    .archive-products-panel .bpc-price-regular {
        font-size: 9px;
    }

    .archive-products-panel .bpc-color {
        width: 16px;
        height: 16px;
    }

    .archive-products-panel .bpc-wishlist {
        top: 9px;
        right: 9px;
    }

    .archive-products-panel .bpc-badges {
        top: 9px;
        left: 9px;
    }

    .bpc-view-cue {
        display: none;
    }
}

/* =========================================================
   V24 — Wishlist icon, Woo rating, Digikala-like mobile rows
   ========================================================= */

/* Rating */
.bpc-rating {
    margin-top: 9px;
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    direction: ltr;
    width: fit-content;
    color: #5f636d;
    font-size: 10px;
    line-height: 1;
}

.bpc-rating-star {
    color: #f9b300;
    font-size: 15px;
    line-height: 1;
}

.bpc-rating-value {
    color: #343740;
    font-size: 11px;
    font-weight: 850;
}

.bpc-rating-count {
    color: #a0a4ab;
    font-size: 9px;
    font-weight: 650;
}

/*
 * YITH changes its internal SVG markup between versions.
 * Keep the real YITH button/action, but render our own stable heart.
 */
.bpc-wishlist .yith-wcwl-add-to-wishlist-button,
.bpc-wishlist .yith-wcwl-add-to-wishlist a,
.bpc-wishlist .yith-wcwl-add-button a,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse a,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse a,
.bpc-wishlist-fallback {
    position: relative !important;
    overflow: hidden !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button > *,
.bpc-wishlist .yith-wcwl-add-to-wishlist a > *,
.bpc-wishlist .yith-wcwl-add-button a > *,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse a > *,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse a > * {
    opacity: 0 !important;
    visibility: hidden !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button::before,
.bpc-wishlist .yith-wcwl-add-to-wishlist a::before,
.bpc-wishlist .yith-wcwl-add-button a::before,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse a::before,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse a::before,
.bpc-wishlist-fallback::before {
    content: "♡" !important;
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #5e636d !important;
    font-family: Arial, sans-serif !important;
    font-size: 25px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button--added::before,
.bpc-wishlist .yith-wcwl-wishlistaddedbrowse a::before,
.bpc-wishlist .yith-wcwl-wishlistexistsbrowse a::before,
.bpc-wishlist .yith-wcwl-add-to-wishlist-button[aria-pressed="true"]::before {
    content: "♥" !important;
    color: var(--bpc-red) !important;
}

.bpc-wishlist .yith-wcwl-add-to-wishlist-button:hover::before,
.bpc-wishlist a:hover::before,
.bpc-wishlist-fallback:hover::before {
    color: var(--bpc-orange) !important;
}

/* Digikala-like mobile archive list */
@media (max-width: 639px) {
    .archive-products-panel .bpc-card {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 132px !important;
        grid-template-areas: "body media" !important;
        align-items: stretch !important;
        min-height: 190px !important;
        overflow: visible !important;
        border: 0 !important;
        border-bottom: 1px solid #e8eaed !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
        padding: 14px 0 !important;
        direction: ltr !important;
    }

    .archive-products-panel .bpc-card:last-child {
        border-bottom: 0 !important;
    }

    .archive-products-panel .bpc-media {
        grid-area: media !important;
        position: relative !important;
        width: 132px !important;
        height: 150px !important;
        min-height: 150px !important;
        margin: 0 !important;
        align-self: start !important;
        border-radius: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        direction: rtl !important;
    }

    .archive-products-panel .bpc-image-link {
        inset: 0 !important;
        padding: 8px 8px 4px !important;
    }

    .archive-products-panel .bpc-image {
        object-fit: contain !important;
        mix-blend-mode: normal !important;
        transform: none !important;
    }

    .archive-products-panel .bpc-body {
        grid-area: body !important;
        min-width: 0 !important;
        min-height: 150px !important;
        padding: 2px 12px 0 2px !important;
        gap: 10px !important;
        direction: rtl !important;
        text-align: right !important;
    }

    .archive-products-panel .bpc-copy {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        min-width: 0 !important;
    }

    .archive-products-panel .bpc-category {
        margin: 0 0 5px !important;
        font-size: 9px !important;
        font-weight: 800 !important;
    }

    .archive-products-panel .bpc-title {
        min-height: auto !important;
        margin: 0 !important;
        -webkit-line-clamp: 2 !important;
        font-size: 12px !important;
        line-height: 1.8 !important;
        font-weight: 800 !important;
    }

    .archive-products-panel .bpc-brand-row {
        margin-top: 7px !important;
    }

    .archive-products-panel .bpc-brand {
        font-size: 9px !important;
        color: #81858e !important;
    }

    .archive-products-panel .bpc-rating {
        margin-top: 8px !important;
        direction: ltr !important;
    }

    .archive-products-panel .bpc-rating-star {
        font-size: 14px !important;
    }

    .archive-products-panel .bpc-bottom {
        margin-top: auto !important;
        min-height: 45px !important;
        padding-top: 10px !important;
        border-top: 1px solid #f0f1f3 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
        gap: 8px !important;
        direction: rtl !important;
    }

    .archive-products-panel .bpc-colors {
        max-width: 48% !important;
        gap: 4px !important;
    }

    .archive-products-panel .bpc-color {
        width: 16px !important;
        height: 16px !important;
    }

    .archive-products-panel .bpc-price {
        min-width: 0 !important;
        margin: 0 0 0 5px !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    .archive-products-panel .bpc-price-current {
        font-size: 13px !important;
        font-weight: 900 !important;
    }

    .archive-products-panel .bpc-price-regular {
        margin-top: 2px !important;
        font-size: 9px !important;
    }

    .archive-products-panel .bpc-badges {
        top: 4px !important;
        left: 4px !important;
    }

    .archive-products-panel .bpc-badge {
        min-height: 24px !important;
        padding: 4px 7px !important;
        font-size: 9px !important;
    }

    .archive-products-panel .bpc-wishlist {
        top: 3px !important;
        right: 5px !important;
        width: 34px !important;
        height: 34px !important;
    }

    .archive-products-panel .bpc-wishlist .yith-add-to-wishlist-button-block,
    .archive-products-panel .bpc-wishlist .yith-wcwl-add-to-wishlist,
    .archive-products-panel .bpc-wishlist .yith-wcwl-add-button,
    .archive-products-panel .bpc-wishlist .yith-wcwl-wishlistaddedbrowse,
    .archive-products-panel .bpc-wishlist .yith-wcwl-wishlistexistsbrowse,
    .archive-products-panel .bpc-wishlist .yith-wcwl-add-to-wishlist-button,
    .archive-products-panel .bpc-wishlist a,
    .archive-products-panel .bpc-wishlist-fallback {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        border: 0 !important;
        background: rgba(255,255,255,.9) !important;
        box-shadow: 0 2px 8px rgba(32,36,44,.07) !important;
    }

    .archive-products-panel .bpc-wishlist .yith-wcwl-add-to-wishlist-button::before,
    .archive-products-panel .bpc-wishlist a::before,
    .archive-products-panel .bpc-wishlist-fallback::before {
        font-size: 22px !important;
    }

    .archive-products-panel .bpc-view-cue {
        display: none !important;
    }
}


/* =========================================================
   V26 — Compact inline brand + five-star WooCommerce rating
   ========================================================= */
.bpc-meta-row {
    margin-top: 9px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.bpc-meta-row .bpc-brand-row {
    margin-top: 0 !important;
    min-width: 0;
    display: flex;
    align-items: center;
}

.bpc-meta-row .bpc-brand {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bpc-meta-row .bpc-rating {
    margin-top: 0 !important;
    min-height: 22px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    direction: ltr;
    width: auto;
    white-space: nowrap;
}

.bpc-stars {
    --bpc-rating-percent: 0%;
    position: relative;
    display: inline-block;
    color: #d9dce1;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 1px;
    font-family: Arial, sans-serif;
    direction: ltr;
    white-space: nowrap;
}

.bpc-stars::before {
    content: "★★★★★";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--bpc-rating-percent);
    overflow: hidden;
    color: #f9b300;
    white-space: nowrap;
}

.bpc-meta-row .bpc-rating-value {
    font-size: 11px;
    font-weight: 850;
}

.bpc-meta-row .bpc-rating-count {
    font-size: 9px;
}

/* Old one-star node is no longer rendered, but keep it harmless. */
.bpc-rating-star {
    display: none !important;
}

@media (max-width: 767px) {
    .archive-products-panel .bpc-meta-row {
        margin-top: 7px !important;
        min-height: 20px !important;
        gap: 7px !important;
    }

    .archive-products-panel .bpc-meta-row .bpc-brand-row,
    .archive-products-panel .bpc-meta-row .bpc-rating {
        margin-top: 0 !important;
    }

    .archive-products-panel .bpc-stars {
        font-size: 15px !important;
        letter-spacing: .5px !important;
    }

    .archive-products-panel .bpc-meta-row .bpc-rating-value {
        font-size: 10px !important;
    }

    .archive-products-panel .bpc-meta-row .bpc-rating-count {
        font-size: 8px !important;
    }
}

/* =========================================================
   V28 — Homepage Swiper adapter for modern product cards
   The archive uses CSS Grid, while homepage cards live inside
   flex-based Swiper slides. Force the shared card to fill the slide.
   ========================================================= */
.best-sellers .mySwiper .swiper-slide,
.newest .mySwiper .swiper-slide {
    min-width: 0 !important;
    height: auto !important;
}

.best-sellers .mySwiper .bpc-card,
.newest .mySwiper .bpc-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    align-self: stretch !important;
}

/* Keep the homepage media/card proportions aligned with archive cards. */
.best-sellers .mySwiper .bpc-media,
.newest .mySwiper .bpc-media {
    width: auto !important;
}

/* =========================================================
   V29 — Homepage mobile: two compact product cards per view
   Scope: best-sellers + newest only. Archive cards untouched.
   ========================================================= */
@media (max-width: 639px) {
    .best-sellers .mySwiper,
    .newest .mySwiper {
        width: 100% !important;
        overflow: hidden !important;
    }

    .best-sellers .mySwiper .swiper-wrapper,
    .newest .mySwiper .swiper-wrapper {
        align-items: stretch !important;
    }

    .best-sellers .mySwiper .swiper-slide,
    .newest .mySwiper .swiper-slide {
        height: auto !important;
        min-width: 0 !important;
        display: flex !important;
    }

    .best-sellers .mySwiper .bpc-card,
    .newest .mySwiper .bpc-card {
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 9px rgba(27, 31, 38, .035) !important;
    }

    .best-sellers .mySwiper .bpc-card:hover,
    .newest .mySwiper .bpc-card:hover {
        transform: none !important;
    }

    .best-sellers .mySwiper .bpc-media,
    .newest .mySwiper .bpc-media {
        margin: 6px 6px 0 !important;
        border-radius: 12px !important;
        aspect-ratio: 1 / 1 !important;
    }

    .best-sellers .mySwiper .bpc-image-link,
    .newest .mySwiper .bpc-image-link {
        padding: 11px !important;
    }

    .best-sellers .mySwiper .bpc-wishlist,
    .newest .mySwiper .bpc-wishlist {
        top: 8px !important;
        right: 8px !important;
        width: 30px !important;
        height: 30px !important;
    }

    .best-sellers .mySwiper .bpc-wishlist .yith-add-to-wishlist-button-block,
    .best-sellers .mySwiper .bpc-wishlist .yith-wcwl-add-to-wishlist,
    .best-sellers .mySwiper .bpc-wishlist .yith-wcwl-add-button,
    .best-sellers .mySwiper .bpc-wishlist .yith-wcwl-wishlistaddedbrowse,
    .best-sellers .mySwiper .bpc-wishlist .yith-wcwl-wishlistexistsbrowse,
    .best-sellers .mySwiper .bpc-wishlist .yith-wcwl-add-to-wishlist-button,
    .best-sellers .mySwiper .bpc-wishlist a,
    .best-sellers .mySwiper .bpc-wishlist-fallback,
    .newest .mySwiper .bpc-wishlist .yith-add-to-wishlist-button-block,
    .newest .mySwiper .bpc-wishlist .yith-wcwl-add-to-wishlist,
    .newest .mySwiper .bpc-wishlist .yith-wcwl-add-button,
    .newest .mySwiper .bpc-wishlist .yith-wcwl-wishlistaddedbrowse,
    .newest .mySwiper .bpc-wishlist .yith-wcwl-wishlistexistsbrowse,
    .newest .mySwiper .bpc-wishlist .yith-wcwl-add-to-wishlist-button,
    .newest .mySwiper .bpc-wishlist a,
    .newest .mySwiper .bpc-wishlist-fallback {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        border-radius: 10px !important;
    }

    .best-sellers .mySwiper .bpc-wishlist .yith-wcwl-add-to-wishlist-button::before,
    .best-sellers .mySwiper .bpc-wishlist a::before,
    .best-sellers .mySwiper .bpc-wishlist-fallback::before,
    .newest .mySwiper .bpc-wishlist .yith-wcwl-add-to-wishlist-button::before,
    .newest .mySwiper .bpc-wishlist a::before,
    .newest .mySwiper .bpc-wishlist-fallback::before {
        font-size: 20px !important;
    }

    .best-sellers .mySwiper .bpc-badges,
    .newest .mySwiper .bpc-badges {
        top: 8px !important;
        left: 8px !important;
    }

    .best-sellers .mySwiper .bpc-badge,
    .newest .mySwiper .bpc-badge {
        min-height: 23px !important;
        padding: 4px 6px !important;
        font-size: 8px !important;
    }

    .best-sellers .mySwiper .bpc-body,
    .newest .mySwiper .bpc-body {
        min-height: 178px !important;
        padding: 9px 10px 10px !important;
        gap: 10px !important;
    }

    .best-sellers .mySwiper .bpc-category,
    .newest .mySwiper .bpc-category {
        margin-bottom: 3px !important;
        font-size: 9px !important;
    }

    .best-sellers .mySwiper .bpc-title,
    .newest .mySwiper .bpc-title {
        min-height: 37px !important;
        font-size: 11px !important;
        line-height: 1.7 !important;
        -webkit-line-clamp: 2 !important;
    }

    .best-sellers .mySwiper .bpc-meta-row,
    .newest .mySwiper .bpc-meta-row {
        margin-top: 6px !important;
        min-height: 17px !important;
        gap: 4px !important;
    }

    .best-sellers .mySwiper .bpc-meta-row .bpc-brand-row,
    .newest .mySwiper .bpc-meta-row .bpc-brand-row {
        max-width: 43% !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    .best-sellers .mySwiper .bpc-brand,
    .newest .mySwiper .bpc-brand {
        font-size: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .best-sellers .mySwiper .bpc-meta-row .bpc-rating,
    .newest .mySwiper .bpc-meta-row .bpc-rating {
        gap: 3px !important;
        min-height: 17px !important;
    }

    .best-sellers .mySwiper .bpc-stars,
    .newest .mySwiper .bpc-stars {
        font-size: 10px !important;
        letter-spacing: 0 !important;
    }

    .best-sellers .mySwiper .bpc-rating-value,
    .newest .mySwiper .bpc-rating-value {
        font-size: 8px !important;
    }

    .best-sellers .mySwiper .bpc-rating-count,
    .newest .mySwiper .bpc-rating-count {
        display: none !important;
    }

    .best-sellers .mySwiper .bpc-bottom,
    .newest .mySwiper .bpc-bottom {
        min-height: 39px !important;
        padding-top: 8px !important;
        gap: 5px !important;
    }

    .best-sellers .mySwiper .bpc-colors,
    .newest .mySwiper .bpc-colors {
        min-height: 20px !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        max-width: 48% !important;
    }

    .best-sellers .mySwiper .bpc-color,
    .newest .mySwiper .bpc-color {
        width: 14px !important;
        height: 14px !important;
        flex: 0 0 14px !important;
    }

    .best-sellers .mySwiper .bpc-color-more,
    .newest .mySwiper .bpc-color-more {
        font-size: 7px !important;
    }

    .best-sellers .mySwiper .bpc-price,
    .newest .mySwiper .bpc-price {
        min-width: 0 !important;
        gap: 1px !important;
    }

    .best-sellers .mySwiper .bpc-price-current,
    .newest .mySwiper .bpc-price-current {
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    .best-sellers .mySwiper .bpc-price-prefix,
    .newest .mySwiper .bpc-price-prefix,
    .best-sellers .mySwiper .bpc-price-current .woocommerce-Price-currencySymbol,
    .newest .mySwiper .bpc-price-current .woocommerce-Price-currencySymbol {
        font-size: 7px !important;
    }

    .best-sellers .mySwiper .bpc-price-regular,
    .newest .mySwiper .bpc-price-regular {
        font-size: 8px !important;
    }

    .best-sellers .mySwiper .bpc-price-contact,
    .newest .mySwiper .bpc-price-contact {
        font-size: 9px !important;
    }

    .best-sellers .mySwiper .bpc-view-cue,
    .newest .mySwiper .bpc-view-cue {
        display: none !important;
    }
}


/* =========================================================
   V30 — Single product linked sections mobile cleanup
   Scope: related products + complementary suggestions inside single product
   Goal: show 2 cleaner cards on mobile and prevent broken overflow.
   ========================================================= */
@media (max-width: 767px) {
    .single-product .sp-related-wrapper,
    .single-product .upsells,
    .single-product .related.products {
        overflow: hidden !important;
    }

    .single-product .sp-related-wrapper .sp-container,
    .single-product .upsells .sp-container,
    .single-product .related.products .sp-container {
        width: calc(100% - 16px) !important;
        max-width: none !important;
    }

    .single-product .sp-related-head {
        padding: 12px 12px 10px !important;
        min-height: auto !important;
    }

    .single-product .sp-related-head h2 {
        font-size: 18px !important;
        line-height: 1.5 !important;
    }

    .single-product .sp-related-count {
        font-size: 12px !important;
    }

    /* If linked cards use the rebuilt BPC system */
    .single-product .sp-related-grid.bpc-linked-grid {
        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: calc((100% - 12px) / 2) !important;
        grid-template-columns: none !important;
        gap: 12px !important;
        padding: 0 12px 12px !important;
        overflow-x: auto !important;
        overscroll-behavior-inline: contain !important;
        scroll-snap-type: inline proximity !important;
        scroll-padding-inline: 12px !important;
        border-top: 0 !important;
        scrollbar-width: none !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid::-webkit-scrollbar {
        display: none !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-card {
        min-width: 0 !important;
        border-radius: 18px !important;
        scroll-snap-align: start !important;
        box-shadow: 0 2px 10px rgba(27, 31, 38, .04) !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-media {
        margin: 6px 6px 0 !important;
        border-radius: 12px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-image-link {
        padding: 12px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist {
        top: 8px !important;
        right: 8px !important;
        width: 30px !important;
        height: 30px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-add-to-wishlist-button-block,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-wcwl-add-to-wishlist,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-wcwl-add-button,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-wcwl-wishlistaddedbrowse,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-wcwl-wishlistexistsbrowse,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-wcwl-add-to-wishlist-button,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist a,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist-fallback {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        border-radius: 10px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist .yith-wcwl-add-to-wishlist-button::before,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist a::before,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-wishlist-fallback::before {
        font-size: 20px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-badges {
        top: 8px !important;
        left: 8px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-badge {
        min-height: 23px !important;
        padding: 4px 6px !important;
        font-size: 8px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-body {
        min-height: 176px !important;
        padding: 9px 10px 10px !important;
        gap: 10px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-category {
        margin-bottom: 3px !important;
        font-size: 9px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-title {
        min-height: 38px !important;
        font-size: 11px !important;
        line-height: 1.7 !important;
        -webkit-line-clamp: 2 !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-meta-row {
        margin-top: 6px !important;
        min-height: 18px !important;
        gap: 4px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-meta-row .bpc-brand-row {
        max-width: 43% !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-brand {
        font-size: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-meta-row .bpc-rating {
        gap: 3px !important;
        min-height: 18px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-stars {
        font-size: 10px !important;
        letter-spacing: 0 !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-rating-value {
        font-size: 8px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-rating-count {
        display: none !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-bottom {
        min-height: 39px !important;
        padding-top: 8px !important;
        gap: 5px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-colors {
        min-height: 20px !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        max-width: 48% !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-color {
        width: 14px !important;
        height: 14px !important;
        flex: 0 0 14px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-color-more {
        font-size: 7px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-price {
        min-width: 0 !important;
        gap: 1px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-price-current {
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-price-prefix,
    .single-product .sp-related-grid.bpc-linked-grid .bpc-price-current .woocommerce-Price-currencySymbol {
        font-size: 7px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-price-regular {
        font-size: 8px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-price-contact {
        font-size: 9px !important;
    }

    .single-product .sp-related-grid.bpc-linked-grid .bpc-view-cue {
        display: none !important;
    }

    /* Fallback for older dedicated related markup that still uses sp-related-card */
    .single-product .sp-related-grid:not(.bpc-linked-grid) {
        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: calc((100% - 12px) / 2) !important;
        grid-template-columns: none !important;
        gap: 12px !important;
        padding: 0 12px 12px !important;
        overflow-x: auto !important;
        border-top: 0 !important;
        scrollbar-width: none !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid)::-webkit-scrollbar {
        display: none !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-card {
        scroll-snap-align: start !important;
        padding: 10px !important;
        border: 1px solid #eceef0 !important;
        border-radius: 16px !important;
        background: #fff !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-card-body {
        min-height: 144px !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-title {
        min-height: 40px !important;
        font-size: 11px !important;
        line-height: 1.75 !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-price {
        min-height: 36px !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-price,
    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-price ins {
        font-size: 12px !important;
    }

    .single-product .sp-related-grid:not(.bpc-linked-grid) .sp-related-price del {
        font-size: 9px !important;
    }
}


/* =========================================================
   V44 — Keep brand/rating anchored directly above card footer
   bpc-meta-row is now a direct child of .bpc-body, immediately
   before .bpc-bottom. This keeps meta/footer aligned even when
   product titles wrap to a second line.
   ========================================================= */
.bpc-body {
    justify-content: flex-start;
}

.bpc-body > .bpc-meta-row {
    margin-top: auto;
}

.bpc-body > .bpc-bottom {
    margin-top: 0;
}

@media (max-width: 639px) {
    .archive-products-panel .bpc-body > .bpc-meta-row {
        margin-top: auto !important;
    }

    .archive-products-panel .bpc-body > .bpc-bottom {
        margin-top: 0 !important;
    }
}
