/* Cookie GDPR - banner e pannello preferenze */
.cgdpr { --cgdpr-color: #2dc8b8; --cgdpr-dark: #1a2332; --cgdpr-text: #3b4550; --cgdpr-muted: #6b7680; --cgdpr-border: #e3e8ec; --cgdpr-radius: 14px; --cgdpr-z: 100000; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--cgdpr-text); }
.cgdpr *, .cgdpr *::before, .cgdpr *::after { box-sizing: border-box; }
.cgdpr [hidden] { display: none !important; }
.cgdpr-icon { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; color: var(--cgdpr-color); }
.cgdpr-link { color: var(--cgdpr-color); text-decoration: underline; font-weight: 600; }
.cgdpr-link:hover { color: var(--cgdpr-dark); }

/* pulsanti */
.cgdpr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid transparent; font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s; white-space: nowrap; }
.cgdpr-btn:active { transform: scale(.98); }
.cgdpr-btn--primary { background: var(--cgdpr-color); color: #fff; }
.cgdpr-btn--primary:hover { filter: brightness(.93); color: #fff; }
.cgdpr-btn--ghost { background: #fff; color: var(--cgdpr-dark); border-color: var(--cgdpr-border); }
.cgdpr-btn--ghost:hover { border-color: var(--cgdpr-color); color: var(--cgdpr-color); }
.cgdpr-btn:focus-visible, .cgdpr-switch input:focus-visible + .cgdpr-switch__track, .cgdpr-modal__close:focus-visible { outline: 3px solid color-mix(in srgb, var(--cgdpr-color) 45%, transparent); outline-offset: 2px; }

/* banner */
.cgdpr-banner { position: fixed; z-index: var(--cgdpr-z); left: 0; right: 0; bottom: 0; background: #fff; box-shadow: 0 -8px 30px rgba(15, 30, 40, .16); border-top: 3px solid var(--cgdpr-color); animation: cgdpr-up .35s ease-out; }
.cgdpr-banner__inner { max-width: 1320px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 24px; }
.cgdpr-banner__body { flex: 1 1 auto; min-width: 0; }
.cgdpr-banner__title { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--cgdpr-dark); line-height: 1.3; }
.cgdpr-banner__text { margin: 0; font-size: 13.5px; color: var(--cgdpr-text); }
.cgdpr-banner__actions { flex: 0 0 auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@keyframes cgdpr-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* varianti riquadro / centro */
.cgdpr--box-left .cgdpr-banner, .cgdpr--box-right .cgdpr-banner { left: 20px; right: auto; bottom: 20px; width: min(440px, calc(100vw - 40px)); border-radius: var(--cgdpr-radius); border-top: 0; box-shadow: 0 16px 48px rgba(15, 30, 40, .22); }
.cgdpr--box-right .cgdpr-banner { left: auto; right: 20px; }
.cgdpr--box-left .cgdpr-banner__inner, .cgdpr--box-right .cgdpr-banner__inner, .cgdpr--center .cgdpr-banner__inner { flex-direction: column; align-items: stretch; gap: 16px; padding: 22px; }
.cgdpr--box-left .cgdpr-banner__actions, .cgdpr--box-right .cgdpr-banner__actions, .cgdpr--center .cgdpr-banner__actions { justify-content: stretch; }
.cgdpr--box-left .cgdpr-btn, .cgdpr--box-right .cgdpr-btn, .cgdpr--center .cgdpr-btn { flex: 1 1 auto; }
.cgdpr--center .cgdpr-banner { left: 50%; bottom: auto; top: 50%; right: auto; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); border-radius: var(--cgdpr-radius); border-top: 0; animation: cgdpr-pop .3s ease-out; }
.cgdpr--center .cgdpr-banner::before { content: ""; position: fixed; inset: -100vh -100vw; background: rgba(15, 25, 35, .55); z-index: -1; }
@keyframes cgdpr-pop { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* pannello preferenze */
.cgdpr-modal { position: fixed; inset: 0; z-index: calc(var(--cgdpr-z) + 1); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cgdpr-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 25, 35, .6); }
.cgdpr-modal__dialog { position: relative; background: #fff; width: min(760px, 100%); max-height: min(90vh, 820px); display: flex; flex-direction: column; border-radius: var(--cgdpr-radius); box-shadow: 0 24px 64px rgba(0, 0, 0, .3); animation: cgdpr-pop2 .25s ease-out; }
@keyframes cgdpr-pop2 { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cgdpr-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--cgdpr-border); }
.cgdpr-modal__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--cgdpr-dark); }
.cgdpr-modal__close { border: 0; background: #f1f4f6; color: var(--cgdpr-dark); width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; }
.cgdpr-modal__close:hover { background: var(--cgdpr-color); color: #fff; }
.cgdpr-modal__body { padding: 18px 22px; overflow: auto; }
.cgdpr-modal__text { margin: 0 0 16px; font-size: 13.5px; }
.cgdpr-modal__foot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--cgdpr-border); background: #f8fafb; border-radius: 0 0 var(--cgdpr-radius) var(--cgdpr-radius); }

/* categorie */
.cgdpr-cat { border: 1px solid var(--cgdpr-border); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.cgdpr-cat__head { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; }
.cgdpr-cat__info { flex: 1 1 auto; min-width: 0; }
.cgdpr-cat__title { margin: 0; font-size: 15px; font-weight: 700; color: var(--cgdpr-dark); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cgdpr-cat__count { font-size: 12px; font-weight: 600; color: var(--cgdpr-muted); background: #eef2f5; border-radius: 999px; padding: 1px 8px; }
.cgdpr-cat__desc { margin: 4px 0 0; font-size: 13px; color: var(--cgdpr-muted); }
.cgdpr-cat__toggle { margin-top: 8px; background: none; border: 0; padding: 0; color: var(--cgdpr-color); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.cgdpr-cat__always { font-size: 12px; font-weight: 700; color: #2e8b57; white-space: nowrap; padding-top: 4px; }
.cgdpr-cat__table { border-top: 1px solid var(--cgdpr-border); padding: 6px 16px 12px; overflow-x: auto; }
.cgdpr-cat__table table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 0; }
.cgdpr-cat__table th, .cgdpr-cat__table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #eef2f5; vertical-align: top; }
.cgdpr-cat__table th { font-weight: 700; color: var(--cgdpr-dark); font-size: 12px; }
.cgdpr-cat__table code { font-size: 12px; color: var(--cgdpr-dark); background: #f1f4f6; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.cgdpr-cat__empty { font-size: 12.5px; color: var(--cgdpr-muted); margin: 0; }

/* switch */
.cgdpr-switch { position: relative; display: inline-block; flex: 0 0 auto; margin-top: 2px; }
.cgdpr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cgdpr-switch__track { display: block; width: 46px; height: 26px; border-radius: 999px; background: #cfd6dc; transition: background .2s; cursor: pointer; }
.cgdpr-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.cgdpr-switch input:checked + .cgdpr-switch__track { background: var(--cgdpr-color); }
.cgdpr-switch input:checked + .cgdpr-switch__track::after { transform: translateX(20px); }
.cgdpr-switch input:disabled + .cgdpr-switch__track { background: #2e8b57; cursor: not-allowed; opacity: .75; }

/* pulsante flottante */
.cgdpr-reopen { position: fixed; z-index: calc(var(--cgdpr-z) - 1); bottom: 18px; left: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: var(--cgdpr-color); box-shadow: 0 6px 20px rgba(15, 30, 40, .2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s, background .15s, color .15s; }
.cgdpr-reopen svg { width: 24px; height: 24px; }
.cgdpr-reopen:hover { background: var(--cgdpr-color); color: #fff; transform: translateY(-2px); }
.cgdpr-reopen--right { left: auto; right: 18px; }

/* contenuti bloccati (iframe) */
.cgdpr-blocked { position: relative; display: block; min-height: 180px; background: #f1f4f6; border: 1px dashed #c9d2d9; border-radius: 10px; padding: 24px 18px; text-align: center; color: var(--cgdpr-text); }
.cgdpr-blocked__title { margin: 0 0 6px; font-weight: 700; color: var(--cgdpr-dark); }
.cgdpr-blocked__text { margin: 0 0 12px; font-size: 13px; }

/* mobile */
@media (max-width: 767px) {
  .cgdpr-banner__inner { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .cgdpr-banner__actions { justify-content: stretch; }
  .cgdpr-banner__actions .cgdpr-btn { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .cgdpr-banner__actions .cgdpr-btn--primary { flex-basis: 100%; order: -1; }
  .cgdpr--box-left .cgdpr-banner, .cgdpr--box-right .cgdpr-banner { left: 10px; right: 10px; bottom: 10px; width: auto; }
  .cgdpr-modal { padding: 0; align-items: flex-end; }
  .cgdpr-modal__dialog { max-height: 94vh; border-radius: var(--cgdpr-radius) var(--cgdpr-radius) 0 0; }
  .cgdpr-modal__foot { border-radius: 0; }
  .cgdpr-modal__foot .cgdpr-btn { flex: 1 1 calc(50% - 10px); }
  .cgdpr-modal__foot .cgdpr-btn--primary { flex-basis: 100%; order: -1; }
  .cgdpr-reopen { bottom: 74px; width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .cgdpr-banner, .cgdpr-modal__dialog { animation: none; } }
