.kast-configurator {
    max-width: 760px;
    margin: 0 auto 35px;
}

.kast-configurator h3,
.kast-contactgegevens h3 {
    margin-bottom: 18px;
}

.kast-breedte {
    margin-bottom: 25px;
}

.kast-breedte label,
.kast-modulepositie label,
.kast-contactgegevens label {
    display: block;
    font-weight: 600;
    margin: 14px 0 7px;
}

.kast-breedte-invoer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kast-breedte-invoer input {
    width: 100%;
    max-width: 260px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.kast-breedte small {
    display: block;
    margin-top: 8px;
    color: #666;
}

.kast-geldig {
    color: #24733c;
    font-weight: 600;
    margin-top: 12px;
}

.kast-fout {
    color: #b42318;
    font-weight: 600;
    margin-top: 12px;
}

/* Modulepositie */

.kast-modulepositie {
    position: relative;
    padding: 16px;
    margin: 14px 0;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fafafa;
}

.kast-modulepositie-label {
    display: block;
    font-weight: 600;
    margin: 0 0 10px;
}

/* Eigen dropdown */

.kast-custom-dropdown {
    position: relative;
    width: 100%;
    z-index: 2;
}

.kast-custom-dropdown.is-open {
    z-index: 50;
}

.kast-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 78px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
}

.kast-dropdown-trigger:hover {
    border-color: #777;
}

.kast-dropdown-trigger:focus-visible,
.kast-dropdown-option:focus-visible {
    outline: 2px solid #555;
    outline-offset: 2px;
}

.kast-dropdown-selected {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    flex: 1;
}

.kast-dropdown-naam {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    text-align: left;
}

.kast-dropdown-arrow {
    flex: 0 0 auto;
    margin-left: 12px;
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.kast-custom-dropdown.is-open .kast-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdownmenu met thumbnails */

.kast-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 390px;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.kast-dropdown-menu[hidden] {
    display: none !important;
}

.kast-dropdown-option {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 76px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.kast-dropdown-option:last-child {
    border-bottom: 0;
}

.kast-dropdown-option:hover {
    background: #f3f3f3;
}

.kast-dropdown-option[aria-selected="true"] {
    background: #f0f0f0;
}

/* Module thumbnails */

.kast-keuze-thumbnail {
    display: block;
    flex: 0 0 54px;
    width: 54px;
    height: 62px;
    object-fit: contain;
    object-position: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* Kleurvakje */

.kast-keuze-kleur {
    display: block;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    box-sizing: border-box;
    border: 1px solid #999;
    border-radius: 4px;
    margin-left: auto;
    transition: background-color 0.2s ease;
}

/* Prijs van geselecteerde module */

.kast-moduleprijs {
    margin-top: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

/* Verborgen native select voor compatibiliteit */

.kast-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Prijsoverzicht */

#kast-prijsoverzicht {
    margin-top: 25px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 7px;
}

.kast-prijsregel {
    padding: 7px 0;
    border-bottom: 1px solid #eee;
}

.kast-totaal {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 2px solid #333;
    font-size: 1.15em;
}

/* Contactgegevens */

.kast-contactgegevens input,
.kast-contactgegevens textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.kast-contactgegevens textarea {
    min-height: 110px;
}

.kast-contactgegevens input[type="submit"] {
    width: auto;
    margin-top: 20px;
    padding: 13px 25px;
    cursor: pointer;
}

/* Grote kastafbeelding onder de modulekeuzes */

.kast-beeld-preview {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    margin: 25px 0;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 0;
    line-height: 0;
}

.kast-module-afbeelding-wrapper {
    position: relative;
    flex: 0 0 auto;
    height: 320px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
}

.kast-module-afbeelding {
    display: block;
    height: 320px;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    position: relative;
}

/* Mobiel */

@media (max-width: 767px) {
    .kast-configurator p {
        font-size: 1.1rem;
    }

    .kast-modulepositie {
        padding: 12px;
    }

    .kast-dropdown-trigger {
        min-height: 70px;
    }

    .kast-dropdown-option {
        min-height: 70px;
    }

    .kast-keuze-thumbnail {
        flex-basis: 48px;
        width: 48px;
        height: 56px;
    }

    .kast-dropdown-menu {
        max-height: 320px;
    }

    .kast-beeld-preview {
        justify-content: flex-start;
    }
}

/* Contactformulier uitlijnen met de configurator */

.kast-contactgegevens {
    width: 100%;
    max-width: 760px;
    margin: 0 auto 35px;
    box-sizing: border-box;
}

/* Contactformulier binnen dezelfde breedte houden */
.wpcf7 form:has(.kast-contactgegevens) {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Voorkom dat invoervelden buiten de breedte vallen */
.kast-contactgegevens input,
.kast-contactgegevens textarea,
.kast-contactgegevens select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}