/* Custom select UI — native <select> kept hidden for forms/validation */

.ui-select {
  position: relative;
  width: 100%;
}

.ui-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  z-index: 0;
}

.ui-select-trigger {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.2;
  font-family: inherit;
  color: #1c1917;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-select-trigger:focus {
  outline: none;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.ui-select.is-open .ui-select-trigger {
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.ui-select.is-disabled .ui-select-trigger {
  opacity: 0.65;
  cursor: not-allowed;
  background: #f5f5f4;
}

.ui-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #78716c;
  transition: transform 0.15s ease;
}

.ui-select.is-open .ui-select-chevron {
  transform: rotate(180deg);
}

.ui-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.12);
}

.ui-select-option {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.25;
  color: #1c1917;
  cursor: pointer;
}

.ui-select-option:hover,
.ui-select-option.is-focused {
  background: #faf7ef;
}

.ui-select-option.is-selected {
  background: #f5edd8;
  color: #7a5b12;
  font-weight: 600;
}

.ui-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Tunnel billing fields */
.tunnel-field .ui-select-trigger {
  min-height: 46px;
}

/* Admin forms (Tailwind-like controls) */
#concours-form .ui-select-trigger,
.ui-select--admin .ui-select-trigger {
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-color: #cbd5e1;
  border-radius: 0.5rem;
  min-height: 42px;
}

#concours-form .ui-select-menu,
.ui-select--admin .ui-select-menu {
  font-size: 0.875rem;
}

/* Locale flag selects */
.ui-select--locale .ui-select-trigger {
  min-height: 36px;
  padding: 6px 10px;
  gap: 8px;
  border-radius: 999px;
  background: #fff;
}
.ui-select--flags .ui-select-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ui-select--flags-only .ui-select-trigger {
  width: 40px;
  min-height: 32px;
  padding: 4px 6px;
  justify-content: center;
}
.ui-select--flags-only .ui-select-chevron { display: none; }
.ui-select-flag {
  display: block;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.ui-select--flags .ui-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gt-locale-select { display: inline-flex; align-items: center; }
.gt-locale-select--flags-only { margin-left: 4px; }
.gt-locale-select--full { min-width: 140px; }
.gt-locale-flags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}
.gt-locale-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.gt-locale-flag:hover {
  border-color: rgba(201, 162, 39, 0.55);
}
.gt-locale-flag.is-active {
  border-color: #C9A227;
  box-shadow: 0 0 0 1px #C9A227;
}
.gt-locale-flag:not(.is-active) {
  opacity: 0.72;
}
.gt-locale-flag:not(.is-active):hover {
  opacity: 1;
}
.site-nav .gt-locale-flags { align-self: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.site-nav .gt-locale-select { align-self: center; }
