/* TikWhizz's one dropdown (Terry msg 1821), with shared/select.js. Both sides load it in <head>, so a select is drawn in its final look from the
   first frame: no jump when the script arrives. Colours are the shared tokens (Light, Dark, Navy, the creator shell), with plain fallbacks for a
   page that has none. No fades: the menu shows and hides at once. */

/* ---- the face: a one-choice select looks like the filter buttons (Products / SKUs): no device arrow, our chevron, the label cut with "…" */
select:not([multiple]):not([data-native]):not([size]),
select[size="1"]:not([multiple]):not([data-native]),
select[size="0"]:not([multiple]):not([data-native]) {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px 12px;
  padding-right: 28px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; cursor: pointer;
}
select:not([multiple]):not([data-native]):disabled { cursor: not-allowed; }
/* the "All …" first choice reads as a placeholder, like "All products" */
select:not([multiple]):not([data-native]):has(> option[value=""]:checked) { color: rgb(var(--v3-fg-2, 70 70 80)); }
select:not([data-native])::-ms-expand { display: none; }

/* ---- a many-choice select: hidden, its button face shows instead */
select.tws-src { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important; margin: 0 !important;
  opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; }
.tws-face { display: inline-flex; align-items: center; gap: 6px; text-align: left; cursor: pointer; padding-right: 28px; position: relative; min-width: 0; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px 12px; height: 32px; font-weight: 400; }
.tws-face .tws-fl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tws-face.is-empty { color: rgb(var(--v3-fg-2, 70 70 80)); }
.tws-face:disabled { cursor: not-allowed; opacity: .6; }

/* ---- the menu: the Products / SKUs popover's card, rows and search box */
.tws-menu { position: fixed; z-index: 2147483000; display: flex; flex-direction: column; padding: 6px; box-sizing: border-box; overflow: hidden;
  background: rgb(var(--v3-surface, 255 255 255)); color: rgb(var(--v3-fg, 12 12 15)); border: 1px solid rgb(var(--v3-line, 234 234 239));
  border-radius: 10px; box-shadow: var(--v3-shadow-pop, 0 8px 28px rgba(0, 0, 0, .18)); font-size: 13px; line-height: 1.35; text-align: left; }
.tws-menu[hidden], .tws-back[hidden] { display: none !important; }
/* shown as a popover (the top layer, Terry msg 1872: above drawers and dialogs): undo the browser's popover centring and frame */
.tws-menu { inset: auto; margin: 0; }
.tws-back { margin: 0; padding: 0; border: 0; width: auto; height: auto; max-width: none; max-height: none; }
.tws-head { display: none; }
.tws-search { position: relative; display: flex; align-items: center; margin: 0 0 6px; flex: none; }
.tws-search[hidden] { display: none; }
.tws-search svg { position: absolute; left: 10px; width: 14px; height: 14px; color: rgb(var(--v3-fg-3, 108 108 120)); pointer-events: none; }
.tws-search input { width: 100%; height: 32px; padding: 0 10px 0 30px; border-radius: 6px; font-size: 13px; box-sizing: border-box; outline: none;
  border: 1px solid rgb(var(--v3-input-line, 220 220 226)); background: rgb(var(--v3-input, 255 255 255)); color: inherit; }
.tws-search input:focus { border-color: rgb(var(--v3-accent, 244 55 88) / .65); box-shadow: 0 0 0 3px rgb(var(--v3-accent, 244 55 88) / .14); }
.tws-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain; outline: none; min-height: 0; flex: 1 1 auto; }
.tws-group { padding: 8px 8px 3px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgb(var(--v3-fg-3, 108 108 120)); }
.tws-row { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 8px; border-radius: 8px; cursor: pointer; color: rgb(var(--v3-fg, 12 12 15)); user-select: none; -webkit-user-select: none; }
.tws-row.is-act { background: rgb(var(--v3-hover, 24 24 27 / .04)); }
.tws-row.on { background: rgb(var(--v3-picked, 252 221 228)); box-shadow: inset 3px 0 0 rgb(var(--v3-accent, 244 55 88)); font-weight: 600; }   /* the shared picked look (Terry msg 2164) */
.tws-row.on.is-act { box-shadow: inset 4px 0 0 rgb(var(--v3-accent, 244 55 88)), inset 0 0 0 1px rgb(var(--v3-accent, 244 55 88) / .35); }
.tws-row.is-off { opacity: .45; cursor: default; }
.tws-t { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.tws-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tws-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 400; color: rgb(var(--v3-fg-3, 108 108 120)); }
.tws-row > .tws-tick { flex: none; width: 14px; height: 14px; color: rgb(var(--v3-accent-ink, 196 28 62)); }
.tws-img { flex: none; width: 32px; height: 32px; border-radius: 7px; overflow: hidden; border: 1px solid rgb(var(--v3-line-2, 218 218 225)); background: rgb(var(--v3-surface-2, 248 248 250)); }
.tws-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* the product picker (Terry msg 1907): a wide menu, a 36px picture, the name over up to two lines, a muted line with the ID, variants and price,
   "Select all shown" and "Clear" at the top of a many-choice one */
.tws-menu.is-product .tws-row { align-items: flex-start; min-height: 48px; padding: 7px 8px; }
.tws-menu.is-product .tws-img { width: 36px; height: 36px; }
.tws-img-na { display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; color: rgb(var(--v3-fg-3, 108 108 120)); }
.tws-menu.is-product .tws-l { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.tws-menu.is-product .tws-s { margin-top: 2px; }
.tws-bulk { display: flex; gap: 6px; padding: 2px 6px 6px; }
.tws-bulk[hidden] { display: none; }
.tws-bulk-b { font: inherit; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; color: rgb(var(--v3-accent-ink, 196 28 62)); background: none; border: 0; cursor: pointer; }
.tws-bulk-b:hover, .tws-bulk-b:focus-visible { background: rgb(var(--v3-hover, 240 240 244)); }
.tws-box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid rgb(var(--v3-line-2, 218 218 225)); background: rgb(var(--v3-input, 255 255 255)); color: transparent; }
.tws-box svg { width: 11px; height: 11px; }
.tws-box.on { background: rgb(var(--v3-accent, 244 55 88)); border-color: rgb(var(--v3-accent, 244 55 88)); color: #fff; }
.tws-none { margin: 6px 8px; font-size: 12.5px; color: rgb(var(--v3-fg-3, 108 108 120)); }

/* ---- a phone: a sheet from the bottom (the side panel's look), big rows, a title and × */
.tws-back { position: fixed; inset: 0; z-index: 2147482999; background: rgba(0, 0, 0, .38); }
.tws-menu.is-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; max-height: min(72vh, 560px) !important;
  border-radius: 16px 16px 0 0; border-bottom: 0; padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); font-size: 15px; }
.tws-menu.is-sheet .tws-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 8px; flex: none; }
.tws-menu.is-sheet .tws-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tws-x { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: rgb(var(--v3-fg-2, 70 70 80)); background: transparent; border: 0; cursor: pointer; }
.tws-x:hover { background: rgb(var(--v3-hover, 24 24 27 / .04)); }
.tws-menu.is-sheet .tws-row { min-height: 46px; padding: 8px 10px; }
.tws-menu.is-sheet .tws-search input { height: 40px; font-size: 16px; }   /* 16px: no zoom-in on an iPhone */
