.cmcg-widget,
.cmcg-widget * {
    box-sizing: border-box;
}

.cmcg-layout {
    display: flex;
    align-items: stretch;
    gap: 28px;
    width: 100%;
}

.cmcg-colors {
    flex: 0 0 20%;
    max-width: 20%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cmcg-color-title {
    font-weight: 600;
    margin-bottom: 14px;
}

.cmcg-color-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cmcg-color-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 3px 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #222;
    font: inherit;
    text-align: left;
    cursor: pointer;
    opacity: .72;
    transition: opacity .2s ease, transform .2s ease;
}

.cmcg-color-btn:hover,
.cmcg-color-btn.is-active {
    opacity: 1;
}

.cmcg-color-btn.is-active {
    font-weight: 600;
}

.cmcg-swatch {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.35);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.cmcg-gallery {
    flex: 1 1 auto;
    min-width: 0;
}

.cmcg-main-image-wrap {
    width: 100%;
    height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
}

/* L'image principale est toujours affichée entièrement, sans recadrage. */
.cmcg-main-image {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    transition: opacity .18s ease;
}

.cmcg-main-image.is-changing {
    opacity: .3;
}

.cmcg-thumbs {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.cmcg-thumb {
    width: 78px;
    height: 78px;
    padding: 3px;
    border: 1px solid transparent;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    opacity: .65;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.cmcg-thumb:hover,
.cmcg-thumb.is-active {
    opacity: 1;
}

.cmcg-thumb.is-active {
    border-color: #222;
}

.cmcg-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cmcg-empty {
    padding: 20px;
    border: 1px dashed #bbb;
    text-align: center;
}

@media (max-width: 767px) {
    .cmcg-layout {
        flex-direction: column;
        gap: 18px;
    }

    .cmcg-colors {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .cmcg-color-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px 16px;
    }

    .cmcg-color-btn {
        width: auto;
    }

    .cmcg-main-image-wrap {
        height: 320px;
    }
}
