/* ============================================================
   Phone Validator — componente reutilizable Serenity Spa
   Estilos del selector de país + input + feedback inline.
   ============================================================ */

.spv-group {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}

.spv-country {
  flex: 0 0 auto;
  max-width: 170px;
  padding: .9rem .6rem;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-family: inherit;
  font-size: .92rem;
  background: #fff;
  cursor: pointer;
}

.spv-input {
  flex: 1;
  padding: .9rem 1rem;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-family: inherit;
  font-size: .95rem;
  width: 100%;
  min-width: 0;     /* evita overflow en flex */
}

.spv-feedback {
  margin: .4rem 0 0;
  font-size: .78rem;
  min-height: 1.1rem;
  transition: color .2s;
  color: #888;
}
.spv-feedback.is-error { color: #c4302b; }
.spv-feedback.is-ok    { color: #2d8a5c; }

.spv-input.is-invalid {
  border-color: #c4302b !important;
  background: #fff8f8;
}
.spv-input.is-valid {
  border-color: #2d8a5c !important;
}

/* ============================================================
   Desplegable de país con banderas reales (se ven en todos los SO)
   El <select> nativo queda oculto pero operativo (fuente de verdad).
   ============================================================ */
.spv-native {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.spv-dd { position: relative; flex: 0 0 auto; }

.spv-dd-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .9rem .7rem;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: .92rem;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.spv-dd-btn:hover { border-color: #b98a3e; }
.spv-dd-btn .spv-dd-caret { font-size: .7rem; opacity: .6; margin-left: .1rem; }

.spv-flag {
  width: 22px; height: 16px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  flex: 0 0 auto;
  vertical-align: middle;
}
.spv-flag-emoji {
  width: auto; height: auto;
  box-shadow: none;
  font-size: 1.05rem;
  line-height: 1;
}

.spv-dd-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 9999;
  margin: 0;
  padding: .25rem;
  list-style: none;
  min-width: 210px;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e3d6c4;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(60,40,20,.18);
}
.spv-dd-opt {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: .9rem;
  color: #2a1a20;
}
.spv-dd-opt:hover { background: #f6efe6; }
.spv-dd-opt[aria-selected="true"] { background: #f0e5d5; font-weight: 600; }
.spv-dd-opt .spv-dd-name { flex: 1; }
.spv-dd-opt .spv-dd-code { color: #8a7a6a; font-size: .82rem; }

/* Mobile: stack vertical en pantallas pequeñas */
@media (max-width: 480px) {
  .spv-group { flex-direction: column; }
  .spv-country { max-width: 100%; }
  .spv-dd, .spv-dd-btn { width: 100%; }
  .spv-dd-btn { justify-content: flex-start; }
  .spv-dd-list { min-width: 100%; }
}
