/* Basket and checkout actions use the Ben Hofland theme palette. */
.bh-shop .bh-checkout-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    white-space: nowrap;
    font-weight: 700;
}

.bh-shop .bh-cart-trigger {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 13px;
    border: 0;
    border-radius: 24px;
    background: var(--bh-ink);
    color: var(--bh-paper);
    box-shadow: 0 4px 18px color-mix(in srgb, var(--bh-ink) 24%, transparent);
}

.bh-cart-count {
    min-width: 24px;
    padding: 2px 6px;
    text-align: center;
    border-radius: 14px;
    background: var(--bh-paper);
    color: var(--bh-ink);
    font-size: var(--bh-small-size);
    font-weight: 700;
}

.bh-shop .bh-cart-trigger[hidden], .bh-shop .bh-cart-dialog [hidden] { display: none; }
.bh-shop:has(.bh-cart-dialog[open]) { overflow: hidden; }

.bh-shop .bh-cart-dialog {
    position: fixed;
    inset: 12px 12px 12px auto;
    width: min(440px, calc(100% - 24px));
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--bh-selection);
    border-radius: 12px;
    background: var(--bh-paper);
    color: var(--bh-ink);
    overflow: hidden;
}

.bh-shop .bh-cart-dialog[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.bh-cart-dialog::backdrop { background: color-mix(in srgb, var(--bh-ink) 54%, transparent); }

.bh-cart-header, .bh-cart-footer { padding: 14px 20px; }

.bh-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--bh-selection);
}

.bh-cart-header h2 { margin: 0; font-size: 24px; }
.bh-cart-content { overflow: auto; overscroll-behavior: contain; padding: 8px 20px; }
.bh-cart-status { margin: 10px 0; }
.bh-cart-status:empty { margin: 0; }

.bh-cart-line {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--bh-selection);
}

.bh-cart-line a { font-weight: 700; overflow-wrap: anywhere; }
.bh-cart-line p { margin: 4px 0; }
.bh-cart-image img { display: block; width: 64px; height: 64px; object-fit: contain; }
.bh-cart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.bh-cart-controls span { min-width: 24px; text-align: center; }

.bh-cart-dialog button {
    min-height: 44px;
    padding: 4px 10px;
    border: 1px solid var(--bh-selection);
    border-radius: 3px;
    background: var(--bh-paper);
    color: var(--bh-ink);
    font: inherit;
    cursor: pointer;
}

.bh-cart-dialog button:disabled { opacity: .5; cursor: default; }
.bh-cart-dialog .bh-cart-close { min-width: 44px; font-size: 24px; line-height: 1; }
.bh-cart-controls button:not([data-cart-action="verwijderen"]) { min-width: 44px; }
.bh-cart-controls button[data-cart-action="verwijderen"] { font-size: var(--bh-small-size); }
.bh-cart-dialog :is(button, a):focus-visible { outline: 2px solid var(--bh-rust); outline-offset: 2px; }

.bh-cart-footer {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--bh-selection);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.bh-cart-total { display: flex; gap: 12px; justify-content: space-between; margin: 0; }
.bh-cart-checkout[aria-disabled="true"] { opacity: .5; }

@media (max-width: 991px) {
    .bh-shop .bh-checkout-link { min-width: 28px; justify-content: center; }
    .bh-shop.bh-filter-open .bh-cart-trigger,
    .bh-shop:has(#sw_menu.active) .bh-cart-trigger { visibility: hidden; }
}

@media (max-width: 575px) {
    .bh-shop .bh-cart-dialog {
        inset: max(6px, env(safe-area-inset-top)) 6px 6px;
        width: auto;
        height: calc(100dvh - max(6px, env(safe-area-inset-top)) - 6px);
    }

    .bh-shop:has(#cookie-message[style*="visibility: visible"]) .bh-cart-trigger {
        bottom: max(82px, calc(var(--bh-cookie-height, 180px) + 26px));
    }
}
