/* Drop-down (dd): the list a select opens, drawn by the page (public/assets/dropdown.js; docs/ui-style-guide.md).
   The button's look (height, border, arrow, font) is the select's own: ui.css and each page draw "select, .dd-trigger"
   together. This file holds what is new: the hidden native select, the control's box, the open list and its options.
   Colours are palette tokens, with the palette's own values as fallbacks for the visitor widget and the customer
   portal, which do not load ui.css. */

/* the native select stays in the page (value, events, form) but is not seen and not reached by Tab or a screen reader */
select[data-dd]{position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;margin:0!important;padding:0!important;border:0!important;opacity:0;pointer-events:none;clip-path:inset(50%)}

.dd{position:relative;display:inline-block;max-width:100%;vertical-align:middle}
.dd[hidden]{display:none}
.dd-trigger{display:inline-flex;align-items:center;width:100%;text-align:left;cursor:pointer;line-height:normal}
.dd-trigger:disabled{cursor:default}
/* the chosen option on top of hidden copies of every option, so the button is as wide as the widest, as a native
   select is, and does not change width when the choice changes */
.dd-face{display:inline-grid;min-width:0;max-width:100%;overflow:hidden}
.dd-face>span{grid-area:1/1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dd-ghost{visibility:hidden;height:0}

.dd-menu{position:absolute;top:calc(100% + 4px);left:0;z-index:1000;min-width:100%;max-width:min(420px,90vw);max-height:280px;overflow:auto;
  margin:0;padding:4px 0;list-style:none;background:var(--c-white,#fff);border:1px solid var(--c-border,#d8dcde);border-radius:4px;
  box-shadow:0 4px 16px var(--c-shadow,rgba(0,0,0,.15));outline:none;text-align:left}
.dd.up .dd-menu{top:auto;bottom:calc(100% + 4px)}
.dd-menu[hidden]{display:none}
.dd-group{margin:0;padding:0;list-style:none}
.dd-group-label{padding:8px 12px 2px;font-size:11px;color:var(--c-muted,#5f6a73);text-transform:uppercase;letter-spacing:.02em}
.dd-group .dd-option{padding-left:20px}
/* options are menu-items (ui.css); the widget and the portal get the same box here */
.dd-option{display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px 8px 28px;position:relative;color:var(--c-ink,#2f3941);font-size:13px;white-space:nowrap;cursor:pointer;box-sizing:border-box}
.dd-option.active,.dd-option:hover{background:var(--c-bg-soft,#f3f4f5)}
.dd-option[aria-selected="true"]{font-weight:600}
.dd-option[aria-selected="true"]::before{content:"";position:absolute;left:11px;top:50%;width:5px;height:9px;margin-top:-6px;border:solid var(--c-blue,#3b6fc4);border-width:0 2px 2px 0;transform:rotate(45deg)}
.dd-option[aria-disabled="true"]{color:var(--c-muted,#5f6a73);cursor:default;background:none}
.dd.open .dd-trigger{border-color:var(--c-blue,#3b6fc4)}
