/* =====================================================================
   „Cumpărate frecvent împreună" (cross-selling)

   Structură 1:1 cu sursa v2. Culorile vin din tokenii de brand --bm-* (definiți în
   biomag.css / brand-head pasiune), deci se recolorează automat pe fiecare temă.
   ===================================================================== */

.fbt {
    border: 1px solid #ececec;
    border-radius: var(--bm-radius, 18px);
    margin: 0 0 1.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .04);
}

/* ---------- Rândul de imagini + sumar ---------- */

.fbt__main {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid #f3f3f3;
}

.fbt__tiles {
    display: flex;
    align-items: center;
    gap: .5rem;
    /* flex-basis:0 → rândul de imagini nu raportează lățimea conținutului, deci nu împinge
       și nu coboară sumarul de preț când apar tile-uri noi (al 4-lea + cutia REDUCERE);
       surplusul face scroll orizontal aici, iar `.fbt__summary` rămâne fix pe dreapta. */
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: thin;
}

.fbt__tile {
    flex: 0 0 auto;
    width: 8.25rem;
    height: 8.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    border: 1px solid #ececec;
    border-radius: calc(var(--bm-radius, 18px) * .5);
    background: #fff;
}

.fbt__tile img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fbt__plus {
    flex: 0 0 auto;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--bm-price-card, #e62929);
    user-select: none;
}

.fbt__tile--gift {
    flex-direction: column;
    gap: .125rem;
    background: var(--bm-green-bg-subtle, #f6f2fb);
    border-style: dashed;
    border-color: var(--bm-price-card, #e62929);
    color: var(--bm-price-card, #e62929);
    text-align: center;
}

.fbt__gift-label {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.fbt__gift-pct {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

/* ---------- Sumarul din dreapta ---------- */

.fbt__summary {
    flex: 0 0 auto;
    min-width: 15rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.fbt__old-total {
    color: var(--bs-secondary-color, #6c757d);
    font-size: .95rem;
}

.fbt__old-total s {
    text-decoration: line-through;
}

.fbt__new-total {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--bm-price-card, #e62929);
    line-height: 1.2;
}

.fbt__savings,
.fbt__shipping,
.fbt__discretion {
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.fbt__savings {
    color: var(--bm-success, #16a34a);
}

/* „Discreție totală" + „Transport gratuit de la X lei" (sub prag) — neutru, fără accent. */
.fbt__discretion,
.fbt__shipping {
    color: var(--bs-secondary-color, #6c757d);
}

/* Peste pragul de transport gratuit — verde, cu bifă. */
.fbt__shipping--free {
    color: var(--bm-success, #16a34a);
}

.fbt__savings--broken {
    text-decoration: line-through;
    opacity: .6;
}

.fbt__btn {
    margin-top: .5rem;
    padding: .75rem 1.25rem;
    border: 0;
    border-radius: var(--bs-border-radius, .5rem);
    background: var(--bm-btn-cart, var(--bm-green, #00a651));
    color: #fff;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background-color .15s ease-in-out;
}

.fbt__btn:hover:not(:disabled) {
    background: var(--bm-btn-cart-hover, var(--bm-green-dark, #009143));
}

.fbt__btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.fbt__error {
    margin-top: .5rem;
    font-size: .875rem;
    color: var(--bm-price-card, #e62929);
}

/* ---------- Lista pe două coloane ---------- */

.fbt__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.fbt__row {
    border-bottom: 1px solid #f3f3f3;
    border-right: 1px solid #f3f3f3;
}

.fbt__row:nth-child(2n) {
    border-right: 0;
}

.fbt__row:last-child,
.fbt__row:nth-last-child(2):nth-child(odd) {
    border-bottom: 0;
}

.fbt__row--oos {
    opacity: .55;
}

.fbt__label {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    margin: 0;
    cursor: pointer;
    width: 100%;
}

.fbt__row--oos .fbt__label {
    cursor: not-allowed;
}

.fbt__check {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--bm-success, #16a34a);
}

.fbt__thumb {
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    object-fit: contain;
    border: 1px solid #ececec;
    border-radius: calc(var(--bm-radius, 18px) * .35);
    background: #fff;
}

.fbt__meta {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.fbt__brand {
    font-size: 14px;
    color: #888888;
    margin-bottom: 2px;
}

.fbt__name {
    color: #222222;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.25;
    /* Titlul rămâne pe un singur rând; ce depășește se taie cu „…". */
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fbt__name:hover {
    text-decoration: underline;
}

.fbt__prices {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .4rem;
    font-size: .9rem;
}

.fbt__old {
    color: var(--bs-secondary-color, #6c757d);
    text-decoration: line-through;
}

.fbt__new {
    color: var(--bm-price-card, #e62929);
}

.fbt__chip {
    align-self: flex-start;
    margin-top: .15rem;
    padding: .1rem .4rem;
    border-radius: var(--bs-border-radius-sm, .25rem);
    font-size: .72rem;
    background: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-secondary-color, #6c757d);
}

.fbt__chip--info {
    background: var(--bm-green-bg-subtle, #f6f2fb);
    color: var(--bm-green-emphasis, #6b21a8);
}

/* ---------- Responsive ---------- */

@media (max-width: 767.98px) {
    .fbt__main {
        flex-direction: column;
        align-items: stretch;
    }

    .fbt__summary {
        min-width: 0;
    }

    .fbt__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .fbt__row:nth-child(2n) {
        border-right: 0;
    }

    .fbt__row {
        border-right: 0;
    }

    .fbt__row:nth-last-child(2):nth-child(odd) {
        border-bottom: 1px solid #f3f3f3;
    }
}
