/* Tendina con ricerca (js/cerca-select.js), nello stile della "select con ricerca" di Bootstrap Italia.
   Colori: --ente nel portale, --c-primary nel back-office. */
.cs { position: relative; --cs-primario: var(--ente, var(--c-primary, #0066CC)); --cs-primario-scuro: var(--ente-scuro, var(--c-primary-dark, #004D99)); }

.cs .cs-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 2.5rem; margin: 0; padding: 8px;
  background: transparent; border: 0; border-bottom: 1px solid #5d7083; border-radius: 0; box-shadow: none;
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.5; color: #1a1a1a; text-align: left; cursor: pointer;
}
.cs .cs-toggle:hover { border-bottom-color: #1a1a1a; box-shadow: inset 0 -1px 0 #1a1a1a; }
.cs .cs-toggle:focus-visible { outline: 2px solid #f90; outline-offset: 2px; }
.cs .cs-toggle.cs-errore { border-bottom-color: #cc334d; box-shadow: inset 0 -1px 0 #cc334d; }
.cs .cs-testo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs .cs-freccia { display: inline-block; flex: none; font-size: 1rem; line-height: 1; color: #1a1a1a; transition: transform .2s; }
.cs.cs-aperto .cs-freccia { transform: rotate(180deg); }

.cs .cs-menu {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1060; margin-top: 2px; padding: 8px 0;
  background: #fff; border-radius: 0 0 4px 4px; box-shadow: 0 2px 10px 0 rgba(0, 0, 0, .15);
}
.cs .cs-menu[hidden] { display: none; }
.cs .cs-cerca { position: relative; padding: 8px 24px 12px; }
.cs .cs-cerca .bi-search { position: absolute; left: 24px; top: calc(50% - 2px); transform: translateY(-50%); color: #5d7083; pointer-events: none; }
.cs .cs-cerca input[type=search] {
  display: block; width: 100%; min-height: 0; height: auto; margin: 0; padding: 6px 0 6px 28px;
  border: 0; border-bottom: 1px solid #c5c7c9; border-radius: 0; box-shadow: none; background: transparent;
  font: inherit; font-size: 1rem; font-weight: 600; color: #1a1a1a;
}
.cs .cs-cerca input[type=search]:focus { outline: none; border-bottom-color: var(--cs-primario); box-shadow: inset 0 -1px 0 var(--cs-primario); }
.cs .cs-cerca input[type=search]::placeholder { color: #5d7083; font-weight: 400; opacity: 1; }

.cs .cs-lista { position: relative; list-style: none; margin: 0; padding: 0; max-height: min(18rem, 50vh); overflow-y: auto; }
.cs .cs-gruppo { padding: 12px 24px 4px; font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: #1a1a1a; }
.cs .cs-voce { padding: 8px 24px; font-size: 1rem; line-height: 1.5; color: var(--cs-primario); cursor: pointer; }
.cs .cs-voce:hover, .cs .cs-voce.cs-attiva { background: #f2f7fc; text-decoration: underline; }
.cs .cs-voce.cs-scelta { color: var(--cs-primario-scuro); font-weight: 600; text-decoration: underline; }
.cs .cs-stato { padding: 8px 24px; font-size: .875rem; font-weight: 600; color: #995c00; }
.cs .cs-stato:empty { display: none; }

/* La tendina vera resta nel modulo (invio e controllo "obbligatorio"), invisibile sotto la casella */
.cs select.cs-nativa {
  position: absolute !important; left: 0; bottom: 0; width: 100% !important; height: 1px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none;
}
