/* VdBT Meebestel-artikel — eigen namespace .vdbtmb-, raakt het theme niet aan
 *
 * Opzet sinds 1.6.0: mobile-first. De basis is een compacte rij (foto links,
 * tekst rechts) — dat is wat de checkout-kolom, het winkelwagen-zijpaneel en
 * de telefoon nodig hebben. Vanaf 576px wordt de winkelwagen-variant een
 * kaartenraster met de foto bovenaan.
 *
 * Kleuren: rood (#c8102e) is uitsluitend voor de kortingsprijs en de
 * kortingsvlag. De knop is een omlijnde knop, zodat hij niet concurreert met
 * de gevulde "Bestellen"-knop van het theme.
 */

.vdbtmb-block {
    margin: 1rem 0 1.5rem;
}

.vdbtmb-block > .vdbtmb-title {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #232323;
}

.vdbtmb-block > .vdbtmb-subtitle {
    margin: 0 0 .75rem;
    font-size: .85rem;
    line-height: 1.35;
    color: #6f6f6f;
}

.vdbtmb-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: .6rem;
}

.vdbtmb-item {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.vdbtmb-item:hover {
    border-color: #b9dcec;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}

.vdbtmb-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    height: 100%;
}

/* ---------- foto ---------- */

.vdbtmb-image {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    background: #f6f7f8;
    border-radius: 4px;
    overflow: hidden;
}

.vdbtmb-image a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.vdbtmb-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* ---------- tekst ---------- */

.vdbtmb-body {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    min-width: 0;
}

.vdbtmb-badge {
    align-self: flex-start;
    margin: 0 0 .2rem;
    padding: 2px 6px;
    background: #c8102e;
    border-radius: 3px;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.4;
    white-space: nowrap;
}

.vdbtmb-ref {
    margin: 0 0 .1rem;
    color: #6f6f6f;
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.vdbtmb-name {
    margin: 0 0 .35rem;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.3;
    color: #414141;
    /* Nooit meer dan twee regels: de kaartjes moeten even hoog blijven. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vdbtmb-name a {
    color: inherit;
    text-decoration: none;
}

.vdbtmb-name a:hover,
.vdbtmb-name a:focus {
    text-decoration: underline;
}

/* ---------- prijs ---------- */

/* Van-prijs bóven de actieprijs: verticaal gestapeld rekenen mensen in
   procenten ("dat scheelt de helft"), naast elkaar in euro's. */
.vdbtmb-prices {
    margin-top: auto;
}

.vdbtmb-price-before {
    display: block;
    color: #6f6f6f;
    font-size: .78rem;
    line-height: 1.3;
    text-decoration: line-through;
}

.vdbtmb-price {
    color: #c8102e;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.vdbtmb-tax {
    margin-left: .3rem;
    color: #6f6f6f;
    font-size: .7rem;
    font-weight: 400;
    white-space: nowrap;
}

.vdbtmb-qty {
    margin: .25rem 0 0;
    color: #6f6f6f;
    font-size: .78rem;
}

/* Aantal beschikbaar: de klant mag elk artikel maar één keer meebestellen,
   dus dit getal is zijn "kans". Grijs, geen rood — rood blijft voor prijs
   en kortingsvlag. */
.vdbtmb-stock {
    margin: .25rem 0 0;
    color: #6f6f6f;
    font-size: .78rem;
}

.vdbtmb-error {
    margin: .4rem 0 0;
    color: #c8102e;
    font-size: .82rem;
}

.vdbtmb-error[hidden] {
    display: none;
}

/* ---------- knop ---------- */

.vdbtmb-action {
    flex: 1 1 100%;
}

.vdbtmb-block .vdbtmb-add {
    display: block;
    width: 100%;
    margin: 0;
    padding: .5rem .75rem;
    background: #fff;
    border: 1.5px solid #2fa8dc;
    border-radius: 4px;
    box-shadow: none;
    color: #1a7ba3;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

.vdbtmb-block .vdbtmb-add:hover,
.vdbtmb-block .vdbtmb-add:focus {
    background: #eaf6fc;
    border-color: #1a7ba3;
    color: #12607f;
}

.vdbtmb-block .vdbtmb-add.vdbtmb-busy,
.vdbtmb-block .vdbtmb-add[disabled] {
    opacity: .6;
    cursor: progress;
}

/* ---------- kaartenraster: alleen de winkelwagenpagina, vanaf tablet ---------- */

@media (min-width: 576px) {
    .vdbtmb-cart .vdbtmb-items {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: .75rem;
    }

    .vdbtmb-cart .vdbtmb-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .85rem;
    }

    /* Vierkant fotovlak via de padding-truc: werkt ook in oudere Safari's. */
    .vdbtmb-cart .vdbtmb-image {
        position: relative;
        flex: 0 0 auto;
        width: 100%;
        height: 0;
        padding-top: 100%;
        margin-bottom: .6rem;
        border-radius: 5px;
    }

    .vdbtmb-cart .vdbtmb-image a {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        height: auto;
        padding: 6px;
    }

    .vdbtmb-cart .vdbtmb-body {
        flex: 1 1 auto;
    }

    /* Kortingsvlag naar de hoek van het kaartje. */
    .vdbtmb-cart .vdbtmb-badge {
        position: absolute;
        top: .55rem;
        left: .55rem;
        z-index: 2;
        margin: 0;
    }

    .vdbtmb-cart .vdbtmb-name {
        /* Twee regels reserveren zodat de prijzen op één lijn uitkomen. */
        min-height: 2.34em;
    }

    .vdbtmb-cart .vdbtmb-action {
        flex: 0 0 auto;
        margin-top: .6rem;
    }
}

/* ---------- smalle kolommen: checkout en zijpaneel ---------- */

.vdbtmb-checkout > .vdbtmb-title,
.vdbtmb-blockcart > .vdbtmb-title {
    font-size: .95rem;
}

.vdbtmb-checkout > .vdbtmb-subtitle,
.vdbtmb-blockcart > .vdbtmb-subtitle {
    margin-bottom: .5rem;
    font-size: .78rem;
}

.vdbtmb-blockcart {
    margin: .75rem 0 .25rem;
    text-align: left;
}

.vdbtmb-blockcart .vdbtmb-inner {
    padding: .65rem;
    gap: .6rem;
}

.vdbtmb-blockcart .vdbtmb-image {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
}

.vdbtmb-blockcart .vdbtmb-price {
    font-size: 1.05rem;
}
