/*
 * TKA-HOTFIX-PDP-ALIGN-01 · PDP buy area, fixed sizes (house rules: DESIGN.md "PDP buy area - fixed sizes").
 * One shared stylesheet for the buy boxes of the theme (v1, v2). Plain CSS, strict CSP, no Tailwind rebuild.
 *   qty stepper   one boxed control, 52 px high, three equal 44 px cells, radius 8 px (= button radius)
 *   buy button    at least 52 px high, label on ONE line, 16 px semibold, icon 20 px, gap 8 px; sentence case below 768 px
 *   payment marks 24 px high, one 1 px light frame, radius 4 px, centred under the buy button (not under the whole box)
 * The live configurator keeps its own tokens (live.css): the v1/v2 rules below are fenced off from it and from v3 with
 * :not(.bb3 *) / :not(.tka-live-pay__marks *). TKA-PDP-ALIGN-02: the last section gives the One Buybox (v3, .bb3, also the
 * tile PDPs) the same sizes with its own control colour (#8C8479, 3:1 on white), at a higher specificity than buybox3.css.
 */
.tka-qty:not(.bb3 *) {
    box-sizing: border-box;
    display: inline-grid;
    grid-template-columns: repeat(3, 44px);
    flex: none;
    height: 52px;
    border: 1px solid #4F4F4F;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.tka-qty:not(.bb3 *) > button,
.tka-qty:not(.bb3 *) > input {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #1F1D1A;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
    -moz-appearance: textfield;
}
.tka-qty:not(.bb3 *) > input::-webkit-outer-spin-button,
.tka-qty:not(.bb3 *) > input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.tka-qty:not(.bb3 *) > button:focus-visible,
.tka-qty:not(.bb3 *) > input:focus-visible {
    outline: 3px solid #1F1D1A;
    outline-offset: -3px;
}
/* the buy row (stepper + button): a two column grid [auto 1fr], 12 px between, both 52 px high; the button fills column 2.
   Structural hooks (:has) so one rule serves every template that prints the stepper block; only the direct wrappers of the
   button are widened (not the modal or anything else inside the component). */
div:has(> div > div > .tka-qty):not(.bb3 *) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    max-height: none;
}
div:has(> div > div > .tka-qty):not(.bb3 *) > div:has(> div > #main-cta-row),
div:has(> div > div > .tka-qty):not(.bb3 *) > div:has(> div > #main-cta-row) > div,
div:has(> div > div > .tka-qty):not(.bb3 *) #main-cta-row {
    width: 100%;
    min-width: 0;
}
div:has(> div > div > .tka-qty):not(.bb3 *) #product-addtocart-button-regular {
    width: 100%;
}
#product-addtocart-button-regular:not(.bb3 *) {
    min-height: 52px;
    gap: 0.5rem;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    white-space: nowrap;
}
#product-addtocart-button-regular:not(.bb3 *) svg {
    flex: none;
    width: 20px;
    height: 20px;
}
@media (max-width: 767.98px) {
    #product-addtocart-button-regular:not(.bb3 *) {
        text-transform: none;
        padding-inline: 0.75rem;
    }
}
/* payment marks: one size, one frame, 12 px above, 8 px between */
.tka-pay-mark:not(.bb3 *):not(.tka-live-pay__marks *) {
    box-sizing: border-box;
    display: block;
    height: 24px;
    width: auto;
    border: 1px solid #D8D8D8;
    border-radius: 4px;
    background: #fff;
    object-fit: contain;
}
.tka-pay-marks:not(.bb3 *):not(.tka-live-pay__marks) {
    gap: 0.5rem;
    margin-top: 0.75rem;
}
/* under the buy button: stepper 134 px (132 + 2 border) + 12 px gap = 146 px */
*:has(.tka-qty):not(.bb3 *) + .tka-pay-marks:not(.bb3 *) {
    margin-left: 146px;
}
/* below 360 px the buy row stacks (as v2 already did): stepper above, full width button and marks below, so the label fits */
@media (max-width: 359px) {
    div:has(> div > div > .tka-qty):not(.bb3 *) {
        grid-template-columns: minmax(0, 1fr);
    }
    *:has(.tka-qty):not(.bb3 *) + .tka-pay-marks:not(.bb3 *) {
        margin-left: 0;
    }
}

/* ---- TKA-PDP-ALIGN-02 · One Buybox v3 (.bb3) and the tile PDPs ------------------------------------------------------
   Same fixed sizes as above. Below 1024 px the marks of v3 stay one full-width row under stepper and button (HOTFIX-PAYMARKS-02:
   six 24 px marks do not fit under the button of a phone); from 1024 px they sit in column 2, centred under the button. */
.bb3 .tka-qty,
.bb3 .bb3-stepper {
    box-sizing: border-box;
    display: inline-grid;
    grid-template-columns: repeat(3, 44px);
    flex: none;
    gap: 0;
    height: 52px;
    border: 1px solid var(--bb3-control, #8C8479);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.bb3 .tka-qty > .bb3-qty-btn,
.bb3 .tka-qty > .bb3-qty-input,
.bb3 .bb3-stepper > .bb3-step,
.bb3 .bb3-stepper > .bb3-input--qty {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}
.bb3 .bb3-stepper > .bb3-step {
    font-size: 20px;
    font-weight: 400;
}
.bb3 .tka-qty > .bb3-qty-btn:focus-visible,
.bb3 .tka-qty > .bb3-qty-input:focus-visible,
.bb3 .bb3-stepper > .bb3-step:focus-visible,
.bb3 .bb3-stepper > .bb3-input--qty:focus-visible {
    outline: 3px solid var(--bb3-focus, #1F1D1A);
    outline-offset: -3px;
}
.bb3 .bb3-buy {
    align-items: stretch;
}
/* one line for "In winkelwagen"; a long "choose your option" label (DE, ES) wraps to at most two balanced lines inside the 52 px */
.bb3 .bb3-buy #product-addtocart-button-regular {
    min-height: 52px;
    gap: 0.5rem;
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    padding-block: 4px;
    text-wrap: balance;
}
/* 8 px grid row gap (buybox3.css) + 4 px = 12 px above the marks */
.bb3 .bb3-buy .bb3-pay.tka-pay-marks {
    gap: 0.5rem;
    min-height: 24px;
    margin-top: 0.25rem;
}
.bb3 .bb3-pay--marks img.tka-pay-mark {
    box-sizing: border-box;
    height: 24px;
    width: auto;
    border: 1px solid #D8D8D8;
    border-radius: 4px;
    background: #fff;
    object-fit: contain;
}
@media (min-width: 1024px) {
    .bb3 .bb3-buy .bb3-pay.tka-pay-marks {
        grid-column: 2;
    }
    .bb3 .bb3-buy--single .bb3-pay.tka-pay-marks {
        grid-column: 1;
    }
}
