/* InfoComuni - selettore lingua della scheda comune (28/09/2026; v3: su desktop nell'header)
   Desktop: tasto in vetro scuro accanto al riquadro "Sei qui come…" con menu.
   Mobile: pillola nella scheda "Sei qui come…" e pannello dal basso in stile iOS.
   Selettori con due :not(#id) perche' i fogli del sito usano !important e ID. */

:root{ --icl-ios-blue:#007AFF; --icl-ios-bg:#F2F2F7; --icl-ios-sep:rgba(60,60,67,.18); --icl-ios-sec:#8A8A8E; }

/* bandierina */
.icl-flag{ display:block; flex:none; width:22px; height:15px; border-radius:3px; overflow:hidden;
  box-shadow:0 0 0 .5px rgba(0,0,0,.28); background:#fff; }
.icl-flag--txt{ display:inline-flex; align-items:center; justify-content:center; font:700 9px/1 system-ui,sans-serif; color:#0B2340; }
.icl-chev{ width:12px; height:12px; flex:none; transition:transform .2s ease; }
.icl-btn[aria-expanded="true"] .icl-chev{ transform:rotate(180deg); }

/* ---------- tasto (base) ---------- */
html body button.icl-btn:not(#icl-z1):not(#icl-z2){
  display:inline-flex !important; align-items:center !important; gap:8px !important;
  margin:0 !important; cursor:pointer; white-space:nowrap !important;
  text-transform:none !important; letter-spacing:0 !important; box-sizing:border-box !important;
  -webkit-tap-highlight-color:transparent; min-width:0 !important; width:auto !important;
}

/* ---------- desktop: vetro scuro, stesso linguaggio del riquadro profilo ---------- */
html body button.icl-btn.icl-btn--vetro:not(#icl-z1):not(#icl-z2){
  position:absolute !important; z-index:21 !important;
  height:44px !important; min-height:44px !important; padding:0 12px !important;
  border:1px solid rgba(255,255,255,.55) !important; border-radius:10px !important;
  background:rgba(9,34,58,.72) !important; color:#fff !important; -webkit-text-fill-color:#fff !important;
  font-size:14px !important; font-weight:600 !important; line-height:1 !important;
  -webkit-backdrop-filter:blur(12px) saturate(140%); backdrop-filter:blur(12px) saturate(140%);
  box-shadow:0 8px 24px rgba(0,0,0,.22) !important;
  transition:border-color .15s ease, background-color .15s ease;
}
html body button.icl-btn.icl-btn--vetro:not(#icl-z1):not(#icl-z2):hover{ border-color:#5BC4FF !important; background:rgba(9,34,58,.86) !important; }
html body button.icl-btn:not(#icl-z1):not(#icl-z2):focus-visible{ outline:3px solid #5BC4FF !important; outline-offset:2px !important; }

.icl-menu{ position:absolute; z-index:30; min-width:200px; padding:6px; box-sizing:border-box;
  border-radius:12px; background:rgba(9,34,58,.94); border:1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter:blur(20px) saturate(150%); backdrop-filter:blur(20px) saturate(150%);
  box-shadow:0 18px 40px rgba(0,0,0,.35); animation:icl-pop .16s ease-out; }
.icl-menu[hidden]{ display:none !important; }
@keyframes icl-pop{ from{ opacity:0; transform:translateY(-4px) scale(.98); } to{ opacity:1; transform:none; } }
html body .icl-menu button.icl-menu__item:not(#icl-z1):not(#icl-z2){
  display:flex !important; align-items:center !important; gap:12px !important; width:100% !important;
  height:42px !important; margin:0 !important; padding:0 12px !important; border:0 !important; border-radius:8px !important;
  background:transparent !important; box-shadow:none !important; cursor:pointer; text-align:left !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important;
  font-size:15px !important; font-weight:500 !important; line-height:1 !important; text-transform:none !important; letter-spacing:0 !important;
}
html body .icl-menu button.icl-menu__item:not(#icl-z1):not(#icl-z2):hover,
html body .icl-menu button.icl-menu__item:not(#icl-z1):not(#icl-z2):focus-visible{ background:rgba(91,196,255,.20) !important; outline:none !important; }

/* ---------- mobile: pillola nella scheda "Sei qui come…" ---------- */
html body .ic-profilo:not(.ic-profilo--map):not(#icl-z1){ position:relative !important; padding-top:16px !important; }
/* la pillola vive dentro la scheda: altezza visiva 34px, area di tocco 46px */
html body button.icl-btn.icl-btn--pillola:not(#icl-z1):not(#icl-z2){
  position:absolute !important; right:14px !important; z-index:2 !important;
  height:34px !important; min-height:34px !important; max-height:34px !important; padding:0 10px 0 8px !important; gap:7px !important;
  border:0 !important; border-radius:999px !important;
  background:var(--icl-ios-bg) !important; color:#0B2340 !important; -webkit-text-fill-color:#0B2340 !important;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",system-ui,sans-serif !important;
  font-size:15px !important; font-weight:600 !important; line-height:1 !important; box-shadow:none !important;
}
html body button.icl-btn.icl-btn--pillola:not(#icl-z1):not(#icl-z2)::before{ content:""; position:absolute; inset:-6px -4px; }
html body button.icl-btn.icl-btn--pillola:not(#icl-z1):not(#icl-z2):active{ background:#E5E5EA !important; }
html body button.icl-btn.icl-btn--pillola .icl-flag{ width:20px; height:14px; }
html body button.icl-btn.icl-btn--pillola .icl-chev{ width:11px; height:11px; color:var(--icl-ios-sec); }

/* ---------- pannello dal basso (iOS) ---------- */
.icl-velo{ position:fixed; inset:0; z-index:2147483600; background:rgba(0,0,0,.38); opacity:0; transition:opacity .3s ease; }
.icl-velo.is-aperto{ opacity:1; }
.icl-velo[hidden], .icl-sheet[hidden]{ display:none !important; }
.icl-sheet{ position:fixed; left:0; right:0; bottom:0; z-index:2147483601; box-sizing:border-box;
  width:100%; max-width:560px; margin:0 auto; max-height:88vh; display:flex; flex-direction:column;
  padding:6px 16px calc(18px + env(safe-area-inset-bottom)); border-radius:14px 14px 0 0;
  background:var(--icl-ios-bg); color:#000; box-shadow:0 -10px 30px rgba(0,0,0,.18);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",system-ui,sans-serif;
  transform:translateY(100%); transition:transform .42s cubic-bezier(.32,.72,0,1);
  -webkit-font-smoothing:antialiased; }
.icl-sheet.is-aperto{ transform:translateY(0); }
.icl-sheet__grip{ width:36px; height:5px; border-radius:3px; background:#C7C7CC; margin:4px auto 6px; flex:none; }
.icl-sheet__testa{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; min-height:44px; margin:0 0 10px; flex:none; }
html body .icl-sheet h2.icl-sheet__titolo:not(#icl-z1):not(#icl-z2){ grid-column:2; margin:0 !important; padding:0 !important; border:0 !important;
  font-family:inherit !important; font-size:17px !important; font-weight:600 !important; line-height:1.3 !important;
  letter-spacing:-.01em !important; text-transform:none !important; color:#000 !important; -webkit-text-fill-color:#000 !important; }
html body .icl-sheet h2.icl-sheet__titolo:not(#icl-z1):not(#icl-z2)::before,
html body .icl-sheet h2.icl-sheet__titolo:not(#icl-z1):not(#icl-z2)::after{ display:none !important; }
html body .icl-sheet button.icl-sheet__chiudi:not(#icl-z1):not(#icl-z2){ grid-column:3; justify-self:end; min-height:44px !important;
  margin:0 !important; padding:0 4px !important; border:0 !important; background:none !important; box-shadow:none !important; cursor:pointer;
  font-family:inherit !important; font-size:17px !important; font-weight:600 !important; line-height:1 !important;
  text-transform:none !important; letter-spacing:0 !important; color:var(--icl-ios-blue) !important; -webkit-text-fill-color:var(--icl-ios-blue) !important; }
.icl-sheet__gruppo{ background:#fff; border-radius:12px; overflow:auto; -webkit-overflow-scrolling:touch; }
html body .icl-sheet button.icl-riga:not(#icl-z1):not(#icl-z2){ position:relative; display:flex !important; align-items:center !important; gap:14px !important;
  width:100% !important; min-height:58px !important; margin:0 !important; padding:8px 16px !important; box-sizing:border-box !important;
  border:0 !important; border-radius:0 !important; background:#fff !important; box-shadow:none !important; cursor:pointer; text-align:left !important;
  font-family:inherit !important; color:#000 !important; -webkit-text-fill-color:#000 !important; text-transform:none !important; letter-spacing:0 !important;
  -webkit-tap-highlight-color:transparent; }
html body .icl-sheet button.icl-riga:not(#icl-z1):not(#icl-z2) + button.icl-riga::before{ content:""; position:absolute; top:0; left:56px; right:0; height:.5px; background:var(--icl-ios-sep); }
html body .icl-sheet button.icl-riga:not(#icl-z1):not(#icl-z2):active{ background:#E5E5EA !important; }
html body .icl-sheet button.icl-riga:not(#icl-z1):not(#icl-z2):focus-visible{ outline:none !important; background:#E9F2FF !important; }
.icl-sheet .icl-flag{ width:26px; height:18px; border-radius:4px; }
.icl-riga__testi{ display:flex; flex-direction:column; gap:2px; flex:1 1 auto; min-width:0; }
.icl-riga__nome{ font-size:17px; font-weight:400; line-height:1.25; letter-spacing:-.01em; color:#000; -webkit-text-fill-color:#000; }
.icl-riga__sec{ font-size:13px; line-height:1.25; color:var(--icl-ios-sec); -webkit-text-fill-color:var(--icl-ios-sec); }
.icl-check{ width:18px; height:18px; flex:none; color:var(--icl-ios-blue); }
.icl-sheet__avviso{ min-height:18px; margin:10px 0 0; text-align:center; font-size:13px; color:var(--icl-ios-sec); flex:none; }

html.icl-cambio body{ transition:opacity .15s ease; opacity:.55; }
@media (prefers-reduced-motion:reduce){
  .icl-sheet, .icl-velo, .icl-chev, .icl-menu{ transition:none !important; animation:none !important; }
}

/* ---------- v3 desktop: nell'header del comune, stesso stile della pillola "Provincia di …" ---------- */
.icl-btn__cod{ display:none; }
html body .comune-header__utils.icl-host{ position:relative !important; }
html body button.icl-btn.icl-btn--testa:not(#icl-z1):not(#icl-z2){
  position:static !important; height:40px !important; min-height:40px !important; padding:0 12px 0 10px !important; gap:8px !important;
  border:1px solid rgba(91,196,255,.45) !important; border-radius:999px !important;
  background:rgba(91,196,255,.10) !important; color:#E7EEF6 !important; -webkit-text-fill-color:#E7EEF6 !important;
  font:600 14px/1 Inter,system-ui,sans-serif !important; letter-spacing:.08em !important;
  box-shadow:none !important; -webkit-backdrop-filter:none; backdrop-filter:none; order:9 !important;
  transition:border-color .15s ease, background-color .15s ease;
}
html body button.icl-btn.icl-btn--testa:not(#icl-z1):not(#icl-z2):hover{ border-color:#5BC4FF !important; background:rgba(91,196,255,.20) !important; }
html body button.icl-btn.icl-btn--testa .icl-btn__nome{ display:none !important; }
html body button.icl-btn.icl-btn--testa .icl-btn__cod{ display:inline !important; }
html body button.icl-btn.icl-btn--testa .icl-flag{ width:20px; height:14px; }
.comune-header__utils.icl-host .icl-menu{ z-index:1200; }
/* v4: il tema (ic-theme-tokens.css) nasconde con !important ogni figlio di .comune-header__utils
   che non sia il link "Provincia": il menu aperto va rimostrato con un selettore piu' specifico */
html body .comune-header__utils.icl-host > .icl-menu:not([hidden]):not(#icl-z1){ display:block !important; }
