.clfn-configurator {
    border: 1px solid #d4d4d4;
    box-sizing: border-box;
    margin: 24px 0;
    max-width: 760px;
    overflow: visible;
    padding: 24px 30px;
    width: 100%;
}

.clfn-configurator *,
.clfn-configurator *::before,
.clfn-configurator *::after {
    box-sizing: border-box;
}

.clfn-preview {
    aspect-ratio: 5.3 / 1;
    background: #111;
    border: 1px solid #2c2c2c;
    border-radius: 14px;
    margin: 0 auto 34px;
    max-width: 640px;
    overflow: hidden;
    padding: 7px;
    position: relative;
    width: 100%;
}

.clfn-preview-flag-wrap,
.clfn-preview-text-wrap {
    align-items: center;
    bottom: 7px;
    display: grid;
    position: absolute;
    top: 7px;
}

.clfn-preview-flag-wrap {
    bottom: auto;
    height: clamp(34px, 8.2vw, 52px);
    left: 7px;
    overflow: visible;
    place-items: center;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(54px, 13vw, 82px);
}

.clfn-preview--flag-right .clfn-preview-flag-wrap {
    left: auto;
    right: 7px;
}

.clfn-preview-flag {
    display: block;
    height: auto !important;
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
    width: auto !important;
}

.clfn-preview-text-wrap {
    left: calc(clamp(54px, 13vw, 82px) + 16px);
    place-items: center;
    right: 10px;
    text-align: center;
}

.clfn-preview--flag-right .clfn-preview-text-wrap {
    left: 10px;
    right: calc(clamp(54px, 13vw, 82px) + 16px);
}

.clfn-preview-name {
    display: block;
    font-size: 50px;
    font-weight: 900;
    line-height: 1;
    max-width: none;
    min-width: 0;
    text-align: center;
    text-transform: uppercase;
    transform: translateY(0.11em);
    white-space: nowrap;
    width: auto;
}

.clfn-fields {
    display: grid;
    gap: 14px 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 auto;
    max-width: 640px;
    overflow: visible;
}

.clfn-field,
.clfn-color-picker-field {
    min-width: 0;
    position: relative;
}

.clfn-field--full,
.clfn-color-row {
    grid-column: 1 / -1;
}

.clfn-field input,
.clfn-field select,
.clfn-color-button,
.clfn-choice-button {
    background: #fff;
    border: 1px solid #cfd3d8;
    border-radius: 12px;
    box-shadow: none;
    color: #222;
    font-size: 18px;
    font-weight: 500;
    height: 52px;
    line-height: 1.2;
    width: 100%;
}

.clfn-field input,
.clfn-field select {
    padding: 0 42px 0 18px;
}

.clfn-field select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%);
    background-position: calc(100% - 24px) 50%, calc(100% - 15px) 50%;
    background-repeat: no-repeat;
    background-size: 9px 9px, 9px 9px;
}

.clfn-field input::placeholder {
    color: #555;
    opacity: 1;
}

.clfn-color-row {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clfn-choice-button {
    align-items: center;
    appearance: none;
    cursor: pointer;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding: 0 42px 0 18px;
    position: relative;
    text-align: left;
}

.clfn-choice-button::after {
    border-color: #777 transparent transparent;
    border-style: solid;
    border-width: 10px 8px 0;
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.clfn-choice-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clfn-choice-flag {
    display: block;
    flex: 0 0 auto;
    height: 20px;
    object-fit: contain;
    width: 34px;
}

.clfn-choice-menu {
    background-color: #fff;
    border: 1px solid #cfd3d8;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    display: block;
    left: 0;
    margin-top: 8px;
    max-height: 220px;
    overflow: hidden;
    padding: 10px 22px 10px 10px;
    position: absolute;
    right: 0;
    z-index: 21;
}

.clfn-choice-menu[hidden] {
    display: none;
}

.clfn-menu-scroll-content {
    display: grid;
    gap: 8px;
    max-height: 198px;
    overflow-y: auto;
    padding-right: 0;
    scrollbar-width: none;
}

.clfn-menu-scroll-content::-webkit-scrollbar {
    display: none;
    width: 0;
}

.clfn-choice-option {
    align-items: center;
    background: #fff;
    border: 1px solid #eceff2;
    border-radius: 9px;
    color: #222;
    cursor: pointer;
    display: flex;
    font-size: 17px;
    gap: 12px;
    min-height: 40px;
    padding: 8px 12px;
    text-align: left;
    width: 100%;
}

.clfn-choice-option:hover,
.clfn-choice-option:focus {
    border-color: #999;
}

.clfn-color-button {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 34px;
    height: auto;
    min-height: 68px;
    padding: 11px 13px;
    text-align: left;
}

.clfn-color-button-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
}

.clfn-color-button-name {
    color: #555;
    display: block;
    font-size: 14px;
    grid-column: 1;
    line-height: 1.1;
}

.clfn-color-button-swatch {
    border: 4px solid #e1e1e1;
    border-radius: 8px;
    display: block;
    grid-column: 2;
    grid-row: 1 / span 2;
    height: 34px;
    width: 34px;
}

.clfn-color-menu {
    background-color: #fff;
    border: 1px solid #cfd3d8;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    display: block;
    left: 0;
    margin-top: 8px;
    max-height: 220px;
    overflow: hidden;
    padding: 10px 22px 10px 10px;
    position: absolute;
    right: 0;
    z-index: 20;
}

.clfn-menu-scrollbar {
    background: #eef0f2;
    border-radius: 999px;
    bottom: 10px;
    cursor: grab;
    position: absolute;
    right: 7px;
    top: 10px;
    width: 8px;
    z-index: 2;
}

.clfn-menu-scrollbar:active {
    cursor: grabbing;
}

.clfn-menu-scrollbar-thumb {
    background: #9da3aa;
    border-radius: 999px;
    display: block;
    min-height: 28px;
    width: 100%;
}

.clfn-color-menu[hidden] {
    display: none;
}

.clfn-color-option {
    align-items: center;
    background: #fff;
    border: 1px solid #eceff2;
    border-radius: 9px;
    color: #222;
    cursor: pointer;
    display: flex;
    font-size: 16px;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.clfn-color-option:hover,
.clfn-color-option:focus {
    border-color: #999;
}

.clfn-color-option-swatch {
    border: 3px solid #e1e1e1;
    border-radius: 7px;
    display: block;
    flex: 0 0 auto;
    height: 28px;
    width: 28px;
}

.clfn-screen-reader {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}

.clfn-warning {
    border-left: 4px solid #cc1818;
    padding-left: 12px;
}

@media (max-width: 780px) {
    .clfn-configurator {
        padding: 18px;
    }

    .clfn-preview {
        border-width: 1px;
        margin-bottom: 28px;
        padding: 6px;
    }

    .clfn-fields,
    .clfn-color-row {
        gap: 16px;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .clfn-configurator {
        padding: 16px;
    }

    .clfn-field input,
    .clfn-field select,
    .clfn-choice-button {
        font-size: 17px;
        height: 50px;
        padding-left: 16px;
    }

    .clfn-choice-button {
        padding-right: 46px;
    }

    .clfn-choice-button::after {
        right: 20px;
    }
}
