/* Aufkleberdesigner – Produktseite und Editor */

/* Schutz gegen fremde Regeln (Theme/andere Plugins), die Elemente im Kaufformular ausblenden */
#productDetailPageBuyProductForm > .bb-stk[data-aufkleberdesigner],
.buy-widget > .bb-stk[data-aufkleberdesigner],
.bb-stk[data-aufkleberdesigner] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.bb-stk {
    --bb-stk-accent: var(--bs-primary, #0b6bcb);
    --bb-stk-border: #dde1e6;
    --bb-stk-muted: #6b7280;
    --bb-stk-stage: #eef0f3;
    margin-bottom: 1rem;
}

.bb-stk-headline {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: .25rem;
}

.bb-stk-description {
    color: var(--bb-stk-muted);
    font-size: .9rem;
    margin-bottom: .5rem;
}

.bb-stk-teaser {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: .5rem;
    background: var(--bb-stk-stage);
    border: 1px dashed #c3c9d1;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}

.bb-stk-teaser:hover,
.bb-stk-teaser:focus-visible {
    border-color: var(--bb-stk-accent);
}

.bb-stk-teaser-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.bb-stk-teaser-preview canvas {
    display: block;
    max-width: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .15));
}

.bb-stk-teaser-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .85);
    color: var(--bb-stk-muted);
    font-size: .875rem;
    white-space: nowrap;
}

.bb-stk-open {
    width: 100%;
}

.bb-stk-status {
    min-height: 1.25rem;
    margin-top: .35rem;
    font-size: .85rem;
    color: var(--bb-stk-muted);
}

.bb-stk-status.is-busy::before {
    content: "";
    display: inline-block;
    width: .85em;
    height: .85em;
    margin-right: .4em;
    vertical-align: -.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bb-stk-spin .8s linear infinite;
}

.bb-stk-error {
    color: var(--bs-danger, #c0392b);
    font-weight: 600;
}

/* ---------------- Editor ---------------- */

body.bb-stk-no-scroll {
    overflow: hidden;
}

.bb-stk-modal {
    --bb-stk-accent: var(--bs-primary, #0b6bcb);
    --bb-stk-border: #dde1e6;
    --bb-stk-muted: #6b7280;
    --bb-stk-stage: #eef0f3;
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(17, 24, 39, .55);
}

@media (min-width: 992px) {
    .bb-stk-modal {
        align-items: center;
    }
}

.bb-stk-modal[hidden] {
    display: none;
}

.bb-stk-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

@media (min-width: 992px) {
    .bb-stk-dialog {
        height: min(860px, calc(100% - 40px));
        max-width: 1320px;
        margin: 20px;
        border-radius: 12px;
        overflow: hidden;
    }
}

.bb-stk-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bb-stk-border);
}

.bb-stk-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.bb-stk-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-stk-tools {
    display: flex;
    gap: 6px;
}

.bb-stk-tool,
.bb-stk-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 6px;
    background: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.bb-stk-tool:disabled {
    opacity: .4;
    cursor: default;
}

.bb-stk-close {
    font-size: 26px;
}

.bb-stk-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .bb-stk-body {
        flex-direction: row;
    }
}

.bb-stk-stagecol {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

@media (max-width: 991.98px) {
    .bb-stk-stagecol {
        flex: 0 0 auto;
    }
}

.bb-stk-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 34vh;
    background:
        linear-gradient(45deg, rgba(0, 0, 0, .025) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .025) 75%),
        linear-gradient(45deg, rgba(0, 0, 0, .025) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, .025) 75%),
        var(--bb-stk-stage);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .bb-stk-stage {
        flex: 0 0 46vh;
    }
}

.bb-stk-canvas {
    position: absolute;
    inset: 0;
    display: block;
    touch-action: none;
    outline: none;
}

.bb-stk-hint {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    max-width: calc(100% - 20px);
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .9);
    color: #8a1c27;
    font-size: .75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    pointer-events: none;
}

.bb-stk-toast {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translate(-50%, -10px);
    max-width: calc(100% - 24px);
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(17, 24, 39, .92);
    color: #fff;
    font-size: .875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.bb-stk-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.bb-stk-busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, .7);
    font-weight: 600;
}

.bb-stk-busy[hidden] {
    display: none;
}

.bb-stk-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--bb-stk-accent);
    border-right-color: transparent;
    border-radius: 50%;
    animation: bb-stk-spin .8s linear infinite;
}

@keyframes bb-stk-spin {
    to {
        transform: rotate(360deg);
    }
}

.bb-stk-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    border-top: 1px solid var(--bb-stk-border);
}

@media (min-width: 992px) {
    .bb-stk-panel {
        flex: 0 0 45%;
        min-width: 440px;
        max-width: 580px;
        border-top: 0;
        border-left: 1px solid var(--bb-stk-border);
    }

    /* Designfläche als ruhige Karte mit Rand: weniger hoch und etwas schmaler */
    .bb-stk-stagecol {
        padding: 20px;
        background: #f8f9fb;
    }

    .bb-stk-stage {
        border: 1px solid var(--bb-stk-border);
        border-radius: 10px;
    }
}

.bb-stk-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--bb-stk-border);
}

.bb-stk-section:last-child {
    border-bottom: 0;
}

.bb-stk-section-title {
    margin: 0 0 8px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bb-stk-muted);
}

.bb-stk-muted {
    color: var(--bb-stk-muted);
    font-size: .85rem;
}

.bb-stk-backgrounds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
}

.bb-stk-bg {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid var(--bb-stk-border);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}

.bb-stk-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bb-stk-bg.is-none span {
    font-size: .75rem;
    color: var(--bb-stk-muted);
}

.bb-stk-bg.is-active {
    border-color: var(--bb-stk-accent);
    box-shadow: 0 0 0 2px var(--bb-stk-accent);
}

.bb-stk-layers {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bb-stk-layer {
    margin-bottom: 4px;
}

.bb-stk-layer-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 6px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.bb-stk-layer.is-active .bb-stk-layer-main {
    border-color: var(--bb-stk-accent);
    background: rgba(11, 107, 203, .06);
}

.bb-stk-layer-icon {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--bb-stk-stage);
    font-weight: 700;
    font-size: .8rem;
    line-height: 22px;
    text-align: center;
}

.bb-stk-layer-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-stk-warn-dot {
    flex: 0 0 18px;
    height: 18px;
    border-radius: 50%;
    background: #f0ad4e;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.bb-stk-field {
    display: block;
    margin-bottom: 12px;
}

.bb-stk-field-label {
    display: block;
    margin-bottom: 4px;
    font-size: .85rem;
    font-weight: 600;
}

.bb-stk-slider-value {
    font-weight: 400;
    color: var(--bb-stk-muted);
}

.bb-stk-color-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.bb-stk-color {
    width: 44px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.bb-stk-align .btn {
    font-size: .8rem;
}

.bb-stk-image-name {
    margin-bottom: 10px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.bb-stk-dpi {
    margin: -4px 0 12px;
    font-size: .82rem;
    color: var(--bb-stk-muted);
}

.bb-stk-dpi.is-warning {
    padding: 6px 8px;
    border-radius: 6px;
    background: #fff4e0;
    color: #8a5300;
}

.bb-stk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bb-stk-select-hint {
    padding: 12px 0;
}

.bb-stk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--bb-stk-border);
}

.bb-stk-done {
    min-width: 140px;
}

/* ---------------- Warenkorb / Bestellung ---------------- */

.bb-stk-summary {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: .25rem;
    font-size: .875rem;
}

.bb-stk-summary-preview img {
    display: block;
    width: 96px;
    max-height: 96px;
    object-fit: contain;
    border: 1px solid #e3e6ea;
    border-radius: 4px;
    background: #fff;
}

.bb-stk-summary-list {
    margin: 0;
    min-width: 0;
}

.bb-stk-summary-row {
    display: flex;
    gap: .35rem;
}

.bb-stk-summary-row dt {
    font-weight: 400;
    color: #6b7280;
    white-space: nowrap;
}

.bb-stk-summary-row dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.bb-stk-summary-swatch {
    display: inline-block;
    width: .85em;
    height: .85em;
    margin-right: .25em;
    border: 1px solid rgba(0, 0, 0, .3);
    border-radius: 50%;
    vertical-align: -.05em;
}

/* ---------------- Aufkleber: Form, Größe, Hintergrund ---------------- */

.bb-stk-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 8px;
    background: var(--bb-stk-stage);
}

.bb-stk-tab {
    flex: 1 1 auto;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: .82rem;
    font-weight: 600;
    color: var(--bb-stk-muted);
    cursor: pointer;
}

.bb-stk-tab.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.bb-stk-pane[hidden] {
    display: none;
}

.bb-stk-shapes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.bb-stk-shape {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 6px;
    border: 2px solid var(--bb-stk-border);
    border-radius: 8px;
    background: #fff;
    font-size: .72rem;
    line-height: 1.15;
    color: #374151;
    cursor: pointer;
}

.bb-stk-shape svg {
    width: 44px;
    height: 44px;
}

.bb-stk-shape path {
    fill: #f3f4f6;
    stroke: #374151;
    stroke-width: 1.5px;
}

.bb-stk-shape span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-stk-shape.is-active {
    border-color: var(--bb-stk-accent);
    box-shadow: 0 0 0 2px var(--bb-stk-accent);
}

.bb-stk-shape.is-active path {
    fill: rgba(11, 107, 203, .12);
    stroke: var(--bb-stk-accent);
}

.bb-stk-size-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.bb-stk-size-row .bb-stk-field {
    flex: 1;
    margin-bottom: 6px;
}

.bb-stk-size-x {
    padding-bottom: 14px;
    color: var(--bb-stk-muted);
}

.bb-stk-size-note {
    margin: 0 0 4px;
}

.bb-stk-size-result {
    margin: 0 0 6px;
    font-size: .85rem;
    font-weight: 600;
}

.bb-stk-size-result.is-warning {
    padding: 6px 8px;
    border-radius: 6px;
    background: #fff4e0;
    color: #8a5300;
    font-weight: 400;
}

.bb-stk-section p {
    margin-bottom: 6px;
}

.bb-stk-backgrounds {
    margin-bottom: 10px;
}

.bb-stk-bg-own {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.bb-stk-bg-own [hidden] {
    display: none;
}

.bb-stk-segment {
    display: flex;
    flex-wrap: wrap;
}

.bb-stk-segment .btn {
    font-size: .8rem;
}

.bb-stk-slider[hidden],
.bb-stk-field[hidden] {
    display: none;
}

/* ---------------- Fußzeile: Menge und Preis ---------------- */

.bb-stk-footer {
    flex-wrap: wrap;
}

.bb-stk-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bb-stk-qty-label {
    margin: 0;
    font-size: .85rem;
    font-weight: 600;
}

.bb-stk-qty-group {
    width: 150px;
    flex-wrap: nowrap;
}

.bb-stk-qty-input {
    text-align: center;
    min-width: 0;
}

.bb-stk-price-box {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 140px;
    line-height: 1.2;
}

.bb-stk-price-now {
    font-size: 1.2rem;
}

.bb-stk-price-detail {
    font-size: .8rem;
    color: var(--bb-stk-muted);
}

.bb-stk-panel-end {
    padding: 8px 0 4px;
    text-align: right;
}

.bb-stk-reset {
    padding: 0;
    font-size: .82rem;
    color: var(--bb-stk-muted);
}

@media (max-width: 575.98px) {
    .bb-stk-footer {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px 10px;
    }

    .bb-stk-qty-label {
        display: none;
    }

    .bb-stk-qty-group {
        width: 118px;
    }

    .bb-stk-qty-group .btn {
        padding-left: 8px;
        padding-right: 8px;
    }

    .bb-stk-price-box {
        min-width: 0;
    }

    .bb-stk-price-now {
        font-size: 1.05rem;
    }

    .bb-stk-price-detail {
        font-size: .72rem;
    }

    .bb-stk-done {
        min-width: 0;
        flex: 0 0 auto;
    }
}

/* ---------------- Preis im Kaufbereich ---------------- */

.bb-stk-price .bb-stk-price-total {
    margin-bottom: .1rem;
}

.bb-stk-price-unit {
    margin-bottom: .4rem;
    font-size: .85rem;
    color: #6b7280;
}

.bb-stk-tiers {
    width: 100%;
    max-width: 360px;
    margin-bottom: .75rem;
    font-size: .82rem;
    border-collapse: collapse;
}

.bb-stk-tiers caption {
    caption-side: top;
    text-align: left;
    padding: 0 0 .2rem;
    color: #6b7280;
    font-weight: 600;
}

.bb-stk-tiers td {
    padding: .15rem .5rem .15rem 0;
    border-bottom: 1px solid #eef0f3;
}

.bb-stk-tiers td:last-child {
    text-align: right;
    white-space: nowrap;
}

.bb-stk-tiers tr.is-active td {
    font-weight: 700;
}

.bb-stk-tiers-note td {
    border-bottom: 0;
    color: #6b7280;
}

/* ---------------- 1.2: rechte Spalte, Elemente, Zoom ---------------- */

/* Elemente */

.bb-stk-layer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.bb-stk-layer-actions .btn {
    flex: 1 1 auto;
    font-size: .8rem;
}

.bb-stk-layer-bg .bb-stk-layer-main {
    cursor: default;
    background: #f9fafb;
    border-style: dashed;
}

.bb-stk-layer-bg .btn-link {
    padding: 0 4px;
    font-size: .8rem;
    white-space: nowrap;
}

/* Größe mit Schloss */

.bb-stk-lock {
    flex: 0 0 34px;
    height: 34px;
    margin-bottom: 8px;
    padding: 6px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 6px;
    background: #fff;
    color: var(--bb-stk-muted);
    cursor: pointer;
}

.bb-stk-lock svg {
    display: block;
    width: 100%;
    height: 100%;
}

.bb-stk-lock.is-locked {
    color: var(--bb-stk-accent);
    border-color: var(--bb-stk-accent);
}

.bb-stk-lock:disabled {
    opacity: .55;
    cursor: default;
}

/* Farbwähler */

.bb-stk-color-pick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.bb-stk-color-pick .bb-stk-color {
    width: 52px;
    height: 36px;
}

.bb-stk-color-code {
    font-family: monospace;
    font-size: .85rem;
    color: var(--bb-stk-muted);
}

.bb-stk-row2 {
    display: flex;
    gap: 12px;
}

.bb-stk-row2 > .bb-stk-field:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.bb-stk-row2 > .bb-stk-field-color {
    flex: 0 0 auto;
}

/* Gruppen in den Eigenschaften */

.bb-stk-reset-fx {
    padding: 0;
    font-size: .82rem;
}

.bb-stk-panel-top {
    flex: 0 0 auto;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--bb-stk-border);
    background: #fff;
}

.bb-stk-panel-top .bb-stk-section-title {
    margin-top: 12px;
}

.bb-stk-panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 16px 16px;
    scroll-behavior: smooth;
}

.bb-stk-section[hidden] {
    display: none;
}

.bb-stk-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bb-stk-section-close {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--bb-stk-stage);
    color: #374151;
    font-size: 18px;
    line-height: 26px;
    cursor: pointer;
}

/* Hinzufügen */

.bb-stk-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bb-stk-tbtn {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 19px;
    background: #fff;
    color: #111827;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.bb-stk-tbtn:hover,
.bb-stk-tbtn:focus-visible {
    border-color: var(--bb-stk-accent);
    color: var(--bb-stk-accent);
}

.bb-stk-tbtn-icon {
    font-weight: 700;
}

/* Elemente-Liste (immer sichtbar) */

.bb-stk-panel-top .bb-stk-layers {
    max-height: 190px;
    overflow-y: auto;
}

@media (max-width: 991.98px) {
    .bb-stk-panel-top {
        padding: 8px 12px;
    }

    .bb-stk-panel-top .bb-stk-layers {
        max-height: 104px;
    }

    .bb-stk-tbtn {
        height: 34px;
        font-size: .82rem;
    }
}

.bb-stk-layer-row {
    display: flex;
    align-items: stretch;
    gap: 4px;
}

.bb-stk-layer-row .bb-stk-layer-main {
    flex: 1 1 auto;
    min-width: 0;
}

.bb-stk-eye {
    flex: 0 0 36px;
    padding: 7px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.bb-stk-eye svg {
    display: block;
    width: 100%;
    height: 100%;
}

.bb-stk-eye.is-off {
    color: #9ca3af;
}

.bb-stk-layer.is-hidden .bb-stk-layer-label,
.bb-stk-layer.is-hidden .bb-stk-layer-icon {
    opacity: .45;
    text-decoration: line-through;
}

.bb-stk-hidden-note {
    flex: 0 1 auto;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fff4e0;
    color: #8a5300;
    font-size: .78rem;
}

.bb-stk-hidden-note[hidden] {
    display: none;
}

/* Zoom */

.bb-stk-zoom {
    position: absolute;
    right: 10px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--bb-stk-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.bb-stk-zoom button {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.bb-stk-zoom button:hover {
    background: var(--bb-stk-stage);
}

.bb-stk-zoom .bb-stk-zoom-fit {
    font-size: .78rem;
    font-weight: 600;
}

.bb-stk-zoom-value {
    min-width: 46px;
    font-size: .78rem;
    text-align: center;
    color: var(--bb-stk-muted);
}

.bb-stk-hint {
    left: 10px;
    right: auto;
    transform: none;
    max-width: calc(100% - 220px);
}

@media (max-width: 575.98px) {
    .bb-stk-hint {
        display: none;
    }
}

/* Gruppen in den Eigenschaften (immer offen, zweispaltig) */

.bb-stk-group {
    margin: 4px 0 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--bb-stk-border);
}

.bb-stk-group-title {
    margin: 0 0 8px;
    font-size: .85rem;
    font-weight: 700;
}

.bb-stk-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.bb-stk-grid2 > :not(.bb-stk-slider):not(.bb-stk-half) {
    grid-column: 1 / -1;
}

.bb-stk-grid2 > .bb-stk-slider[hidden] {
    display: none;
}

.bb-stk-header .bb-stk-tools {
    margin-left: auto;
}

/* ---------------- 1.3: großzügigere, aufgeräumte Einstellungen ---------------- */

@media (min-width: 992px) {
    .bb-stk-panel-top {
        padding: 18px 24px 14px;
    }

    .bb-stk-panel-scroll {
        padding: 0 24px 20px;
    }
}

.bb-stk-panel .bb-stk-section {
    padding: 18px 0;
}

.bb-stk-panel .bb-stk-section-title {
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--bb-stk-border);
    color: #374151;
}

.bb-stk-panel-top .bb-stk-section-title {
    margin-top: 14px;
}

.bb-stk-panel-top .bb-stk-section-title:first-child {
    margin-top: 0;
}

.bb-stk-panel .bb-stk-field {
    margin-bottom: 14px;
}

.bb-stk-layer-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.bb-stk-layer-actions-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bb-stk-layer-actions .btn {
    min-height: 34px;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-stk-layer-actions .btn:disabled {
    opacity: .45;
}

.bb-stk-grid2 {
    gap: 2px 18px;
}

/* ---------------- 1.4: größeres Fenster, Einstellungen unter der Designfläche ---------------- */

.bb-stk-panel-scroll {
    padding: 0 16px 16px;
}

.bb-stk-panel .bb-stk-section.bb-stk-insert .bb-stk-section-title,
.bb-stk-panel .bb-stk-section.bb-stk-layers-block .bb-stk-section-title {
    display: block;
}

.bb-stk-under-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 28px;
}

.bb-stk-under .bb-stk-section {
    padding: 18px 0;
    border-bottom: 1px solid var(--bb-stk-border);
}

.bb-stk-under .bb-stk-section-title {
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--bb-stk-border);
    color: #374151;
}

.bb-stk-under .bb-stk-field {
    margin-bottom: 14px;
}

.bb-stk-under-grid > .bb-stk-section {
    min-width: 0;
}

@media (min-width: 992px) {
    .bb-stk-dialog {
        height: calc(100% - 32px);
        max-width: 1640px;
        margin: 16px;
    }

    .bb-stk-stagecol {
        display: block;
        overflow-y: auto;
        padding: 20px 28px 8px;
        scroll-behavior: smooth;
    }

    /* Designfläche bleibt so groß wie bisher, darunter scrollen die übrigen Einstellungen */
    .bb-stk-stage {
        height: clamp(300px, calc(100vh - 230px), 680px);
        max-width: 860px;
        margin: 0 auto;
    }

    .bb-stk-under {
        max-width: 860px;
        margin: 6px auto 0;
    }

    .bb-stk-under-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bb-stk-under-grid > .bb-stk-section {
        border-bottom: 0;
    }

    .bb-stk-panel {
        flex: 0 0 40%;
        min-width: 400px;
        max-width: 540px;
    }

    .bb-stk-panel-scroll {
        padding: 0 24px 20px;
    }
}

.bb-stk-layers-block .bb-stk-layers {
    overflow-y: auto;
}

/* ---------------- 1.5 ---------------- */

/* Grundformen in einer Zeile */
.bb-stk-shapes-row {
    gap: 6px;
}

.bb-stk-shapes-row .bb-stk-shape {
    min-width: 0;
    padding: 6px 2px 5px;
}

.bb-stk-shapes-row .bb-stk-shape svg {
    width: 100%;
    max-width: 40px;
    height: auto;
    aspect-ratio: 1;
}

.bb-stk-shapes-row .bb-stk-shape span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .68rem;
}

/* „Neu beginnen“ oben */
.bb-stk-panel-start {
    padding: 14px 0 2px;
    text-align: right;
}

.bb-stk-panel .bb-stk-panel-start + .bb-stk-section {
    padding-top: 4px;
}

/* Text direkt in der Elemente-Liste bearbeiten */
.bb-stk-layer-main-text {
    cursor: text;
}

.bb-stk-layer-text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1px 2px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.4;
    resize: none;
    overflow: hidden;
    outline: none;
}

.bb-stk-layer-text:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(11, 107, 203, .25);
}

.bb-stk-layer.is-hidden .bb-stk-layer-text {
    color: var(--bb-stk-muted);
    text-decoration: line-through;
}

/* Verformen | Effekte nebeneinander */
.bb-stk-fx-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 32px;
}

@media (min-width: 768px) {
    .bb-stk-under .bb-stk-fx-cols {
        grid-template-columns: 1fr 1fr;
    }
}

.bb-stk-fx-col {
    min-width: 0;
}

.bb-stk-fx-title {
    margin: 4px 0 10px;
    font-size: .95rem;
    font-weight: 700;
}

.bb-stk-fx-col .bb-stk-group:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.bb-stk-fx-col .bb-stk-segment {
    display: flex;
    width: 100%;
}

.bb-stk-fx-col .bb-stk-segment .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 4px;
    padding-right: 4px;
    font-size: .8rem;
}

.bb-stk-reset-fx-row {
    margin: 4px 0 8px;
    text-align: right;
}

/* Anzahl: breiter, ohne Pfeile */
.bb-stk-qty-group {
    width: 200px;
}

.bb-stk-qty-input {
    font-size: 1rem;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}

.bb-stk-qty-input::-webkit-inner-spin-button,
.bb-stk-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 575.98px) {
    .bb-stk-qty-group {
        width: 150px;
    }
}

/* Staffelpreise (Formel: viele Staffeln) */
.bb-stk-price-tiers {
    position: relative;
    max-height: 260px;
    overflow-y: auto;
}

/* ---------------- 1.8: Staffeln als Buttons (Preisformel) ---------------- */

.bb-stk-tier-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px;
    margin: .5rem 0 1rem;
}

.bb-stk-price-tiers.bb-stk-tier-buttons {
    max-height: none;
    overflow: visible;
}

.bb-stk-tier {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--bb-stk-border, #d1d5db);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    text-align: left;
    line-height: 1.2;
    cursor: pointer;
}

.bb-stk-tier:hover,
.bb-stk-tier:focus-visible {
    border-color: var(--bb-stk-accent, #0b6bcb);
}

.bb-stk-tier.is-active {
    border-color: var(--bb-stk-accent, #0b6bcb);
    box-shadow: 0 0 0 1px var(--bb-stk-accent, #0b6bcb);
    background: rgba(11, 107, 203, .06);
}

.bb-stk-tier-qty {
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
}

.bb-stk-tier-total {
    font-size: 1rem;
    font-weight: 700;
}

.bb-stk-tier-unit {
    font-size: .75rem;
    color: #6b7280;
}

/* im Designer unten: eine Zeile, seitlich scrollbar */
.bb-stk-qty-tiers {
    flex: 1 1 auto;
    min-width: 0;
}

.bb-stk-tier-buttons.is-compact {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    padding: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.bb-stk-tier-buttons.is-compact .bb-stk-tier {
    flex: 0 0 auto;
    padding: 5px 10px;
}

.bb-stk-tier-buttons.is-compact .bb-stk-tier-total {
    font-size: .85rem;
}

.bb-stk-qty-tiers + .bb-stk-price-box {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .bb-stk-qty-tiers {
        flex: 1 1 100%;
    }
}

@media (max-width: 767.98px) {
    .bb-stk-footer:has(.bb-stk-qty-tiers) {
        flex-wrap: wrap;
        row-gap: 8px;
    }
}

/* ---------------- 2.0: Keine Grundform / Kontur berechnen ---------------- */

.bb-stk-stage.is-cut {
    background: #c9ccd1;
}

.bb-stk-shape-none-icon {
    display: block;
    width: 100%;
    max-width: 40px;
    color: #6b7280;
}

.bb-stk-shape-none-icon svg {
    display: block;
    width: 100%;
    height: auto;
}

.bb-stk-contour-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 8px;
}

.bb-stk-contour-actions .btn {
    flex: 1 1 auto;
}

.bb-stk-contour-actions .btn[hidden] {
    display: none;
}

.bb-stk-contour-calc.is-attention {
    box-shadow: 0 0 0 3px rgba(230, 120, 0, .35);
}

.bb-stk-contour-note {
    margin: 0 0 8px;
    font-size: .82rem;
    color: #6b7280;
}

.bb-stk-contour-note.is-warning {
    color: #b45309;
    font-weight: 600;
}

/* Stückpreise je Staffel (Produktseite) */
.bb-stk-tier-line {
    margin: .25rem 0 .75rem;
    font-size: .78rem;
    line-height: 1.45;
    color: #6b7280;
}

.bb-stk-tier-line-label {
    font-weight: 600;
}

/* Spiegeln */
.bb-stk-flip-row {
    display: flex;
    gap: 6px;
    margin: 0 0 12px;
}

.bb-stk-flip-row .btn {
    flex: 1 1 0;
    font-size: .8rem;
}

.bb-stk-flip-row .btn.is-on {
    border-color: var(--bb-stk-accent);
    color: var(--bb-stk-accent);
    background: rgba(11, 107, 203, .06);
}

/* KI-Bild: Knopf und Abschnitt (das Eingabefeld selbst gestaltet das Plugin „KI-Bilder“) */
.bb-stk-tbtn-ai .bb-stk-tbtn-icon {
    color: var(--bb-stk-accent);
}

.bb-stk-ai-host {
    min-width: 0;
}

.bb-stk-tbtn[hidden] {
    display: none !important;
}
