.cpo,
.cpo-notice {
    /* The theme lays the add-to-cart area out as flex; with inline-size
       containment the form has no width of its own, so claim the full row. */
    flex: 0 0 100%;
    width: 100%;
    container-type: inline-size;
    --cpo-green: #2c4c35;
    --cpo-green-soft: #dfecd8;
    --cpo-line: #e3e2d9;
    --cpo-muted: #f3f2ec;
    --cpo-text: #1f1f1f;
}

.cpo {
    /* A fine line above each section. With the theme's 15px row gap
       between the sections that leaves about 24px on both sides of it. */
    margin: 9px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--cpo-line);
    color: var(--cpo-text);
}

.cpo-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 600;
}

.cpo-step {
    flex: none;
    width: 32px;
    height: 32px;
    border: 2px solid var(--cpo-line);
    border-radius: 50%;
    position: relative;
}

.cpo.is-done .cpo-step {
    border-color: #6cc24a;
    background: #6cc24a;
}

.cpo.is-done .cpo-step::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 5px;
    width: 8px;
    height: 14px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.cpo-body {
    padding-left: 46px;
}

.cpo-position {
    margin: 0 0 22px;
}

.cpo-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 12px;
}

.cpo-legend {
    font-size: 16px;
    font-weight: 600;
}

.cpo-help {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--cpo-green-soft);
    color: var(--cpo-green);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    cursor: pointer;
}

.cpo-tip {
    max-width: 320px;
    margin: auto;
    color: var(--cpo-text);
    padding: 12px 14px;
    border: 1px solid var(--cpo-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    font-size: 14px;
    line-height: 1.45;
}

.cpo-tip.is-anchored {
    inset: auto;
    margin: 0;
}

.cpo-badge {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--cpo-green-soft);
    color: var(--cpo-green);
    font-size: 13px;
    font-weight: 600;
}

.cpo-tech {
    display: inline-flex;
    margin-left: auto;
    padding: 3px;
    border: 1px solid var(--cpo-line);
    border-radius: 999px;
    background: var(--cpo-muted);
}

.cpo-tech label {
    margin: 0;
    padding: 6px 16px;
    border-radius: 999px;
    color: #7a7a72;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.cpo-tech input:checked + label {
    background: #fff;
    color: var(--cpo-green);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.cpo-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cpo-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cpo-pill {
    margin: 0;
    padding: 9px 20px;
    border: 2px solid var(--cpo-line);
    border-radius: 999px;
    background: #fff;
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.cpo-pill:hover {
    border-color: #c9c8bc;
}

.cpo-radio:checked + .cpo-pill {
    border-color: var(--cpo-green);
    background: var(--cpo-green);
    color: #fff;
}

.cpo-radio:focus-visible + label {
    outline: 2px solid var(--cpo-green);
    outline-offset: 2px;
}

.cpo-select {
    min-width: 220px;
    height: auto;
    margin: 0;
    padding: 9px 44px 9px 20px;
    border: 2px solid var(--cpo-line);
    /* Fields follow the theme's central rounding, like the other selects on the page. */
    border-radius: var(--cantana-radius, 10px);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232c4c35' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 18px center;
    font-size: 15px;
    line-height: 1.3;
    appearance: none;
    cursor: pointer;
}

.cpo-select:focus-visible {
    outline: 2px solid var(--cpo-green);
    outline-offset: 2px;
}

.cpo-sizes {
    margin-top: 12px;
}

/* Embroidery area: slider over the fixed sizes, dimensions as input aid.
   Type follows the form: 14px like the buttons, 13px like hints and switches. */
.cpo-area {
    margin-top: 12px;
    padding: 20px 22px 18px;
    border: 1px solid var(--cpo-line);
    border-radius: var(--cantana-radius, 10px);
    background: #f6f5f0;
}

.cpo-area-value {
    margin: 0;
    color: var(--cpo-green);
    font-size: 14px;
    font-weight: 700;
}

.cpo-area-example {
    margin: 2px 0 0;
    color: #77766f;
    font-size: 13px;
    line-height: 1.45;
}

.cpo-range {
    --cpo-thumb: 24px;
    display: block;
    width: 100%;
    height: var(--cpo-thumb);
    margin: 18px 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Fill up to the thumb's centre, which travels between half a thumb from each end. */
.cpo-range::-webkit-slider-runnable-track {
    height: 10px;
    border: 1px solid #d8d6cd;
    border-radius: 999px;
    background: linear-gradient(to right,
        var(--cpo-green) calc(var(--cpo-thumb) / 2 + (100% - var(--cpo-thumb)) * var(--cpo-p, 0)),
        #ebeae4 0);
}

.cpo-range::-webkit-slider-thumb {
    width: var(--cpo-thumb);
    height: var(--cpo-thumb);
    margin-top: -8px;
    border: 0;
    border-radius: 50%;
    background: var(--cpo-green);
    -webkit-appearance: none;
}

.cpo-range::-moz-range-track {
    height: 10px;
    border: 1px solid #d8d6cd;
    border-radius: 999px;
    background: #ebeae4;
}

.cpo-range::-moz-range-progress {
    height: 10px;
    border-radius: 999px;
    background: var(--cpo-green);
}

.cpo-range::-moz-range-thumb {
    width: var(--cpo-thumb);
    height: var(--cpo-thumb);
    border: 0;
    border-radius: 50%;
    background: var(--cpo-green);
}

.cpo-range:focus-visible {
    outline: 2px solid var(--cpo-green);
    outline-offset: 4px;
}

/* One tick per size, aligned with the thumb's centre positions. */
.cpo-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 11px;
}

.cpo-ticks span {
    width: 2px;
    height: 10px;
    border-radius: 1px;
    background: #cfcdc4;
}

.cpo-ticks span.is-on {
    background: var(--cpo-green);
}

.cpo-range-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: #77766f;
    font-size: 12px;
}

.cpo-dims > summary {
    display: inline-block;
    margin-top: 16px;
    border-bottom: 2px solid #c9d2c4;
    color: var(--cpo-green);
    font-size: 13px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.cpo-dims > summary::-webkit-details-marker {
    display: none;
}

.cpo-dims-hide,
.cpo-dims[open] .cpo-dims-show {
    display: none;
}

.cpo-dims[open] .cpo-dims-hide {
    display: inline;
}

.cpo-dims-fields {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: #77766f;
    font-size: 13px;
}

.cpo-dims-fields span {
    white-space: nowrap;
}

.cpo-dims-fields input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 104px;
    margin: 0;
    background: #fff;
    border-radius: var(--cantana-radius, 10px);
}

.cpo-dims-result {
    margin: 12px 0 0;
    color: var(--cpo-green);
    font-size: 13px;
    font-weight: 700;
}

.cpo-dims-result:empty {
    display: none;
}

.cpo-sizes-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #55554f;
}

.cpo-more {
    margin: 0 0 22px;
}

.cpo-more > summary {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 10px 22px;
    border: 2px dashed var(--cpo-line);
    border-radius: 999px;
    color: var(--cpo-green);
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.cpo-more > summary::-webkit-details-marker {
    display: none;
}

/* "+" drawn as two bars, so turning it into "×" keeps it in place; it sits
   on the first line when the label wraps. */
.cpo-more-icon {
    position: relative;
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 5px;
    margin-top: calc((1lh - 12px) / 2);
    transition: transform .2s;
}

.cpo-more-icon::before,
.cpo-more-icon::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    width: 12px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

.cpo-more-icon::after {
    transform: rotate(90deg);
}

.cpo-more[open] .cpo-more-icon {
    transform: rotate(45deg);
}

.cpo-more-hide,
.cpo-more[open] .cpo-more-show {
    display: none;
}

.cpo-more[open] .cpo-more-hide {
    display: inline;
}

/* The space below the last field comes from the line of the next section. */
.cpo-body > :last-child,
.cpo-more:not([open]) > summary,
.cpo-more > .cpo-position:last-child {
    margin-bottom: 0;
}

/* Stückzahl: WooCommerce's quantity field, optionally split by size. */
/* The switch below the heading has no tall Druck/Stick switch beside it,
   so it needs a little more room to look like the other sections. */
.cpo-qty .cpo-title {
    margin-bottom: 24px;
}

.cpo-qty-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    border: 1px solid var(--cpo-line);
    border-radius: 999px;
    background: var(--cpo-muted);
}

.cpo-qty-mode label {
    margin: 0;
    padding: 5px 10px;
    line-height: 1.4;
    border-radius: 999px;
    color: #7a7a72;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.cpo-qty-mode input:checked + label {
    background: #fff;
    color: var(--cpo-green);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.cpo-qty-grid {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.cpo-qty-size {
    padding: 10px 6px;
    border: 1px solid var(--cpo-line);
    border-radius: var(--cantana-radius, 10px);
    background: #fff;
    text-align: center;
}

.cpo-qty-size.is-set {
    background: #f2f6ee;
}

.cpo-qty-size-name {
    display: block;
    margin-bottom: 6px;
    color: var(--cpo-green);
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.cpo-qty-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cpo-qty-btn {
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--cpo-line);
    border-radius: 50%;
    background: #fff;
    color: var(--cpo-green);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.cpo-qty .cpo-qty-stepper input {
    width: 34px;
    min-width: 0;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.cpo-qty-empty {
    margin: 10px 0 0;
    color: #b3261e;
    font-size: 14px;
}

.cpo-qty-empty:empty {
    display: none;
}

.cpo-qty-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

/* The theme's quantity field, styled as the green stepper. The !important
   overrides answer the child theme's own !important rules for the old quantity
   (hidden +/−, 80px wide, 15px indent), which stay while products on TM EPO use
   them; remove both together once every print product has a profile. */
.cpo.cpo-qty .cpo-qty-row .quantity {
    display: inline-flex;
    align-items: stretch;
    height: 40px;
    /* One class more than the theme's ".single-product-content .cart .quantity". */
    margin: 0 !important;
    overflow: hidden;
    border: 2px solid var(--cpo-green);
    border-radius: 999px;
    background: var(--cpo-green);
}

.cpo.cpo-qty .quantity .minus,
.cpo.cpo-qty .quantity .plus {
    display: block !important;
    width: 40px;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.cpo.cpo-qty .quantity input.qty {
    width: 56px !important;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: var(--cpo-text);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
}

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

/* "Nach Größen": size tiles, and the total follows them and cannot be typed. */
.cpo-qty.is-sizes .cpo-qty-grid {
    display: grid;
}

@supports selector(:has(*)) {
    .cpo-qty:has(input[name="cpo[qty_mode]"][value="sizes"]:checked) .cpo-qty-grid {
        display: grid;
    }
}

.cpo.cpo-qty.is-sizes .quantity {
    border-color: #8fa293;
    background: #8fa293;
}

.cpo.cpo-qty.is-sizes .quantity .minus,
.cpo.cpo-qty.is-sizes .quantity .plus {
    cursor: default;
}

.cpo.cpo-qty.is-sizes .quantity input.qty {
    color: #7b8a7f;
}

.cpo-qty-unit {
    color: var(--cpo-text);
    font-size: 14px;
    font-weight: 600;
}

.cpo-hint {
    margin: 6px 0 0;
    font-size: 13px;
    color: #6b6b64;
}

/* 32px from the Stückzahl section to the button: the theme's 15px row gap on
   both sides of an empty ".clear", the button's own 5px, and this. */
.cpo-qty ~ .button_add_to_quote {
    margin-top: -3px;
}

/* Below the add-to-quote button: "100% kostenlos & unverbindlich · Sofort-Angebot als PDF".
   Between the button and this sit the button's 10px margin and an empty
   ".clear" with the theme's 15px row gap on both sides; -26px leaves 14px. The
   theme pulls its "oder" row up by one gap, so the bottom margin is all of it. */
.cpo-notice {
    margin: -26px 0 24px;
}

.cpo-notice-row {
    display: flex;
    align-items: center;
    gap: 0 10px;
    margin: 0;
    color: var(--cpo-green);
    font-size: 13px;
    line-height: 1.4;
}

.cpo-notice-badge {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #6cc24a;
    color: #fff;
    font-size: 10px;
    font-style: italic;
    font-weight: 700;
    letter-spacing: -.02em;
}

.cpo-notice-free {
    font-style: italic;
    font-weight: 700;
}

.cpo-notice-pdf {
    font-weight: 600;
}

.cpo-notice-pdf::before {
    content: "\00b7";
    margin-right: 10px;
    color: #b9b8ae;
}

/* The product box on profile products: dark green frame and the
   "Ihr Angebot konfigurieren" bar across its top (CardHeader). The bar
   reaches the frame through the box's 20px padding. */
.single-product .product-image-summary .entry-summary {
    border-color: #2c4c35;
}

.cpo-card-head {
    container-type: inline-size;
    margin: -20px -20px 24px;
    border-radius: calc(var(--cantana-radius, 10px) - 3px) calc(var(--cantana-radius, 10px) - 3px) 0 0;
    background: #2c4c35;
    /* Covers the hairline of white that fractional widths leave between the
       bar and the frame, without reaching below the bar. */
    box-shadow: 0 -1px 0 1px #2c4c35;
    color: #fff;
}

.cpo-card-head-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 20px 20px 18px;
}

.single-product .cpo-card-title {
    flex: 1 1 auto;
    margin: 0;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
}

.cpo-card-time {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #6cc24a;
    box-shadow: 0 2px 8px rgba(108, 194, 74, .22);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.cpo-card-time svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cpo-card-short {
    display: none;
}

.cpo-card-sub {
    flex-basis: 100%;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.4;
}

/* Too narrow for the long wording on one line (phones, most desktops with
   the sidebar): "Angebot konfigurieren" and "1 Min.". */
@container (max-width: 424px) {
    .cpo-card-head-inner {
        gap: 6px 10px;
        padding: 16px 16px 14px;
    }

    .single-product .cpo-card-title {
        font-size: 17px;
    }

    .cpo-card-long {
        display: none;
    }

    .cpo-card-short {
        display: inline;
    }

    .cpo-card-time {
        padding: 4px 10px;
        gap: 5px;
    }

    .cpo-card-sub {
        font-size: 13px;
    }
}

/* Step 1 "Farbe auswählen" (templates/variable.php). Basel styles its swatches
   under ".single-product-content .variations", hence the longer selectors. */
.cpo.cpo-variant {
    margin: 0;
    padding: 0 0 6px;
    border-top: 0;
}

.cpo-variant-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 18px;
}

.cpo-variant-head .cpo-title {
    margin: 0;
}

.cpo-variant .cpo-step {
    display: grid;
    place-items: center;
    color: var(--cpo-green);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.cpo-variant:not(.is-done) .cpo-step {
    border: 2px dashed var(--cpo-green);
}

.cpo-variant.is-done .cpo-step {
    color: transparent;
}

.cpo-pending {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 4px 12px 4px 11px;
    border-radius: 999px;
    background: var(--cpo-green-soft);
    color: var(--cpo-green);
    font-size: 13px;
    font-weight: 600;
}

.cpo-pending-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cpo-green);
    box-shadow: 0 0 0 4px #bfe0a9;
    animation: cpo-pulse 1.8s ease-in-out infinite;
}

@keyframes cpo-pulse {
    50% {
        box-shadow: 0 0 0 4px rgba(191, 224, 169, .25);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cpo-pending-dot {
        animation: none;
    }
}

.cpo-variant.is-done .cpo-pending {
    display: none;
}

/* WooCommerce's reset link; it fades the link in and out itself. */
.cpo-variant .cpo-reset {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    color: #77766f;
    font-size: 13px;
    text-decoration: none;
}

.cpo-variant .cpo-reset span {
    font-size: 17px;
    line-height: 1;
}

.cpo-variant .cpo-reset:hover {
    color: var(--cpo-green);
}

.cpo-variant:not(.has-choice) .cpo-reset {
    display: none !important;
}

.cpo-variant-current {
    margin-left: auto;
    color: #77766f;
    font-size: 14px;
}

.cpo-variant-current strong {
    color: var(--cpo-text);
    font-weight: 700;
}

/* Only once chosen, in the place "Bitte wählen" had. */
.cpo-variant:not(.is-done) .cpo-variant-current {
    display: none;
}

.cpo-variant-row + .cpo-variant-row {
    margin-top: 18px;
}

.cpo-variant-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

/* The theme adds ":" to variation labels. */
.single-product-content .cpo-variant .variations .cpo-variant-label::after {
    content: none;
}

.cpo-variant .with-swatches select {
    display: none;
}

.single-product-content .cpo-variant .variations .swatches-select.cpo-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 10px 4px;
}

.single-product-content .cpo-variant .variations .cpo-swatches > .cpo-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 0;
    margin: 0;
    border: 0;
    color: #77766f;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.cpo-swatch-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
    transition: box-shadow .15s;
}

.cpo-swatch:hover .cpo-swatch-dot {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px #fff, 0 0 0 3px #c9d2c4;
}

.cpo-swatch.active-swatch .cpo-swatch-dot {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px #fff, 0 0 0 4px var(--cpo-green);
}

.single-product-content .cpo-variant .variations .cpo-swatches > .cpo-swatch.active-swatch {
    color: var(--cpo-green);
    font-weight: 700;
}

.cpo-swatch-name {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Terms without colour or image: the name alone, as a button. */
.cpo-swatch.is-text .cpo-swatch-dot {
    display: none;
}

.single-product-content .cpo-variant .variations .cpo-swatches > .cpo-swatch.is-text {
    justify-content: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1.5px solid var(--cpo-line);
    border-radius: 999px;
    color: var(--cpo-text);
    font-size: 14px;
}

.single-product-content .cpo-variant .variations .cpo-swatches > .cpo-swatch.is-text.active-swatch {
    border-color: var(--cpo-green);
    background: var(--cpo-green);
    color: #fff;
}

.single-product-content .cpo-variant .variations .cpo-swatches > .swatch-disabled {
    cursor: not-allowed;
    opacity: .35;
}

.cpo-swatch:focus-visible {
    outline: none;
}

.cpo-swatch:focus-visible .cpo-swatch-dot,
.cpo-swatch.is-text:focus-visible {
    outline: 2px solid var(--cpo-green);
    outline-offset: 4px;
}

/* Technique switch and the sizes for "mehrfarbig" need :has(); without it everything stays visible. */
@supports selector(:has(*)) {
    .cpo-position:has(.cpo-tech) .cpo-group,
    .cpo-position:has(.cpo-tech) .cpo-label,
    .cpo-sizes {
        display: none;
    }

    .cpo-position:has(.cpo-tech input[value="druck"]:checked) [data-technique="druck"],
    .cpo-position:has(.cpo-tech input[value="stick"]:checked) [data-technique="stick"] {
        display: block;
    }

    .cpo-position:has(.cpo-tech input[value="druck"]:checked) .cpo-label[data-technique="druck"],
    .cpo-position:has(.cpo-tech input[value="stick"]:checked) .cpo-label[data-technique="stick"] {
        display: inline;
    }

    .cpo-group:has(input[value="mehrfarbig"]:checked) .cpo-sizes {
        display: block;
    }

    .cpo-area {
        display: none;
    }

    .cpo-group:has(input[name$="_on]"][value="1"]:checked) .cpo-area {
        display: block;
    }
}

/* A chosen size in the select looks like a chosen button. */
@supports selector(:has(*)) {
    .cpo-select:not(:has(option[value=""]:checked)) {
        border-color: var(--cpo-green);
        color: var(--cpo-green);
        font-weight: 600;
    }
}

/* Narrow columns (product page sidebar layout, phones): keep the Druck/Stick
   switch on the label's line by dropping the indent and tightening the head. */
@container (max-width: 520px) {
    .cpo-body {
        padding-left: 0;
    }

    .cpo-head {
        gap: 6px 8px;
    }

    .cpo-badge {
        padding: 2px 9px;
        font-size: 12px;
    }

    .cpo-tech label {
        padding: 5px 12px;
    }

    .cpo-pill {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Phones: the switch stays next to the label, the highlight moves below it. */
@container (max-width: 380px) {
    .cpo-tech {
        order: 1;
    }

    .cpo-badge {
        order: 2;
    }

    .cpo-qty-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Stepper, "Stück" and the info button stay on one line. */
    .cpo-qty-row {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .cpo.cpo-qty .quantity .minus,
    .cpo.cpo-qty .quantity .plus {
        width: 38px;
    }

    .cpo.cpo-qty .quantity input.qty {
        width: 52px !important;
    }
}

/* One line needs about 355px: narrower (phones, small desktops), both
   promises stack next to the badge. */
@container (max-width: 369px) {
    .cpo-notice-row {
        display: grid;
        grid-template-columns: auto 1fr;
    }

    .cpo-notice-badge {
        grid-row: span 2;
    }

    .cpo-notice-pdf::before {
        content: none;
    }

    /* On phones, badge and both lines centred as one block under the button. */
    @media (max-width: 767px) {
        .cpo-notice-row {
            grid-template-columns: auto auto;
            justify-content: center;
        }
    }
}
