/* countryPhone.css
   Estilo do seletor de país (DDI) + telefone.
   Feito para conviver com .form-control / .FormMaterial (altura 50px). */

/* Em campos com label flutuante (FormMaterial), o widget aninha o input e quebra o
   seletor irmão `input.filled ~ label`, fazendo o label sobrepor o campo. Como o
   widget sempre tem conteúdo, mantemos o label sempre no estado "flutuado" (topo). */
.FormMaterial .country-phone~label {
    font-size: 12px !important;
    position: absolute !important;
    margin: -55px 0 0 14px !important;
}

.country-phone {
    position: relative;
    display: flex;
    align-items: stretch;
    height: 50px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: #f7f7f7;
    overflow: visible;
}

.country-phone:focus-within {
    border-color: var(--corGeral, #2f80ed);
}

/* Botão da bandeira */
.country-phone__toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-right: 1px solid #ced4da;
    flex: 0 0 auto;
}

.country-phone__flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

.country-phone__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #666;
    transition: transform 0.15s ease;
}

.country-phone--open .country-phone__caret {
    transform: rotate(180deg);
}

/* Prefixo do DDI (+55) */
.country-phone__dial {
    display: flex;
    align-items: center;
    padding: 0 2px 0 5px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #4c4c4c;
    font-size: 13px;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Input do número (herda .form-control, mas sem borda/fundo próprios) */
.country-phone .country-phone__input,
.country-phone .country-phone__input:focus {
    flex: 1 1 auto;
    border: none !important;
    box-shadow: none !important;
    height: 100% !important;
    padding: 0 4px 0 3px !important;
    background: transparent !important;
    font-size: 13px;
    min-width: 0;
}

/* Menu dropdown */
.country-phone__menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 1050;
    width: 260px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.country-phone--open .country-phone__menu {
    display: block;
}

.country-phone__search {
    width: calc(100% - 16px);
    margin: 8px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.country-phone__search:focus {
    border-color: var(--corGeral, #2f80ed);
}

.country-phone__list {
    list-style: none;
    margin: 0;
    padding: 0 0 6px 0;
    max-height: 240px;
    overflow-y: auto;
}

.country-phone__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
}

.country-phone__item:hover {
    background: #f2f6fc;
}

.country-phone__item-name {
    flex: 1 1 auto;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.country-phone__item-dial {
    color: #888;
    flex: 0 0 auto;
}
