
:root {   
  --cl-txt: #282828;
  --cl-p: #555;
  --clgrey: #f3f3ed;
  --cl-white: white;   /* rinominata da --white per non sovrascrivere il --white globale (#FAF9F6) */
  --cl-brand: #0d9483;
  --cl-softgrey: #aaa;
  --cl-brand-dark: #1c2030;
  --cl-hoverlink: #02443c;
  --boxshadow: -1px -1px 4px rgb(184, 184, 184), 1px 1px 4px rgb(184, 184, 184);
  --font-normal: 'urbanist', sans-serif; 
  --font-special: 'urbanist', sans-serif;
  --bradius:5px;
  --bubbleshadow: 0, 90, 160;
}
 
    .cookie-wrapper {
      position: fixed;
      bottom: 24px;
      left: 24px;
      z-index: 9999;
      max-width: 500px;
      width: calc(100% - 48px);
      max-height: calc(100vh - 48px);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
    }
 
    /* Banner aperto */
    .cookie-banner {
      background: #ffffff;
      border-top: 4px solid var(--cl-brand);
      border-left: 1px solid var(--cl-softgrey);
      border-right: 1px solid var(--cl-softgrey);
      border-bottom: 1px solid var(--cl-softgrey);
      border-radius: 6px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
      padding: 22px 22px 18px;
      animation: slideUp 0.35s cubic-bezier(0.22,1,0.36,1);
      max-height: calc(100vh - 80px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;        /* Firefox */
      -ms-overflow-style: none;
    }
 
    .cookie-banner::-webkit-scrollbar {
        display: none;                /* Chrome/Safari/Android */
      }
    /* Solo la zona testo scorre, header e bottoni restano fissi */
    .cookie-banner #case3DefaultView,
    .cookie-banner .cb-text,
    .cookie-banner .cb-customize {
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      flex: 1;
      min-height: 0;
    }
 
    .btn-row {padding-top:22px;}
 
    @keyframes slideUp {
      from { opacity: 0; transform: translateY(20px); }
      to   { opacity: 1; transform: translateY(0); }
    }
 
    /* Header: icona + titolo */
    .cb-icon {
      width: 20px;
      height: 20px;
      color: var(--cl-brand);
      flex-shrink: 0;
    }
 
    .cb-title {
      font-size: 14px;
      letter-spacing: 0.06em;
      color: var(--cl-brand);
    }
 
    /* Testo informativo */
    .cb-text {
      font-size: 14px;
      line-height: 1.6;
      color: var(--cl-p);
      margin-bottom: 18px;
    }
 
    .cb-text a {
      color: var(--cl-brand);
      text-decoration: underline;
    }
 
    .cb-text a:hover { color: var(--cl-hoverlink); }
 
    /* Bottoni principali */
    .cb-btn {
      font-family: var(--font-normal);
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      padding: 9px 18px;
      border-radius: 4px;
      border: none;
      cursor: pointer;
      transition: background 0.2s, color 0.2s, transform 0.15s;
      white-space: nowrap;
    }
 
    .cb-btn:active { transform: scale(0.97); }
 
    .cb-btn-primary {
      background: var(--cl-brand);
      color: white;
    }
 
    .cb-btn-primary:hover { background: var(--cl-brand-dark); }
 
    .cb-btn-secondary {
      background: transparent;
      color: var(--cl-brand);
      border: 1.5px solid var(--cl-brand);
    }
 
    .cb-btn-secondary:hover {
      background: var(--cl-brand);
      color: white;
    }
 
    /* Pulsante "Continua senza accettare" */
    .cb-btn-skip {
      background: none;
      border: 1px solid var(--cl-softgrey);
      font-family: var(--font-normal);
      font-size: 12px;
      color: var(--cl-softgrey);
      padding: 6px;
      border-radius:var(--bradius); 
      transition: color 0.2s, border 0.2s;
      white-space: nowrap;
      max-width:200px;      
    }
 
    .cb-btn-skip:hover { color: var(--cl-brand); border: 1px solid var(--cl-brand);}
 
    /* Pulsante back */
    .cb-btn-back {
      background: none;
      border: 1px solid var(--cl-softgrey);
      border-radius: var(--bradius);      
      font-size: 12px;
      color: var(--cl-p);     
      padding: 9px 11px;     
      transition: border-color 0.2s, color 0.2s;
      flex-shrink: 0;
    }
 
    .cb-btn-back:hover {
      border-color: var(--cl-brand);
      color: var(--cl-brand);
    }
 
    /* ---- Pannello personalizzazione ---- */
    .cb-customize { margin-bottom: 14px; }
 
    /* Topbar: back + abilita/disabilita tutto */
    .cb-customize-topbar { margin-bottom: 12px; padding-bottom:10px; border-bottom:1px solid var(--cl-softgrey);}
 
    /* Pulsanti testuali abilita/disabilita tutto */
    .cb-btn-toggle-all {
      background: none;
      border: none;
      font-family: var(--font-normal);
      font-size: 11px;
      font-weight: 600;      
      text-transform: uppercase;
      color: var(--cl-brand);
      padding: 0;           
      transition: color 0.2s;
    }
 
    .cb-btn-toggle-all:hover { color: var(--cl-brand-dark); }
 
    /* Singola riga cookie */
    .cookie-item {
      padding: 10px 0;
      border-bottom: 1px solid #f0f0f0;
    }
 
    .cookie-item:last-child { border-bottom: none; }
 
    /* Colonna sinistra: nome + descrizione */
    .cookie-item-info { flex: 1; }
 
    .cookie-item-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--cl-txt);
    }
 
    .cookie-item-desc {
      font-size: 14px;
      color: #999;
      line-height: 1.5;
      margin-top: 3px;
      text-align: justify;
    }
 
    /* Badge "Sempre attivi" */
    .cookie-item-badge {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding: 2px 7px;
      border-radius: 3px;
      background: var(--clgrey);
      color: #888;
      white-space: nowrap;
      border:1px solid var(--cl-softgrey);
    }
 
    /* Toggle switch */
    .cb-toggle {
      position: relative;
      width: 36px;
      height: 20px;
      flex-shrink: 0;
    }
 
    .cb-toggle input { opacity: 0; width: 0; height: 0; }
 
    .cb-toggle-slider {
      position: absolute;
      inset: 0;
      background: #ddd;
      border-radius: 20px;
      cursor: pointer;
      transition: background 0.25s;
    }
 
    .cb-toggle-slider::before {
      content: '';
      position: absolute;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: white;
      left: 3px;
      top: 3px;
      transition: transform 0.25s;
    }
 
    .cb-toggle input:checked + .cb-toggle-slider { background: var(--cl-brand); }
    .cb-toggle input:checked + .cb-toggle-slider::before { transform: translateX(16px); }
    .cb-toggle input:disabled + .cb-toggle-slider { opacity: 0.5; cursor: not-allowed; }
 
    /* =============================================
       ICONA ICONIZZATA
    ============================================= */
    .cookie-icon-bubble {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background: var(--cl-white);
      border:1px solid var(--cl-softgrey);
      box-shadow: 0 4px 16px rgba(0,90,160,0.35);
      cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s;
      animation: popIn 0.3s cubic-bezier(0.22,1,0.36,1);
    }
 
    .cookie-icon-bubble:hover {      
      box-shadow: 0 6px 20px rgba(0,90,160,0.45);
    }
 
    @keyframes popIn {
      from { opacity: 0; transform: scale(0.6); }
      to   { opacity: 1; transform: scale(1); }
    }
 
    .cookie-icon-bubble svg {
      width: 26px;
      height: 26px;
      color:var(--cl-brand);
    }
 
    @media (max-width: 768px) {
      .cookie-icon-bubble { width: 35px; height: 35px; }
      .cookie-icon-bubble svg { width: 20px; height: 20px; }
      .cookie-wrapper {
        bottom: 60px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: 100%;
      }
      .cookie-banner {
        max-height: calc(100dvh - 200px); /* svh tiene conto della barra del browser */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
    }
 
    @media (max-width: 600px) {
      .cookie-banner { padding: 18px 16px 16px; }
      .cb-actions { flex-wrap: wrap; }
      .cb-btn { flex: 1; text-align: center; }
      .cb-btn-skip { width: 100%; text-align: center; }
    }
    
    /* Altezza ridotta indipendentemente dalla larghezza:
   tablet in orizzontale, notebook 14", finestre desktop basse */
    @media (max-height: 820px) {
      .cookie-wrapper {
        bottom: 16px;
      }
      .cookie-banner {
        max-height: calc(100dvh - 150px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
    }

    
    /* =============================================
    ID CONSENT
    ============================================= */
    .consent-id-section {
      padding: 5px 0;
      border-top: 0.5px solid var(--cl-softgrey); 
      display:flex;
      align-items:center;
      gap:2px;   
      width:100%;
    }
    .consent-id-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;  
      color: var(--cl-txt);  
      width:90px;  
    }
    .consent-id-code {
      display: block;
      font-family: monospace;
      font-size: 11px;
      background: white;
      border: 2px dotted var(--cl-softgrey);
      border-radius: 2px;
      padding: 5px;
      width: 100%;
      box-sizing: border-box;  
      user-select: all;
      cursor: text;
    }
 
    .spc-btw  { justify-content: space-between; }
    .column   { flex-direction: column; }
    .mb10     { margin-bottom: 10px; }
    .border-t { border-top: 1px solid var(--cl-softgrey); }
    .hidden   { display: none; }