/*
 * SportCV Primary Sport-style dropdown system v621
 * The single visual source of truth for native fallbacks, enhanced
 * dropdowns, the age-status selector, and the sport-icon selector.
 */

:root {
  --scv-select-border: #d6e2f0;
  --scv-select-border-hover: #b7cbe2;
  --scv-select-blue: #2563eb;
  --scv-select-text: #172840;
  --scv-select-muted: #75859b;
  --scv-select-soft: #eef6ff;
  --scv-select-selected: #e8f2ff;
  --scv-select-radius: 15px;
  --scv-select-option-radius: 11px;
  --scv-select-focus: 0 0 0 3px rgba(37, 99, 235, 0.14);
  --scv-select-menu-shadow: 0 10px 24px rgba(7, 24, 51, 0.11);
}

/* Native fallback: remains fully usable if JavaScript is unavailable. */
select.scv-select:not(.scv-select-enhanced):not(.sport-select-native) {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  height: 48px;
  margin: 0;
  border: 1px solid var(--scv-select-border);
  border-radius: var(--scv-select-radius);
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  padding: 0 44px 0 14px;
  color: var(--scv-select-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 42, 91, 0.025);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

select.scv-select:not(.scv-select-enhanced):not(.sport-select-native):hover:not(:disabled) {
  border-color: var(--scv-select-border-hover);
}

select.scv-select:not(.scv-select-enhanced):not(.sport-select-native):focus,
select.scv-select:not(.scv-select-enhanced):not(.sport-select-native):focus-visible {
  border-color: var(--scv-select-blue);
  outline: 0 !important;
  box-shadow: var(--scv-select-focus);
}

select.scv-select:not(.scv-select-enhanced):not(.sport-select-native):disabled {
  border-color: #dfe7f1;
  background-color: #f4f7fb;
  color: #8a98aa;
  cursor: not-allowed;
  opacity: 1;
}

select.scv-select:not(.scv-select-enhanced):not(.sport-select-native)[aria-invalid="true"],
select.scv-select:not(.scv-select-enhanced):not(.sport-select-native).is-invalid,
select.scv-select:not(.scv-select-enhanced):not(.sport-select-native).error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* The enhanced native select remains the authoritative form value. */
select.scv-select.scv-select-enhanced {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.scv-combobox {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.scv-combobox--compact {
  width: auto;
  min-width: 168px;
}

.scv-combobox-button,
.age-combobox {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 44px 0 14px;
  border: 1px solid var(--scv-select-border);
  border-radius: var(--scv-select-radius);
  outline: 0;
  background: #fff;
  color: var(--scv-select-text);
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 42, 91, 0.025);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.scv-combobox-caret {
  position: absolute;
  right: 15px;
  top: 50%;
  flex: 0 0 auto;
  margin: 0;
  color: var(--scv-select-blue);
  font-size: 16px;
  line-height: 1;
  transform: translateY(-52%);
  pointer-events: none;
  transition: transform 0.16s ease;
}

.scv-combobox-button:hover:not(:disabled),
.age-combobox:hover:not(:disabled) {
  border-color: var(--scv-select-border-hover);
}

.scv-combobox-button:focus-visible,
.scv-combobox.is-open .scv-combobox-button,
.age-combobox:focus-visible,
.age-select-wrap.open .age-combobox {
  border-color: var(--scv-select-blue);
  outline: 0 !important;
  box-shadow: var(--scv-select-focus);
}

.scv-combobox.is-open .scv-combobox-caret {
  transform: translateY(-45%) rotate(180deg);
}

.scv-combobox-button.is-placeholder,
.age-combobox:not(.has-value) {
  color: var(--scv-select-muted);
}

.scv-combobox-value,
.age-combo-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scv-combobox-button:disabled,
.age-combobox:disabled {
  border-color: #dfe7f1;
  background: #f4f7fb;
  color: #8a98aa;
  cursor: not-allowed;
  opacity: 1;
}

.scv-combobox-button:disabled .scv-combobox-caret {
  color: #93a1b4;
}

.scv-combobox.is-invalid .scv-combobox-button {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.scv-combobox-menu,
.age-combo-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1000;
  display: none;
  box-sizing: border-box;
  max-height: var(--scv-menu-max-height, 288px);
  margin: 0;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--scv-select-border);
  border-radius: var(--scv-select-radius);
  background: #fff;
  box-shadow: var(--scv-select-menu-shadow);
}

.scv-combobox.is-open .scv-combobox-menu,
.age-select-wrap.open .age-combo-menu {
  display: grid;
  gap: 4px;
}

.scv-combobox.is-drop-up .scv-combobox-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.scv-combobox-option,
.age-combo-option {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--scv-select-option-radius);
  outline: 0;
  background: #fff;
  color: #24344f;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.scv-combobox-option:hover:not(:disabled),
.scv-combobox-option.is-active,
.age-combo-option:hover,
.age-combo-option:focus-visible {
  background: var(--scv-select-soft);
  color: #1d4ed8;
}

.scv-combobox-option[aria-selected="true"],
.age-combo-option.active {
  background: var(--scv-select-selected);
  color: #1d4ed8;
}

.scv-combobox-option[aria-selected="true"]::after,
.age-combo-option.active::after {
  content: "✓";
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--scv-select-blue);
  font-size: 16px;
  font-weight: 850;
}

.scv-combobox-option:disabled {
  background: #fff;
  color: #9aa7b8;
  cursor: not-allowed;
}

.scv-combobox-option.is-empty {
  justify-content: center;
  color: var(--scv-select-muted);
  cursor: default;
}

/* Sport-icon dropdowns use this component without page-level visual CSS. */
select.scv-select.sport-select-native {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  min-width: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
}

.sport-selector {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.sport-selector-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 44px 0 14px;
  border: 1px solid var(--scv-select-border);
  border-radius: var(--scv-select-radius);
  outline: 0;
  background: #fff;
  color: var(--scv-select-text);
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 42, 91, 0.025);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.sport-selector-button:hover {
  border-color: var(--scv-select-border-hover);
}

.sport-selector-button:focus-visible,
.sport-selector-button[aria-expanded="true"] {
  border-color: var(--scv-select-blue);
  outline: 0 !important;
  box-shadow: var(--scv-select-focus);
}

.sport-selector-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sport-selector-caret {
  position: absolute;
  right: 15px;
  top: 50%;
  flex: 0 0 auto;
  margin: 0;
  color: var(--scv-select-blue);
  transform: translateY(-52%);
  transition: transform 0.16s ease;
}

.sport-selector-button[aria-expanded="true"] .sport-selector-caret {
  transform: translateY(-45%) rotate(180deg);
}

.sport-selector-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1000;
  display: none;
  box-sizing: border-box;
  max-height: var(--scv-menu-max-height, 276px);
  margin: 0;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--scv-select-border);
  border-radius: var(--scv-select-radius);
  background: #fff;
  box-shadow: var(--scv-select-menu-shadow);
}

.sport-selector-menu.open {
  display: grid;
  gap: 4px;
}

.sport-selector.scv-sport-drop-up .sport-selector-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.sport-selector-option {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--scv-select-option-radius);
  outline: 0;
  background: #fff;
  color: #24344f;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sport-selector-option:hover,
.sport-selector-option:focus-visible,
.sport-selector-option.is-active {
  outline: 0 !important;
  background: var(--scv-select-soft);
  color: #1d4ed8;
}

.sport-selector-option.active,
.sport-selector-option[aria-selected="true"] {
  background: var(--scv-select-selected);
  color: #1d4ed8;
}

.sport-selector-option.active::after,
.sport-selector-option[aria-selected="true"]::after {
  content: "✓";
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--scv-select-blue);
  font-size: 16px;
  font-weight: 850;
}

.sport-selector-option[data-scv-placeholder="true"] {
  display: none;
}

/* Account age-status dropdown. */
.age-select-wrap {
  position: relative;
}

.age-select-wrap #ageGate.native-age-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.age-combo-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transform: translateY(-53%);
  color: var(--scv-select-blue);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  transition: transform 0.16s ease;
}

.age-select-wrap.open .age-combo-caret {
  transform: translateY(-47%) rotate(180deg);
}

.age-option-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f0f6ff;
  color: var(--scv-select-blue);
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 760px) {
  select.scv-select:not(.scv-select-enhanced):not(.sport-select-native),
  .scv-combobox-button,
  .scv-combobox-option,
  .sport-selector-button,
  .sport-selector-option,
  .age-combobox,
  .age-combo-option {
    font-size: 16px;
  }

  .scv-combobox--compact {
    width: 100%;
    min-width: 0;
  }

  .scv-combobox-menu,
  .sport-selector-menu,
  .age-combo-menu {
    max-height: var(--scv-menu-max-height, min(248px, calc(100dvh - 176px)));
  }
}

@media (prefers-reduced-motion: reduce) {
  select.scv-select,
  .scv-combobox-button,
  .scv-combobox-caret,
  .scv-combobox-option,
  .sport-selector-caret,
  .sport-selector-option,
  .age-combobox,
  .age-combo-caret,
  .age-combo-option {
    transition: none !important;
  }
}
