/* ---------------------------------------------------------------------------
 * Sitzbänke configurator – icon style for design selection attributes
 *
 * Targets:
 *   - varianten_sitzflaechen_design  (Sitzflächen Design)
 *   - varianten_rueckenlehnen_design (Rückenlehnen Design)
 *   - varianten_serie_sitzflaeche   (Serie Sitzfläche)
 *
 * Each option renders as a rounded white card holding the swatch icon, with
 * the option label sitting close underneath the card. Active option is
 * marked with a red border (no dot indicator).
 *
 * On mobile (<= 1023px) the cards lay out in two rows that share a single
 * horizontal scroll container so they swipe together. The existing
 * `configurator-mobile-swatches.js` keeps the selected card centered.
 * ------------------------------------------------------------------------- */

.swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options {
    gap: 10px;
    flex-wrap: wrap;
}

.swatch-attribute.varianten_sitzflaechen_design .variations-shapes,
.swatch-attribute.varianten_rueckenlehnen_design .variations-shapes,
.swatch-attribute.varianten_serie_sitzflaeche .variations-shapes {
    width: auto;
    max-width: none;
    min-width: 0;
    background: transparent;
    padding: 0;
    gap: 4px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
}

.swatch-attribute.varianten_sitzflaechen_design .swatch-option,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option {
    width: 74px !important;
    min-width: 74px !important;
    max-width: 74px !important;
    height: 74px !important;
    min-height: 74px !important;
    max-height: 74px !important;
    border-radius: 8px !important;
    border: 1px solid #cfd8e4 !important;
    background-color: #fff !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-sizing: border-box;
    padding: 6px !important;
    margin: 0 auto;
    box-shadow: none !important;
    display: block;
}

.swatch-attribute.varianten_sitzflaechen_design .swatch-option.bg-color-variants,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option.bg-color-variants,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option.bg-color-variants {
    border-color: #d80000 !important;
}

.swatch-attribute.varianten_sitzflaechen_design .swatch-option .whitespace-nowrap,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option .whitespace-nowrap,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option .whitespace-nowrap,
.swatch-attribute.varianten_sitzflaechen_design .swatch-option .swatch-inline-text,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option .swatch-inline-text,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option .swatch-inline-text {
    display: none !important;
}

.swatch-attribute.varianten_sitzflaechen_design .swatch-option.selected-option-dot::after,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option.selected-option-dot::after,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option.selected-option-dot::after,
.swatch-attribute.varianten_sitzflaechen_design .swatch-option-visual.selected-option-dot::after,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option-visual.selected-option-dot::after,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option-visual.selected-option-dot::after {
    content: none !important;
    display: none !important;
}

.swatch-attribute.varianten_sitzflaechen_design .swatch-option-text,
.swatch-attribute.varianten_rueckenlehnen_design .swatch-option-text,
.swatch-attribute.varianten_serie_sitzflaeche .swatch-option-text {
    display: block !important;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    color: #5a647c;
    white-space: nowrap;
    max-width: 74px;
    width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1023px) {
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options,
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options,
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options {
        display: grid !important;
        grid-template-rows: repeat(2, auto);
        grid-auto-flow: row;
        grid-auto-columns: calc((100% - 32px) / 6);
        column-gap: 8px;
        row-gap: 8px;
        width: 100%;
        box-sizing: border-box;
        align-items: start;
        padding-left: 0 !important;
        padding-right: 0 !important;
        flex-wrap: unset !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-behavior: smooth;
        scroll-snap-type: x proximity;
        padding-bottom: 2px;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options::-webkit-scrollbar,
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options::-webkit-scrollbar,
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options::-webkit-scrollbar {
        display: none;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative,
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative,
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative {
        min-width: 0;
        width: 100%;
        flex: unset;
        scroll-snap-align: start;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative > div,
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative > div,
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative > div {
        width: 100%;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 1),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 2),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 3),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 4),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 5),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 6),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 1),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 2),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 3),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 4),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 5),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 6),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 1),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 2),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 3),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 4),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 5),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 6) {
        grid-row: 1;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 7),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 8),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 9),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 10),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n + 11),
    .swatch-attribute.varianten_sitzflaechen_design .swatch-attribute-options > .relative:nth-child(12n),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 7),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 8),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 9),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 10),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n + 11),
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-attribute-options > .relative:nth-child(12n),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 7),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 8),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 9),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 10),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n + 11),
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-attribute-options > .relative:nth-child(12n) {
        grid-row: 2;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-option,
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-option,
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-option {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        aspect-ratio: 1 / 1;
        padding: 3px !important;
    }

    .swatch-attribute.varianten_sitzflaechen_design .swatch-option-text,
    .swatch-attribute.varianten_rueckenlehnen_design .swatch-option-text,
    .swatch-attribute.varianten_serie_sitzflaeche .swatch-option-text {
        margin-top: 4px;
        min-width: 0;
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        font-size: 11px;
        line-height: 13px;
        align-self: stretch;
    }

    .swatch-attribute.varianten_sitzflaechen_design .variations-shapes,
    .swatch-attribute.varianten_rueckenlehnen_design .variations-shapes,
    .swatch-attribute.varianten_serie_sitzflaeche .variations-shapes {
        width: 100%;
        min-width: 0;
        max-width: none;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding-left: 0 !important;
    }

    .swatch-attribute.varianten_sitzflaechen_design .gradient-variants,
    .swatch-attribute.varianten_rueckenlehnen_design .gradient-variants,
    .swatch-attribute.varianten_serie_sitzflaeche .gradient-variants {
        display: none !important;
    }
}
