/* Basis (desktop) stijlen */
.wpclv-attributes .wpclv-terms {
    margin: 0 -3px;
    padding: 0;
    list-style: none;
    /* Voor desktop behoud je eventueel inline-block of switch je later naar flexbox */
    display: inline-block;
}

.wpclv-attributes .wpclv-attribute {
    margin-bottom: 1em;
}

.wpclv-attributes .wpclv-attribute-label {
    text-align: start;
}

.wpclv-attributes .wpclv-terms .wpclv-more {
    display: inline-block;
    height: 42px;
    line-height: 42px;
    margin: 6px 3px 0 3px;
    padding: 3px;
    float: left;
}

.wpclv-attributes .wpclv-terms .wpclv-terms-select {
    float: left;
}

.wpclv-attributes .wpclv-terms .wpclv-term {
    display: inline-block;
    height: 42px;
    min-width: 42px;
    line-height: 40px;
    text-align: center;
    margin: 6px 3px 0 3px;
    padding: 3px;
    border-radius: 2px;
    border-width: 1px;
    border-style: solid;
    border-color: #dddddd;
    background-color: #ffffff;
    position: relative;
    float: left;
}

.wpclv-attributes .wpclv-terms .wpclv-term.wpclv-term-image {
    height: auto;
    width: 112px;
}

.wpclv-attributes .wpclv-terms .wpclv-term.wpclv-term-image span,
.wpclv-attributes .wpclv-terms .wpclv-term.wpclv-term-image a {
    padding: 0;
    height: auto;
}

.wpclv-attributes .wpclv-terms .wpclv-term.wpclv-term-image img {
    margin: 0 !important;
}

.wpclv-attributes .wpclv-terms .wpclv-term.active,
.wpclv-attributes .wpclv-terms .wpclv-term:hover {
    border-color: green;
}

.wpclv-attributes .wpclv-terms .wpclv-term.wpclv-term-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.wpclv-attributes .wpclv-terms .wpclv-term span,
.wpclv-attributes .wpclv-terms .wpclv-term a {
    display: block;
    padding: 0 20px;
    white-space: nowrap;
    height: 34px;
    line-height: 34px;
    width: 100%;
    position: relative;
    background-color: #efefef;
    border-radius: 2px;
    outline: none;
    box-shadow: none;
}

.wpclv-attributes .wpclv-terms .wpclv-term-color span,
.wpclv-attributes .wpclv-terms .wpclv-term-color a {
    font-size: 0;
    width: 34px;
    padding: 0;
}

.wpclv-attributes .wpclv-terms img {
    display: block;
    width: 100%;
    height: auto;
}

/* Tippy */
.wpclv-tippy-inner {
    padding: 5px 1px;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.wpclv-tippy-inner .wpclv-tippy-title {
    font-weight: 700;
}

.wpclv-tippy-inner > span {
    margin-bottom: 5px;
}

.wpclv-tippy-inner > span:last-child {
    margin-bottom: 0;
}

.wpclv-tippy-inner .wpclv-tippy-image {
    display: block;
    width: 100%;
    min-width: 150px;
    max-width: 600px;
}

.wpclv-tippy-inner .wpclv-tippy-image img {
    width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsieve stijlen voor mobiele apparaten */
@media only screen and (max-width: 768px) {
    /* Gebruik flexbox voor de container om de items netjes te laten doorbreken */
    .wpclv-attributes .wpclv-terms {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Haal de float-regels weg voor alle term-gerelateerde elementen */
    .wpclv-attributes .wpclv-terms .wpclv-term,
    .wpclv-attributes .wpclv-terms .wpclv-more,
    .wpclv-attributes .wpclv-terms .wpclv-terms-select {
        float: none;
    }
    
    /* Zorg dat elke term voldoende ruimte krijgt (bijv. 2 items per rij) */
    .wpclv-attributes .wpclv-terms .wpclv-term {
        margin: 6px;
        flex: 1 1 calc(50% - 12px);  /* Houd rekening met marge */
        height: auto;   /* Laat de hoogte automatisch bepalen */
        line-height: normal;  /* Reset line-height indien nodig */
    }
    
    /* Voor afbeeldingen in term-items: pas de breedte aan zodat ze goed schalen */
    .wpclv-attributes .wpclv-terms .wpclv-term.wpclv-term-image {
        width: calc(50% - 12px);
    }
    
    /* Centreer de labeltekst voor mobiele weergave */
    .wpclv-attributes .wpclv-attribute-label {
        text-align: center;
    }
}
