/* Public marketing dropdowns only. No gateway, auth or account selectors. */
/* Native fallback also removes the white OS arrow well when JS is unavailable. */
body.xgpu-marketing :is([data-m-catalog], [data-xgpu-configurator] [data-c-form]) select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23bd9bff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  box-shadow: none;
}
/* Keep form validation/submission and existing select APIs intact. */
body.xgpu-marketing select.xgpu-m-select-native {
  position: absolute;
  width: 1px;
  min-width: 0;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  border: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}
body.xgpu-marketing .xgpu-m-select {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
  color: #f2effa;
}
body.xgpu-marketing .xgpu-m-filter > .xgpu-m-select { flex: 1 1 0; }
body.xgpu-marketing .xgpu-m-select-trigger {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  min-height: 50px;
  padding: 11px 38px 11px 12px;
  border: 1px solid #463051;
  border-radius: 7px;
  background: #100c17;
  color: #e4dceb;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}
body.xgpu-marketing .xgpu-m-select-trigger::after {
  content: "";
  position: absolute;
  right: 15px;
  top: calc(50% - 5px);
  width: 7px;
  height: 7px;
  border: solid #bd9bff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
body.xgpu-marketing .xgpu-m-select-trigger[aria-expanded="true"]::after { top: calc(50% - 1px); transform: rotate(225deg); }
body.xgpu-marketing .xgpu-m-select-value { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.xgpu-marketing .xgpu-m-filter .xgpu-m-select-trigger { min-height: 44px; padding: 9px 24px 9px 0; border: 0; border-radius: 5px; background: transparent; font-size: 12px; }
body.xgpu-marketing .xgpu-m-filter .xgpu-m-select-trigger::after { right: 4px; }
body.xgpu-marketing .xgpu-m-select-trigger:hover:not(:disabled) { border-color: #9664d8; background-color: #21172f; }
body.xgpu-marketing .xgpu-m-select-trigger[aria-expanded="true"] { border-color: #a578ef; background-color: #21172f; }
body.xgpu-marketing .xgpu-m-select-trigger:focus-visible { outline: 2px solid #c8b0ff; outline-offset: 3px; }
body.xgpu-marketing .xgpu-m-select-trigger:disabled { color: #a99aba; opacity: 1; cursor: not-allowed; }
body.xgpu-marketing .xgpu-m-select-trigger:disabled::after { border-color: #80718f; }
body.xgpu-marketing .xgpu-m-select-trigger[aria-invalid="true"] { outline: 2px solid #ffb6bb; outline-offset: 2px; }
/* A catalog filter is one field: highlight its caption, value and arrow together.
 * Disabled filters stay neutral; native no-JS selects use the same full-field focus. */
body.xgpu-marketing .xgpu-m-filter { transition: border-color 140ms ease, background-color 140ms ease; }
body.xgpu-marketing .xgpu-m-filter:has(> select:not(:disabled)):is(:hover, :focus-within),
body.xgpu-marketing .xgpu-m-filter:has(.xgpu-m-select-trigger[aria-expanded="true"]:not(:disabled)) { border-color: #9664d8; background-color: #21172f; }
body.xgpu-marketing .xgpu-m-filter:has(:focus-visible) { outline: 2px solid #c8b0ff; outline-offset: 3px; }
body.xgpu-marketing .xgpu-m-filter .xgpu-m-select-trigger:is(:hover, [aria-expanded="true"]) { background-color: transparent; }
body.xgpu-marketing .xgpu-m-filter :is(select, .xgpu-m-select-trigger):focus-visible:not([aria-invalid="true"]) { outline: none; }
/* Fixed, body-level popup is scoped by its generated class. It cannot leak into
 * unrelated selects or be clipped by calculator/card overflow. */
body.xgpu-marketing .xgpu-m-select-menu {
  position: fixed;
  z-index: 55;
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid #8d60c2;
  border-radius: 9px;
  background: #171020;
  color: #eee5fb;
  box-shadow: 0 14px 38px #0009, 0 0 20px #7944f420;
  scrollbar-width: thin;
  scrollbar-color: #755093 #171020;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}
body.xgpu-marketing .xgpu-m-select-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 30px 10px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #e4dceb;
  background: transparent;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
}
/* One shared price width per popup keeps every model/configuration aligned.
 * Each complete price is one line; names never push the shared price column. */
body.xgpu-marketing .xgpu-m-select-menu--priced .xgpu-m-select-option:has(.xgpu-m-select-name),
body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value:has(.xgpu-m-select-name) {
  display: grid;
  grid-template-columns: minmax(max-content,var(--xgpu-m-price-width,24ch)) minmax(0,1fr);
  column-gap: 12px;
  align-items: baseline;
}
body.xgpu-marketing .xgpu-m-select-price {
  min-width: 0;
  color: #d7baff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.xgpu-marketing .xgpu-m-select-name { min-width: 0; overflow-wrap: anywhere; }
body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value { width: 100%; }
body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value .xgpu-m-select-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A stale choice has no current price claim; retain its selected name. */
body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value:not(.has-price) .xgpu-m-select-name { grid-column: 1 / -1; }
body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value:not(.has-price) .xgpu-m-select-price { display: none; }
/* Filter cells are compact. Keep the full rate and selected model readable. */
body.xgpu-marketing .xgpu-m-filter .xgpu-m-select--priced .xgpu-m-select-value.has-price { display: flex; flex-wrap: wrap; gap: 0 8px; white-space: normal; }
body.xgpu-marketing .xgpu-m-filter .xgpu-m-select-price { font-size: 12px; }
body.xgpu-marketing .xgpu-m-select-option[aria-disabled="true"] .xgpu-m-select-price { color: inherit; }
body.xgpu-marketing .xgpu-m-select-option[aria-selected="true"] { background: #302044; color: #fff; }
body.xgpu-marketing .xgpu-m-select-option[aria-selected="true"]::after { position: absolute; right: 11px; content: "✓"; color: #d4b6ff; font-size: 14px; }
body.xgpu-marketing .xgpu-m-select-option.is-active { border-color: #a97af0; background: #472963; color: #fff; }
body.xgpu-marketing .xgpu-m-select-option[aria-disabled="true"] { color: #9486a7; cursor: not-allowed; }
body.xgpu-marketing .xgpu-m-select-menu[hidden], body.xgpu-marketing .xgpu-m-select-option[hidden] { display: none !important; }
@media (max-width: 480px) {
  body.xgpu-marketing .xgpu-m-filter .xgpu-m-select-trigger { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  body.xgpu-marketing .xgpu-m-select-trigger, body.xgpu-marketing .xgpu-m-filter { transition: none; }
}
@media (forced-colors: active) {
  body.xgpu-marketing .xgpu-m-select-trigger, body.xgpu-marketing .xgpu-m-select-menu { border: 1px solid ButtonText; background: Canvas; color: CanvasText; box-shadow: none; }
  body.xgpu-marketing .xgpu-m-select-trigger::after { border-color: ButtonText; }
  body.xgpu-marketing .xgpu-m-select-trigger:focus-visible { outline-color: Highlight; }
  body.xgpu-marketing .xgpu-m-filter { border-color: ButtonText; background: Canvas; color: CanvasText; }
  body.xgpu-marketing .xgpu-m-filter:has(> select:not(:disabled)):is(:hover, :focus-within),
  body.xgpu-marketing .xgpu-m-filter:has(.xgpu-m-select-trigger[aria-expanded="true"]:not(:disabled)) { border-color: Highlight; background: Canvas; }
  body.xgpu-marketing .xgpu-m-filter:has(:focus-visible) { outline-color: Highlight; }
  body.xgpu-marketing .xgpu-m-filter .xgpu-m-select-trigger { border: 0; background: transparent; }
  body.xgpu-marketing .xgpu-m-select-option, body.xgpu-marketing .xgpu-m-select-price { color: CanvasText; }
  body.xgpu-marketing .xgpu-m-select-option.is-active { border-color: Highlight; outline: 1px solid Highlight; outline-offset: -2px; }
  body.xgpu-marketing .xgpu-m-select-option[aria-selected="true"] { font-weight: 700; }
  body.xgpu-marketing .xgpu-m-select-option[aria-selected="true"]::after { color: Highlight; }
  body.xgpu-marketing .xgpu-m-select-option[aria-disabled="true"], body.xgpu-marketing .xgpu-m-select-trigger:disabled { color: GrayText; }
}

/* Vlad: retain the aligned price-first column, but keep its three prices/badge
 * on ONE horizontal line. No clipping, ellipsis or scrolling of monetary data. */
body.xgpu-marketing .xgpu-m-select-price { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: .4em; width: 100%; min-width: 0; white-space: nowrap; overflow: visible; }
body.xgpu-marketing .xgpu-m-select-price .xgpu-m-price-before { font-size: 12px; line-height: 1.4; }
body.xgpu-marketing .xgpu-m-select-price .xgpu-m-discount-tag { font-size: 12px; padding: 0 .25em; }
body.xgpu-marketing .xgpu-m-select-option:has(.xgpu-m-option-icon), body.xgpu-marketing .xgpu-m-select-value:has(.xgpu-m-option-icon) { display: flex; align-items: center; gap: 9px; white-space: normal; }
body.xgpu-marketing .xgpu-m-option-icon { display: inline-flex; flex: 0 0 22px; width: 22px; height: 22px; color: #d8c5f0; }
body.xgpu-marketing .xgpu-m-option-icon svg { width: 22px; height: 22px; }

body.xgpu-marketing .xgpu-m-select-price > * { flex: 0 0 auto; }
body.xgpu-marketing .xgpu-m-filter .xgpu-m-select--priced .xgpu-m-select-value.has-price { display: grid; grid-template-columns: minmax(max-content,var(--xgpu-m-price-width,24ch)) minmax(0,1fr); gap: 8px; }
@media (max-width: 480px) {
  /* Two half-width cells cannot fit a full price group plus model name. */
  body.xgpu-marketing .xgpu-m-filters { grid-template-columns: minmax(0,1fr); }
}

body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value.has-price { overflow: visible; }

/* A priced filter needs its full field width even on four-column desktop grids. */
body.xgpu-marketing .xgpu-m-filter:has(.xgpu-m-select--priced) { flex-direction: column; align-items: stretch; gap: 0; }
body.xgpu-marketing .xgpu-m-filter:has(.xgpu-m-select--priced) > span:not(.xgpu-m-select) { padding-top: 8px; }
body.xgpu-marketing .xgpu-m-filters .xgpu-m-filter > .xgpu-m-select--priced { flex: auto; }

@media (max-width: 480px) {
  body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-trigger { padding-inline: 8px 26px; }
  body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-trigger::after { right: 10px; }
}

/* Vlad: keep price-first aligned columns in normal fields. Only a genuinely
 * narrow field/menu moves the model below the WHOLE price line, never splitting
 * prices or reducing type. The query measures the field, not the page width. */
body.xgpu-marketing .xgpu-m-select, body.xgpu-marketing .xgpu-m-select-menu--priced { container-type: inline-size; container-name: xgpu-public-price-field; }
body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value .xgpu-m-select-name { overflow: visible; text-overflow: clip; white-space: normal; }
@container xgpu-public-price-field (max-width: 320px) {
  body.xgpu-marketing .xgpu-m-select-menu--priced .xgpu-m-select-option:has(.xgpu-m-select-name),
  body.xgpu-marketing .xgpu-m-select--priced .xgpu-m-select-value:has(.xgpu-m-select-name),
  body.xgpu-marketing .xgpu-m-filter .xgpu-m-select--priced .xgpu-m-select-value.has-price { grid-template-columns: minmax(0,1fr); row-gap: 3px; }
}

/* A priced filter has a real minimum track, including intermediate widths. */
body.xgpu-marketing .xgpu-m-filters { grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); }
@media (max-width: 767px) {
  body.xgpu-marketing .xgpu-m-filter:has(.xgpu-m-select--priced), body.xgpu-marketing .xgpu-m-filter--sort { grid-column: 1 / -1; }
}
