/* PW Cookie Consent – grafica allineata al tema PoliticoWeb
   (Montserrat, rosso #c8071e, nero #0a0a0a, radius 16/24, bottoni pill, kicker uppercase) */
:root {
  --pwcc-red: #c8071e;
  --pwcc-red-dk: #a00618;
  --pwcc-black: #0a0a0a;
  --pwcc-font: 'Montserrat', sans-serif;
  --pwcc-radius: 16px;
  --pwcc-shadow: 0 15px 50px rgba(0,0,0,0.25);
  --pwcc-z: 99999;
}

/* ---------- comuni ---------- */
.pwcc-banner, .pwcc-modal, .pwcc-placeholder { font-family: var(--pwcc-font); font-size: 15px; line-height: 1.5; box-sizing: border-box; }
.pwcc-banner *, .pwcc-modal *, .pwcc-placeholder * { box-sizing: border-box; }
.pwcc-banner p, .pwcc-modal p { margin: 0 0 10px; }
.pwcc-banner a, .pwcc-modal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pwcc-kicker {
  display: inline-block; background: var(--pwcc-red); color: #fff; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; padding: 5px 12px; border-radius: 50px; margin-bottom: 10px;
}
.pwcc-pill { display: inline-block; background: var(--pwcc-red); color: #fff; padding: 8px 20px; border-radius: 25px; font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; }

/* bottoni pill */
.pwcc-btn {
  font-family: var(--pwcc-font); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.8px; text-transform: uppercase;
  border-radius: 50px; padding: 13px 24px; border: 2px solid transparent; cursor: pointer; line-height: 1.1;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1); background: transparent; min-height: 44px; text-decoration: none !important;
}
.pwcc-btn--primary { background: var(--pwcc-red); color: #fff !important; border-color: var(--pwcc-red); }
.pwcc-btn--primary:hover { background: var(--pwcc-red-dk); border-color: var(--pwcc-red-dk); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(200,7,30,0.3); }
.pwcc-btn--outline { color: inherit; border-color: currentColor; }
.pwcc-btn--outline:hover { background: var(--pwcc-red); border-color: var(--pwcc-red); color: #fff; }
.pwcc-btn--link { color: inherit; opacity: 0.8; padding-left: 8px; padding-right: 8px; text-decoration: underline !important; text-underline-offset: 3px; }
.pwcc-btn--link:hover { opacity: 1; color: var(--pwcc-red); }
.pwcc-btn--inline { display: inline-block; }

/* ---------- banner ---------- */
.pwcc-banner {
  position: fixed; z-index: var(--pwcc-z); opacity: 0; transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.pwcc-banner.is-visible { opacity: 1; transform: translateY(0); }
.pwcc-banner[hidden] { display: none; }
.pwcc-banner__title { font-size: 1.15rem; font-weight: 800; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.2px; }
.pwcc-banner__text p { font-size: 0.88rem; opacity: 0.9; }
.pwcc-links { font-size: 0.8rem; opacity: 0.75; }
.pwcc-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }

/* temi */
.pwcc-dark { color: #fff; }
.pwcc-dark .pwcc-banner__inner, .pwcc-dark.pwcc-bar { background: var(--pwcc-black); border-top: 4px solid var(--pwcc-red); }
.pwcc-light { color: var(--pwcc-black); }
.pwcc-light .pwcc-banner__inner, .pwcc-light.pwcc-bar { background: #fff; border: 2px solid var(--pwcc-red); }

/* layout card */
.pwcc-card { left: 20px; bottom: 20px; width: min(440px, calc(100vw - 40px)); }
.pwcc-card .pwcc-banner__inner { border-radius: var(--pwcc-radius); padding: 24px 24px 22px; box-shadow: var(--pwcc-shadow); }
.pwcc-card .pwcc-btn--link { width: 100%; text-align: left; padding-left: 0; }

/* layout barra */
.pwcc-bar { left: 0; right: 0; bottom: 0; box-shadow: 0 -8px 30px rgba(0,0,0,0.2); }
.pwcc-bar .pwcc-banner__inner { max-width: 1200px; margin: 0 auto; padding: 22px 24px; display: flex; gap: 28px; align-items: center; }
.pwcc-bar .pwcc-banner__text { flex: 1; }
.pwcc-bar .pwcc-banner__actions { flex-shrink: 0; margin-top: 0; }

@media (max-width: 767px) {
  .pwcc-card { left: 0; right: 0; bottom: 0; width: 100%; }
  .pwcc-card .pwcc-banner__inner { border-radius: 24px 24px 0 0; padding: 22px 20px 26px; }
  .pwcc-bar .pwcc-banner__inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .pwcc-banner__actions { flex-direction: column; align-items: stretch; }
  .pwcc-banner__actions .pwcc-btn { width: 100%; text-align: center; }
  .pwcc-card .pwcc-btn--link { text-align: center; }
}

/* ---------- modale preferenze ---------- */
.pwcc-modal { position: fixed; inset: 0; z-index: calc(var(--pwcc-z) + 1); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity 0.25s ease; }
.pwcc-modal.is-visible { opacity: 1; }
.pwcc-modal[hidden] { display: none; }
.pwcc-modal__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,0.75); backdrop-filter: blur(3px); }
.pwcc-modal__card {
  position: relative; background: #fff; color: var(--pwcc-black); width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  border-radius: 24px; padding: 26px 28px 24px; box-shadow: var(--pwcc-shadow); border: 2px solid var(--pwcc-red);
  transform: translateY(16px); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.pwcc-modal.is-visible .pwcc-modal__card { transform: translateY(0); }
.pwcc-modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pwcc-modal__close { background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: #666; padding: 0 4px; }
.pwcc-modal__close:hover { color: var(--pwcc-red); }
.pwcc-modal h3 { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; line-height: 1.2; }
.pwcc-modal__intro { font-size: 0.88rem; color: #666; margin-bottom: 18px; }
.pwcc-cats { display: flex; flex-direction: column; gap: 12px; }
.pwcc-cat { background: #f5f5f7; border-radius: 12px; padding: 14px 16px; border-left: 4px solid var(--pwcc-red); }
.pwcc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.pwcc-cat strong { font-size: 0.95rem; font-weight: 700; }
.pwcc-cat__always { display: inline-block; margin-left: 8px; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--pwcc-red); font-weight: 700; }
.pwcc-cat p { font-size: 0.82rem; color: #555; margin: 0; }
.pwcc-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }

/* switch */
.pwcc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.pwcc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pwcc-switch__track { position: absolute; inset: 0; background: #ccc; border-radius: 26px; transition: all 0.25s; }
.pwcc-switch__track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: all 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.pwcc-switch input:checked + .pwcc-switch__track { background: var(--pwcc-red); }
.pwcc-switch input:checked + .pwcc-switch__track::before { transform: translateX(20px); }
.pwcc-switch input:disabled + .pwcc-switch__track { opacity: 0.55; cursor: not-allowed; }
.pwcc-switch input:focus-visible + .pwcc-switch__track { outline: 2px solid var(--pwcc-red); outline-offset: 2px; }
body.pwcc-lock { overflow: hidden; }

@media (max-width: 767px) {
  .pwcc-modal { align-items: flex-end; padding: 0; }
  .pwcc-modal__card { border-radius: 24px 24px 0 0; max-height: 92vh; width: 100%; border-width: 2px 0 0; padding: 22px 20px 28px; }
  .pwcc-modal__actions { flex-direction: column; align-items: stretch; }
  .pwcc-modal__actions .pwcc-btn { width: 100%; text-align: center; }
}

/* ---------- segnaposto iframe bloccati ---------- */
.pwcc-hidden { display: none !important; }
.pwcc-placeholder {
  display: flex; align-items: center; justify-content: center; min-height: 220px; width: 100%; margin: 15px 0;
  background: var(--pwcc-black) url('https://www.transparenttextures.com/patterns/black-paper.png'); color: #fff;
  border: 2px solid rgba(200,7,30,0.5); border-radius: 12px; padding: 24px; text-align: center;
}
.pwcc-placeholder__inner { max-width: 420px; }
.pwcc-placeholder p { font-size: 0.9rem; margin: 0 0 14px; opacity: 0.9; }

/* ---------- pulsante flottante (riapre le preferenze) ---------- */
.pwcc-float {
  position: fixed; bottom: 18px; z-index: var(--pwcc-z); display: flex; align-items: center; gap: 0;
  height: 48px; padding: 0 13px; border: 0; border-radius: 50px; cursor: pointer;
  background: var(--pwcc-black); color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,0.25), 0 0 0 2px var(--pwcc-red) inset;
  font-family: var(--pwcc-font); font-size: 0.72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  opacity: 1; transition: background 0.3s, gap 0.3s, box-shadow 0.3s;
}
.pwcc-float--left { left: 18px; }
.pwcc-float--right { right: 18px; }
.pwcc-float svg { flex-shrink: 0; color: var(--pwcc-red); transition: color 0.3s; }
.pwcc-float__label { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 0.3s ease, margin 0.3s ease; }
.pwcc-float:hover, .pwcc-float:focus-visible { background: var(--pwcc-red); gap: 8px; outline: none; box-shadow: 0 8px 30px rgba(200,7,30,0.35); }
.pwcc-float:hover svg, .pwcc-float:focus-visible svg { color: #fff; }
.pwcc-float:hover .pwcc-float__label, .pwcc-float:focus-visible .pwcc-float__label { max-width: 160px; }
@media (max-width: 767px) {
  .pwcc-float { height: 42px; padding: 0 10px; bottom: 14px; }
  .pwcc-float--left { left: 12px; }
  .pwcc-float--right { right: 12px; }
  .pwcc-float__label { display: none; }
}

/* ---------- link footer / policy ---------- */
.pwcc-footer-link { text-align: center; font-size: 0.78rem; padding: 10px 15px 14px; font-family: var(--pwcc-font); }
.pwcc-footer-link a { color: inherit; opacity: 0.7; text-decoration: underline; text-underline-offset: 2px; }
.pwcc-footer-link a:hover { opacity: 1; color: var(--pwcc-red); }
.pwcc-policy__meta { font-size: 0.85rem; color: #666; font-style: italic; }
.pwcc-policy h3 { border-left: 6px solid var(--pwcc-red); padding-left: 12px; margin-top: 28px; }
.pwcc-policy__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 10px 0 20px; }
.pwcc-policy__table th { background: var(--pwcc-black); color: #fff; text-align: left; padding: 10px 12px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }
.pwcc-policy__table td { padding: 9px 12px; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
.pwcc-policy__table tr:nth-child(even) td { background: #f8f8f8; }

@media print { .pwcc-banner, .pwcc-modal, .pwcc-footer-link { display: none !important; } }
