/* =============================================================================
   MG7 custom select — ported from public/custom/mg7-enhancements.css (the
   `.mg7-select` widget the legacy site uses). GLOBAL (not Astro-scoped) on
   purpose: the trigger/list DOM is created at runtime by custom-select.js, so
   scoped styles can't reach it — same reason country-panel.css is global.
   Tokens come from src/styles/_tokens.scss. `--mg7-blue-d` (legacy) is mapped
   to the rebuild's --mg7-blue-strong (#1f86e0, the same value).
   ============================================================================= */
.mg7-select {
  position: relative;
  width: 100%;
  font-family: var(--font-display);
}

/* The real <select> stays in the DOM for form submission, hidden off the layout
   (opacity, not display:none, so its value is still submitted). */
.mg7-select select.mg7-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Pin the trigger white in every state so no global button:hover/:focus rule
   can repaint it; keyboard focus still shows the box-shadow ring below. */
.mg7-select__trigger,
.mg7-select__trigger:hover,
.mg7-select__trigger:focus,
.mg7-select__trigger:active {
  background: #fff;
  color: var(--mg7-ink);
  outline: none;
  text-decoration: none;
}

.mg7-select__trigger {
  /* Defaults match the CALCULATOR fields (1.5px #E2E8F0, 12px radius, 55px). The
     Contact override below drops these to that form's field metrics. */
  min-height: 55px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--mg7-ink);
  background: #fff;
  border: 1.5px solid var(--mg7-line);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.mg7-select__trigger:hover {
  border-color: #c2d0de;
}
.mg7-select[data-open="true"] .mg7-select__trigger,
.mg7-select__trigger:focus-visible {
  outline: none;
  border-color: var(--mg7-blue);
  box-shadow: 0 0 0 3px rgba(47, 160, 255, 0.18);
}

.mg7-select__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mg7-select__label[data-placeholder="true"] {
  color: #9aa7b5;
}

.mg7-select__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--mg7-muted);
  transition: transform 0.2s ease;
}
.mg7-select[data-open="true"] .mg7-select__chevron {
  transform: rotate(180deg);
  color: var(--mg7-blue);
}

.mg7-select__list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--mg7-line);
  border-radius: 12px;
  box-shadow: 0 18px 44px -16px rgba(11, 20, 43, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s ease;
}
.mg7-select[data-open="true"] .mg7-select__list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mg7-select__option {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.98rem;
  color: var(--mg7-ink);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.mg7-select__option:hover,
.mg7-select__option.is-active {
  background: rgba(47, 160, 255, 0.1);
  color: var(--mg7-blue-strong);
}
.mg7-select__option[aria-selected="true"] {
  font-weight: 600;
  color: var(--mg7-blue-strong);
}

.mg7-select__list::-webkit-scrollbar {
  width: 8px;
}
.mg7-select__list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* --- Contact form context --------------------------------------------------
   The Contact fields use a 1px #C2CBD6 border + 8px radius (.field__control),
   lighter than the calculator default above. Match the trigger to the inputs it
   sits beside so the dropdown doesn't read as a different control. */
.field--select .mg7-select__trigger {
  border: 1px solid #c2cbd6;
  border-radius: 8px;
}
.field--select .mg7-select__trigger:hover {
  border-color: #a9b6c6;
}
.field--select .mg7-select[data-open="true"] .mg7-select__trigger,
.field--select .mg7-select__trigger:focus-visible {
  border-color: var(--mg7-blue);
}
