/* The category / subcategory dropdowns' OWN LIST in the results pages' mobile view (below 992px: the Lista / Mapa view).
   Owner 2026-11-20, from two photos of his phone with the two dropdowns open: "in the mobile view those drop downs should not be wrapping
   ... each [entry] only one line ... make them wider, wide enough to accommodate for any longer category or sub category"
   (docs/IP-Reference.md section CL, registry L33).

   A phone draws a <select>'s open list itself - on an iPhone a menu about 230px wide that wraps "Ogrzewanie i Klimatyzacja (HVAC) (4)"
   onto three lines - and a page cannot widen it or change its text. So in the mobile view the site opens its own list instead
   (public/js/ip-select-list.js): every entry on ONE line, the list as wide as its longest entry, up to the screen's edge. The closed
   control is not touched: it is still the same <select>, drawn by web.css exactly as before - a transparent button lies over it and takes
   the tap, so the phone's own menu never opens.

   Nothing here is a look of its own (design guard, docs/IP-Design-Guard.md): the panel is the look of the site's other dropdown lists -
   the keyword suggestions under the search field at every width (web.css .keySug) and the location list of the search bar from 700px up
   (ip-chrome.css .location-picker-panel; on a phone that one is a full-screen sheet): white, --radius-lg, --elevation-2, a hairline
   between the rows, the grey tint on the row under the pointer, one line with an ellipsis as the last resort. The text is the dropdown's
   own 14px (select.select-css) - smaller than those two lists' rows on a phone (16px and 18px), and it has to be: at 16px the longest
   names of the directory would not fit on one line on a 360px phone. The rows' 16px side padding (those lists: 24px) is for the same
   reason. Tokens only.
   From 992px up the script adds nothing and the browser's own dropdown is used, as before. */

/* the dropdown's wrapper: only the place the button is laid over */
.category-subcat-select.ip-select-list-host {
  position: relative;
}
/* the select under the button can no longer be touched at all - not at its rounded corners, not by a phone's "nearest control" guess -
   so the phone's own menu cannot open beside the list. It changes nothing of what the select looks like. */
.ip-select-list-host select.select-css {
  pointer-events: none;
}

/* the tap target over the <select>: invisible, exactly the select's box */
.ip-select-list__trigger {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-md);
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
/* the ring of .select-css:focus (web.css), around the same box: while this control's list is open, and for the keyboard. Two rules with
   the same declarations on purpose: a browser that does not know :focus-visible (an iPhone before iOS 15.4) throws away a whole rule
   that names it, and the ring of the open list must not go with it. */
.ip-select-list__trigger[aria-expanded="true"] {
  outline: 2px solid transparent;
  outline-offset: 0;
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.ip-select-list__trigger:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 0;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

/* everything outside the open list: a tap there closes the list and goes nowhere else */
.ip-select-list__backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10010; /* over the sticky header (9999); under the consent bar (10050) and the loading veil (99999) */
  -webkit-tap-highlight-color: transparent;
}

/* the list: under its dropdown, as wide as its longest entry - never narrower than the dropdown, never past the screen's edges
   (the script writes the place, the two width limits and the height it has room for) */
.ip-select-list {
  position: fixed;
  top: var(--ip-select-list-top, 0);
  left: var(--ip-select-list-left, 0);
  z-index: 10011;
  box-sizing: border-box;
  width: -webkit-max-content;
  width: max-content;
  min-width: var(--ip-select-list-min, 0);
  max-width: var(--ip-select-list-max, calc(100vw - 2 * var(--space-2)));
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-2);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent; /* a phone's grey flash would cover the whole list: the pressed row is tinted instead */
}
.ip-select-list__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: var(--ip-select-list-height, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ip-select-list__list:focus {
  outline: none; /* the row the keyboard is on is tinted instead */
}

/* one entry = one line, 44px to tap */
.ip-select-list__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  font: 14px/1.3 var(--font-sans);
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}
.ip-select-list__option:last-child {
  border-bottom: 0;
}
.ip-select-list__option:hover,
.ip-select-list__option:active,
.ip-select-list__option.is-active {
  background: var(--surface-100);
}
/* an entry that cannot be chosen (the dropdown's own first line, "Wybierz podkategorię") */
.ip-select-list__option[aria-disabled="true"] {
  background: none;
  color: var(--ink-muted);
  cursor: default;
}
/* only when the screen itself is too narrow for an entry does its end become an ellipsis - it never wraps */
.ip-select-list__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the check mark of the entry that is chosen now (the icon is as big as the text) */
.ip-select-list__check {
  flex: none;
  line-height: 1;
}
