.mfg-phone-field {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    width: 100%;
    direction: ltr;
}

.mfg-phone-country-control {
    position: relative;
    display: grid;
    grid-column: 1 / -1;
    min-width: 0;
    direction: rtl;
}

.mfg-phone-country,
.mfg-phone-country-search,
.mfg-phone-number,
.mfg-phone-dial-code {
    min-width: 0;
    min-height: 44px;
    border: 1px solid #cbd8e5;
    border-radius: 10px;
    background: #fff;
    color: #153b5a;
    font: inherit;
}

.mfg-phone-country,
.mfg-phone-country-search,
.mfg-phone-number {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 11px;
}

.mfg-phone-country {
    direction: rtl;
    text-align: right;
}

.mfg-phone-country-search {
    direction: rtl;
    text-align: right;
    padding-inline-end: 46px;
}

.mfg-phone-country-toggle {
    position: absolute;
    z-index: 1;
    inset-block: 1px;
    inset-inline-end: 1px;
    display: grid;
    place-items: center;
    width: 44px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #176c96;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.mfg-phone-country-toggle[hidden] {
    display: none;
}

.mfg-phone-country-toggle:hover {
    background: #eaf5fb;
}

.mfg-phone-country-toggle:focus-visible {
    outline: 2px solid #2874a6;
    outline-offset: -3px;
}

.mfg-phone-country-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 140ms ease;
}

.mfg-phone-country-toggle.is-expanded svg {
    transform: rotate(180deg);
}

.mfg-phone-country-results {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline: 0;
    z-index: 30;
    max-height: min(280px, 42vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border: 1px solid #cbd8e5;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(18, 60, 104, 0.18);
    direction: rtl;
}

.mfg-phone-country-results[hidden],
.mfg-phone-country-search[hidden],
.mfg-phone-country[hidden],
.mfg-phone-search-status[hidden] {
    display: none;
}

.mfg-phone-country-option,
.mfg-phone-country-empty {
    min-height: 44px;
    padding: 10px 12px;
    color: #153b5a;
    text-align: right;
    cursor: pointer;
}

.mfg-phone-country-option + .mfg-phone-country-option {
    border-top: 1px solid #edf1f5;
}

.mfg-phone-country-option:hover,
.mfg-phone-country-option.is-active {
    background: #eaf5fb;
    color: #075f83;
}

.mfg-phone-country-empty {
    color: #708296;
    cursor: default;
}

.mfg-phone-search-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mfg-phone-number {
    grid-column: 2;
    text-align: left;
    letter-spacing: 0.025em;
}

.mfg-phone-number::placeholder {
    color: #8495a6;
    letter-spacing: 0;
}

.mfg-phone-dial-code {
    grid-column: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: #f2f7fc;
    color: #176c96;
    font-weight: 800;
    white-space: nowrap;
}

.mfg-phone-hint {
    grid-column: 1 / -1;
    color: #708296;
    font-size: 0.82em;
    direction: rtl;
    text-align: right;
}

.mfg-phone-field:focus-within .mfg-phone-country,
.mfg-phone-field:focus-within .mfg-phone-country-search,
.mfg-phone-field:focus-within .mfg-phone-number {
    border-color: #2874a6;
    outline: 2px solid rgba(40, 116, 166, 0.15);
    outline-offset: 1px;
}

.qr-phone-entry {
    display: grid;
    gap: 7px;
    min-width: 0;
}

@media (max-width: 560px) {
    .mfg-phone-field {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 5px;
    }

    .mfg-phone-country,
    .mfg-phone-country-search,
    .mfg-phone-number,
    .mfg-phone-dial-code {
        min-height: 42px;
    }

    .mfg-phone-country,
    .mfg-phone-country-search,
    .mfg-phone-number {
        padding: 8px 6px;
        font-size: 0.9em;
    }

    .mfg-phone-country-search {
        padding-inline-end: 46px;
    }

    .mfg-phone-country-toggle {
        width: 42px;
    }

}
