/* ==================================================
   TELÉFONO INTERNACIONAL / BANDERAS
================================================== */

.contact-phone{
  display:flex;
  width:100%;
  position:relative;
  gap:8px;
}

.phone-input-wrapper{
  position:relative;
  flex:0 0 120px;
  height:44px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:999px;
  background:#fff;
  box-shadow:0px 4px 4px 0px rgba(0,0,0,.25);
  z-index:100;
}

.selected-country{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 12px;
  cursor:pointer;
  user-select:none;
}

.selected-flag{
  width:28px;
  height:18px;
  display:block;
  object-fit:cover;
  border-radius:3px;
  border:1px solid rgba(0,0,0,.12);
}

#phone-prefix{
  font-size:13px;
  font-weight:800;
  color:#111;
}

.phone-number{
  flex:1;
  min-width:0;
}


/* BUSCADOR */

.search-wrapper{
  position:absolute;
  top:52px;
  left:0;
  width:300px;
  background:#fff;
  padding:8px;
  border:1px solid rgba(0,0,0,.12);
  border-bottom:0;
  border-radius:14px 14px 0 0;
  box-shadow:0 12px 30px rgba(0,0,0,.12);
}

.search-wrapper input{
  width:100%;
  height:38px;
  padding:0 12px;
  border:1px solid #ddd;
  border-radius:10px;
  outline:none;
  font-size:13px;
}


/* LISTADO */

.country-list{
  list-style:none;
  position:absolute;
  top:96px;
  left:0;
  width:300px;
  max-height:240px;
  overflow-y:auto;
  margin:0;
  padding:6px 0;
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius:0 0 14px 14px;
  box-shadow:0 18px 35px rgba(0,0,0,.16);
  z-index:99999;
}

.country-list li{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 12px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  color:#222;
}

.country-list li:hover{
  background:#f6f2f8;
}

.country-list li img{
  width:28px;
  height:18px;
  object-fit:cover;
  border-radius:3px;
  border:1px solid rgba(0,0,0,.10);
}

.country-list .divider{
  height:1px;
  padding:0;
  margin:5px 0;
  background:#eee;
}

.hidden{
  display:none !important;
}


/* RESULTADO DEL FORMULARIO */

#responseMessage{
  text-align:center;
  font-size:13px;
  font-weight:700;
  min-height:18px;
  margin-top:5px;
}

#responseMessage.success{
  color:#198754;
}

#responseMessage.error{
  color:#dc3545;
}


/* móvil */

@media(max-width:560px){

  .contact-phone{
    flex-direction:column;
    gap:12px;
  }

  .phone-input-wrapper{
    width:100%;
    flex:none;
  }

  .selected-country{
    justify-content:flex-start;
    padding-left:16px;
  }

  .search-wrapper,
  .country-list{
    width:100%;
  }

  .phone-number{
    width:100%;
  }
}

/* Mantener prefijo y teléfono en la misma fila, también en móvil. */
.contact-inner{width:100%;min-width:0}
.contact-card{width:min(420px,100%);min-width:0;max-width:100%}
.contact-phone{display:flex;flex-direction:row;align-items:center;gap:8px}
.contact-phone .phone-input-wrapper{flex:0 0 96px;width:96px;height:44px}
.contact-phone .selected-country{justify-content:center;padding:0 8px;gap:6px}
.contact-phone .phone-number{flex:1 1 0;width:0;min-width:0;height:44px}
.contact-phone .selected-flag,.country-list li img{flex-shrink:0}
.contact-phone .search-wrapper,.contact-phone .country-list{width:280px;max-width:calc(100vw - 48px)}
@media(max-width:560px){
  .contact-phone input{font-size:16px}
  .contact-phone .phone-number{padding-left:12px;padding-right:10px}
  .contact-phone .phone-number::placeholder{font-size:13px}
}
