/* Prestax P14 · Direcciones inteligentes (capa aislada)
   No modifica los estilos fuente de verdad del usuario. */

.prestax-address-field {
  position: relative;
}

input[data-prestax-address-role] {
  padding-right: 2.15rem !important;
  background-repeat: no-repeat !important;
  background-position: right 0.7rem center !important;
  background-size: 1rem 1rem !important;
}

input[data-prestax-address-role][data-prestax-address-ready="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2315843f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s6-4.35 6-11a6 6 0 1 0-12 0c0 6.65 6 11 6 11Z'/%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3C/svg%3E") !important;
}

input[data-prestax-address-role][data-prestax-address-state="resolved"] {
  border-color: rgba(21, 132, 63, 0.88) !important;
  box-shadow: 0 0 0 2px rgba(21, 132, 63, 0.16) !important;
}

input[data-prestax-address-role][data-prestax-address-state="ambiguous"] {
  border-color: #d6a117 !important;
  box-shadow: 0 0 0 2px rgba(214, 161, 23, 0.18) !important;
}

input[data-prestax-address-role][data-prestax-address-state="mismatch"] {
  border-color: #dc6b22 !important;
  box-shadow: 0 0 0 2px rgba(220, 107, 34, 0.2) !important;
}

.prestax-address-listbox {
  position: fixed;
  z-index: 2147483600;
  display: none;
  width: min(440px, calc(100vw - 20px));
  max-height: min(330px, 48dvh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.985), rgba(5, 10, 18, 0.99));
  color: #f8fafc;
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(21, 132, 63, 0.25) inset;
  -webkit-overflow-scrolling: touch;
}

.prestax-address-listbox[data-open="true"] {
  display: block;
}

.prestax-address-listbox__head {
  position: sticky;
  top: -6px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px -6px 5px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 13, 23, 0.98);
  color: #b9f6ca;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.prestax-address-listbox__option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.prestax-address-listbox__option:hover,
.prestax-address-listbox__option[aria-selected="true"] {
  background: linear-gradient(100deg, rgba(21, 132, 63, 0.48), rgba(21, 132, 63, 0.16));
  outline: 1px solid rgba(83, 236, 135, 0.35);
}

.prestax-address-listbox__main {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 0.93rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prestax-address-listbox__meta {
  color: #b9c5d6;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

.prestax-address-listbox__empty,
.prestax-address-listbox__note {
  padding: 11px 10px;
  color: #d7dee9;
  font-size: 0.84rem;
  line-height: 1.35;
}

.prestax-address-listbox__note {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffd58b;
}

.prestax-address-live {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 600px) {
  .prestax-address-listbox {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-height: min(360px, 52dvh);
    border-radius: 16px;
  }

  .prestax-address-listbox__option {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prestax-address-listbox,
  .prestax-address-listbox * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* P16.1 · Selector dentro de la capa dinámica de Multiempresa */
#multiempresaModal > .prestax-address-listbox {
  z-index: 2147483647 !important;
}
