/* ─────────────────────────────────────────────────────────────
   gowy-select.css — Custom dropdown component
   Replaces native <select> with a div-based dropdown that
   respects dark/light mode and Gowy design tokens.
   Mirrors app/con/assets/css/components/con.select.css.
───────────────────────────────────────────────────────────── */

.gowy-select {
  position: relative;
  display: block;
  width: 100%;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.gowy-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-on-surface);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.gowy-select:focus .gowy-select__trigger,
.gowy-select.is-open .gowy-select__trigger {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
  outline: none;
}

.gowy-select--invalid .gowy-select__trigger {
  border-color: var(--color-error);
}

.gowy-select__value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.gowy-select__value--empty { color: var(--color-muted); }

.gowy-select__arrow {
  font-size: 18px !important;
  color: var(--color-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease;
  pointer-events: none;
}

.gowy-select.is-open .gowy-select__arrow { transform: rotate(180deg); }

/* ── Dropdown list ── */
.gowy-select__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;

  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.gowy-select.is-open .gowy-select__list {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.gowy-select__option {
  padding: 8px 14px;
  font-size: var(--text-sm);
  color: var(--color-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gowy-select__option:hover  { background: var(--overlay-soft);  color: var(--color-on-surface); }
.gowy-select__option.is-selected { background: var(--tint-primary); color: var(--color-primary); }

/* ── Light mode overrides ──
   background/border/text ya cambian solos via las variables de
   tokens.css (.light); solo la sombra del listado necesita ajuste. */
.light .gowy-select__list, .theme-light .gowy-select__list {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
