.greensane-auto-configurator {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #dfe7e1;
    border-radius: 10px;
    background: #fbfdfb;
    box-shadow: none;
}

.greensane-auto-configurator[hidden],
.greensane-auto-configurator__field[hidden],
.greensane-config-choice[hidden] {
    display: none !important;
}

.greensane-auto-configurator__title {
    margin: 0 0 9px;
    color: #243229;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.greensane-auto-configurator__field {
    margin-top: 9px;
}

.greensane-auto-configurator__label {
    display: block;
    margin-bottom: 5px;
    color: #3f4d44;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
}

.greensane-config-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/*
 * Celowo używamy button.greensane-config-choice + !important przy kolorach,
 * żeby style motywu / Elementora nie zmieniały opcji konfiguratora na czerwone.
 */
button.greensane-config-choice {
    appearance: none !important;
    -webkit-appearance: none !important;
    min-height: 34px;
    margin: 0 !important;
    padding: 7px 10px !important;
    border: 1px solid #d8e0dc !important;
    border-radius: 7px !important;
    background: #ffffff !important;
    color: #26332c !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
}

button.greensane-config-choice:hover:not(:disabled) {
    border-color: #7fab8e !important;
    background: #f7fbf8 !important;
    color: #174629 !important;
    box-shadow: none !important;
    transform: none !important;
}

button.greensane-config-choice:focus,
button.greensane-config-choice:focus-visible {
    outline: none !important;
    border-color: #5b946f !important;
    box-shadow: 0 0 0 2px rgba(47, 125, 74, 0.12) !important;
}

button.greensane-config-choice.is-selected {
    border: 1px solid #2f7d4a !important;
    background: #eef8f1 !important;
    color: #173a25 !important;
    font-weight: 700 !important;
    box-shadow: inset 0 0 0 1px rgba(47, 125, 74, 0.05) !important;
}

button.greensane-config-choice.is-selected:hover:not(:disabled) {
    border-color: #26673d !important;
    background: #e8f5ec !important;
    color: #12321f !important;
}

button.greensane-config-choice:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed;
}

.greensane-auto-configurator__total {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: baseline;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid #e1e8e3;
}

.greensane-auto-configurator__total-label {
    color: #4a5750;
    font-size: 12px;
    font-weight: 600;
}

.greensane-auto-configurator__total-value {
    color: #173a25;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

@media (max-width: 640px) {
    .greensane-auto-configurator {
        padding: 10px;
    }

    button.greensane-config-choice {
        min-height: 32px;
        padding: 6px 9px !important;
        font-size: 12.5px !important;
    }

    .greensane-config-choices {
        gap: 5px;
    }
}


/* Formularze produktowe z osobnymi polami Model / Falownik / Rozdzielnica */
.greensane-structured-addon-host {
    min-width: 0;
}

.greensane-structured-configurator {
    width: 100%;
    margin-top: 2px;
}


/* 0.4.9-beta10: compact BASE + OPTIONS layout */
.greensane-auto-configurator {
    padding: 10px 12px;
}

.greensane-auto-configurator__title {
    margin-bottom: 6px;
}

.greensane-auto-configurator__field {
    margin-top: 6px;
}

.greensane-auto-configurator__label {
    margin-bottom: 3px;
    font-size: 11.5px;
}

.greensane-config-choices {
    gap: 4px;
}

button.greensane-config-choice {
    min-height: 30px;
    padding: 5px 8px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
}

.greensane-auto-configurator__total {
    margin-top: 8px;
    padding-top: 7px;
}

/* On wide screens, make option groups denser without moving the configurator
   outside its proven beta2 container. */
@media (min-width: 900px) {
    .greensane-auto-configurator:not(.greensane-structured-configurator) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 14px;
        row-gap: 5px;
    }

    .greensane-auto-configurator:not(.greensane-structured-configurator)[hidden] {
        display: none !important;
    }

    .greensane-auto-configurator:not(.greensane-structured-configurator) .greensane-auto-configurator__title,
    .greensane-auto-configurator:not(.greensane-structured-configurator) .greensane-auto-configurator__total {
        grid-column: 1 / -1;
    }

    .greensane-auto-configurator:not(.greensane-structured-configurator) .greensane-auto-configurator__field {
        min-width: 0;
        margin-top: 3px;
    }
}

@media (max-width: 640px) {
    .greensane-auto-configurator {
        padding: 9px;
    }
    button.greensane-config-choice {
        min-height: 30px;
        padding: 5px 7px !important;
        font-size: 12px !important;
    }
}


/* 0.4.9-beta11: prevent long option labels from overlapping grid columns */
@media (min-width: 900px) {
    .greensane-auto-configurator:not(.greensane-structured-configurator) {
        column-gap: 18px;
    }
}

.greensane-auto-configurator__field,
.greensane-config-choices {
    min-width: 0;
    max-width: 100%;
}

button.greensane-config-choice {
    max-width: 100% !important;
    width: auto;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    text-align: left !important;
    height: auto !important;
}

.greensane-auto-configurator__field .greensane-config-choices {
    overflow: visible;
}
