/* Businessbook public lead forms — country code + national phone */
.bb-lead-phone {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 0.65rem;
  background: #fff;
  overflow: visible;
}

.bb-lead-phone:focus-within {
  border-color: var(--color-primary, #0d9488);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #0d9488) 18%, transparent);
}

.bb-lead-phone__picker {
  position: relative;
  flex: 0 0 auto;
}

.bb-lead-phone__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  margin: 0;
  padding: 0 0.65rem;
  border: 0;
  border-right: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  background: color-mix(in srgb, var(--color-bg, #f8fafc) 88%, #fff);
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0.65rem 0 0 0.65rem;
}

.bb-lead-phone__toggle:focus-visible {
  outline: 2px solid var(--color-primary, #0d9488);
  outline-offset: -2px;
}

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

/* Closed toggle: flag + caret only; dial stays in dropdown options + aria/title */
.bb-lead-phone__dial {
  display: none !important;
}

.bb-lead-phone__caret {
  font-size: 0.55rem;
  opacity: 0.65;
}

.bb-lead-phone__national {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0 !important;
  border-radius: 0 0.65rem 0.65rem 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.bb-lead-phone__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  width: min(18rem, 80vw);
  max-height: 16rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  border-radius: 0.75rem;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.bb-lead-phone__menu[hidden] {
  display: none !important;
}

.bb-lead-phone__search {
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.bb-lead-phone__search-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
}

.bb-lead-phone__list {
  overflow: auto;
  max-height: 12.5rem;
  padding: 0.35rem;
}

.bb-lead-phone__option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.bb-lead-phone__option:hover,
.bb-lead-phone__option:focus-visible {
  background: #f1f5f9;
  outline: none;
}

.bb-lead-phone.is-open {
  z-index: 5;
}

/* Theme field wrappers keep spacing; kill nested input chrome */
.bb1-field .bb-lead-phone__national.bb1-field__input,
.bb2-field .bb-lead-phone__national {
  padding: 0.7rem 0.85rem;
}
