.phone-dial-input {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.phone-dial-input .phone-dial-control {
    position: relative;
    display: flex;
    flex: 0 0 110px;
    width: 110px;
    min-width: 0;
    z-index: 2;
}

.phone-dial-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0 12px;
    border: 1px solid #d5dae1;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: #f7f8fa;
    color: #333f51;
    font: inherit;
    cursor: pointer;
}

.phone-dial-value {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.phone-dial-value > span:last-child {
    flex: 0 0 auto;
}

.phone-dial-chevron {
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.phone-dial-input > input.form-control[type="tel"] {
    flex: 1 1 0 !important;
    width: 0 !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 0 6px 6px 0;
}

.one-line > .form-group:has(.phone-dial-input) {
    min-width: 0;
}

.phone-dial-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    width: min(320px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #d5dae1;
    border-radius: 8px;
    background: #fff;
    color: #333f51;
    box-shadow: 0 12px 28px rgba(26, 34, 48, .16);
}

.phone-dial-panel.align-right {
    right: 0;
    left: auto;
}

.phone-dial-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    margin: 10px;
    padding: 0 10px;
    border: 1px solid #d5dae1;
    border-radius: 5px;
}

.phone-dial-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #333f51;
    box-shadow: none;
    font-size: 14px;
}

.phone-dial-search-icon {
    position: relative;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border: 1.5px solid #687280;
    border-radius: 50%;
}

.phone-dial-search-icon::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    border-top: 1.5px solid #687280;
    transform: rotate(45deg);
}

.phone-dial-options {
    max-height: 240px;
    overflow-y: auto;
    padding: 0 4px 6px;
}

.phone-dial-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.phone-dial-option:hover,
.phone-dial-option[aria-selected="true"] {
    background: #f0f3f7;
}

.phone-dial-country {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.phone-dial-empty {
    padding: 14px;
    text-align: center;
    color: #687280;
}

.phone-dial-input:has(.is-invalid) + .invalid-tooltip,
.was-validated .phone-dial-input:has(input:invalid) + .invalid-tooltip {
    display: block;
}

#contactFormFragment .phone-dial-trigger {
    min-height: 60px;
    border-color: #646464;
    border-radius: 8px 0 0 8px;
    background: #202020;
    color: #fff;
}

#contactFormFragment .phone-dial-input #ContactTel {
    border-radius: 0 8px 8px 0;
}

@media (max-width: 575px) {
    .phone-dial-input .phone-dial-control {
        flex-basis: 96px;
        width: 96px;
    }

    .phone-dial-trigger { padding: 0 9px; }
}

@media (max-width: 768px) {
    #contactFormFragment .phone-dial-trigger { min-height: 45px; }
}
