.bfb-order {
    --bfb-accent: #315b73;
    --bfb-accent-hover: #24475b;
    --bfb-border: #d8e0e5;
    --bfb-muted: #5f6b73;
    --bfb-surface: #ffffff;
    --bfb-soft: #f4f7f9;
    --bfb-radius: 0.75rem;
    --bfb-image-max-width: 640px;
    --bfb-image-max-height: 420px;
    color: #1f2930;
    margin-block: 1.5rem;
}

.bfb-heading {
    font-size: clamp(1.45rem, 2vw, 2rem);
    margin: 0 0 0.4rem;
}

.bfb-intro {
    color: var(--bfb-muted);
    margin: 0 0 1.25rem;
}

.bfb-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.bfb-card {
    background: var(--bfb-surface);
    border: 1px solid var(--bfb-border);
    border-radius: var(--bfb-radius);
    box-shadow: 0 0.2rem 1rem rgb(25 45 56 / 10%);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.bfb-preview-link,
.bfb-preview-frame {
    align-items: center;
    background: #e9eef1;
    display: flex;
    height: min(var(--bfb-image-max-height), 52vw);
    justify-content: center;
    min-height: 13rem;
    overflow: hidden;
    padding: 0.5rem;
    text-decoration: none;
    width: 100%;
}

.bfb-preview {
    border-radius: 5px;
    box-shadow: 0 0 3px 0 #000;
    display: block;
    height: auto;
    max-height: 500px;
    max-width: 300px !important;
    object-fit: contain;
    transition: transform 180ms ease, filter 180ms ease;
    width: auto !important;
}

.bfb-preview-link:hover .bfb-preview,
.bfb-preview-link:focus-visible .bfb-preview {
    filter: brightness(0.9);
    transform: scale(1.025);
}

.bfb-preview-link:focus-visible,
.bfb-button:focus-visible {
    outline: 3px solid #6b9fbd;
    outline-offset: 2px;
}

.bfb-image-title {
    font-size: 1rem;
    margin: 0;
    overflow-wrap: anywhere;
    padding: 0.85rem 0.9rem 0.65rem;
}

.bfb-options-wrap {
    overflow-x: auto;
    padding: 0 0.75rem 0.85rem;
}

.bfb-options-table {
    font-size: 0.92rem;
    width: 100%;
}

.bfb-options-table th,
.bfb-options-table td {
    padding: 0.65rem 0.4rem;
    text-align: left;
    vertical-align: middle;
}

.bfb-options-table thead th {
    color: var(--bfb-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bfb-options-table th:last-child {
    text-align: right;
}

.bfb-options-table td:last-child {
    text-align: right;
}

.bfb-format-label {
    font-weight: 650;
    white-space: nowrap;
}

.bfb-price {
    color: var(--bfb-muted);
    white-space: nowrap;
}

.bfb-stepper {
    align-items: center;
    display: inline-grid;
    grid-template-columns: 2.25rem 2.2rem 2.25rem;
}

.bfb-button {
    align-items: center;
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 1.25rem;
    height: 2.25rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    touch-action: manipulation;
    width: 2.25rem;
}

.bfb-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.bfb-quantity {
    align-items: center;
    background: var(--bfb-soft);
    display: inline-flex;
    font-weight: 700;
    font-size: 1rem;
    height: 2.25rem;
    justify-content: center;
    min-width: 2.2rem;
    border-radius: 0;
}

.bfb-subtotal {
    background: var(--bfb-soft);
    border-top: 1px solid var(--bfb-border);
    margin-top: auto;
    padding: 0.75rem 0.9rem;
    text-align: right;
}

.bfb-reset-wrap {
    margin-top: 1rem;
    text-align: right;
}

.bfb-reset .bi {
    margin-right: 0.35rem;
}

.bfb-total {
    align-items: center;
    background: var(--bfb-accent);
    border-radius: var(--bfb-radius);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    font-size: 1.05rem;
    gap: 0.65rem 2rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    position: sticky;
    bottom: 0.5rem;
    z-index: 10;
}

.bfb-notice,
.bfb-diagnostics {
    border: 1px solid #c8d8e2;
    border-radius: 0.5rem;
    margin-block: 1rem;
    padding: 0.8rem 1rem;
}

.bfb-notice--info {
    background: #eef7fc;
}

.bfb-notice--warning,
.bfb-diagnostics {
    background: #fff5df;
    border-color: #e5c87c;
    color: #594410;
}

.bfb-order .visually-hidden {
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    overflow: hidden !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

@media (max-width: 600px) {
    .bfb-preview-link,
    .bfb-preview-frame {
        height: min(var(--bfb-image-max-height), 75vw);
        min-height: 11rem;
    }

    .bfb-options-table {
        font-size: 0.84rem;
    }

    .bfb-options-table th,
    .bfb-options-table td {
        padding-inline: 0.25rem;
    }

    .bfb-format-label {
        white-space: normal;
    }

    .bfb-stepper {
        grid-template-columns: 2.1rem 2rem 2.1rem;
    }

    .bfb-button,
    .bfb-quantity {
        height: 2.2rem;
    }

    .bfb-button {
        width: 2.1rem;
    }

    .bfb-total {
        align-items: flex-end;
        flex-direction: column;
        gap: 0.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bfb-preview {
        transition: none;
    }
}
