/* ==========================================================================
   MOTOLECTRON - TYPEABLE PLACE FIELDS (MotolectronPlaceField, homepage.js)
   Region, City and Barangay in the sign-up modal, "Complete your account",
   the profile Delivery Address tab and checkout: a text field that suggests
   places as the customer types, and lists them all on a click. The list
   matches the premium select list (moto-select.css). Token-only, so one rule
   set serves Light and Dark; each page styles the field like its others.
   ========================================================================== */

.moto-combo {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.moto-combo__input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding-right: 40px;
  text-overflow: ellipsis;
  cursor: text;
}

.moto-combo__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--moto-muted);
  cursor: pointer;
  translate: 0 -50%;
  transition: background-color var(--dur-fast, 160ms) ease, color var(--dur-fast, 160ms) ease;
}

.moto-combo__toggle:hover {
  background: var(--moto-overlay);
  color: var(--moto-text);
}

.moto-combo__toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate 180ms var(--ix-ease-out, ease-out);
}

.moto-combo.is-open .moto-combo__toggle svg {
  rotate: 180deg;
}

.moto-combo.is-disabled .moto-combo__toggle {
  opacity: 0.45;
  pointer-events: none;
}

/* The select it stands for: kept for its value, never seen */
.moto-combo__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

/* ---------------------------------------------------------------- list */
.moto-combo__list {
  /* Reset the UA popover box (centred, inset 0, canvas colours). */
  position: fixed;
  inset: auto;
  box-sizing: border-box;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--moto-border-subtle);
  border-radius: 12px;
  background: var(--moto-panel-soft);
  color: var(--moto-text);
  box-shadow: var(--moto-card-shadow);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: var(--moto-border-hover) transparent;
  z-index: 2147483000; /* only where the popover top layer is missing */
  opacity: 1;
  transform: none;
  transition:
    opacity 140ms var(--ix-ease-out, ease-out),
    transform 200ms var(--ix-ease-out, ease-out),
    overlay 200ms allow-discrete,
    display 200ms allow-discrete;
}

.moto-combo__list[popover]:not(:popover-open) {
  opacity: 0;
  transform: scale(0.98);
  transition-duration: 110ms;
}

@starting-style {
  .moto-combo__list:popover-open {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  .moto-combo__list.is-up:popover-open {
    transform: translateY(4px) scale(0.98);
  }
}

.moto-combo__option {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--moto-text-secondary);
  cursor: pointer;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}

.moto-combo__spacer {
  display: block;
  margin: 0;
  padding: 0 !important;
  border: 0;
  list-style: none;
  pointer-events: none;
}

.moto-combo__option[aria-selected="true"] {
  background: var(--moto-overlay-strong);
  color: var(--moto-text);
}

.moto-combo__option.is-chosen {
  color: var(--moto-text);
  font-weight: 600;
}

/* The typed part of each name */
.moto-combo__option mark {
  padding: 0;
  background: none;
  color: var(--moto-red);
  font-weight: 700;
}

.moto-combo__empty {
  padding: 10px;
  color: var(--moto-muted);
  font-size: 0.86rem;
}

@media (prefers-reduced-motion: reduce) {
  .moto-combo__list,
  .moto-combo__list[popover]:not(:popover-open) {
    transform: none;
    transition-property: opacity, overlay, display;
  }

  .moto-combo__toggle svg {
    transition: none;
  }
}
