/*! 2pweb-consenso | grafica della cookie bar di soimm.com | 2P Web https://www.2pweb.it/ */
/*
 * Porting di src/styles/consent.css di soimm.com (classi .ck-* -> .p2wc-*).
 * Colori e font sono variabili: i valori predefiniti sono quelli di soimm.com.
 * Per cambiarli: :root { --p2wc-primario: #...; } (in WordPress li scrive il plugin).
 * Banner e pannello stanno dentro #p2wc: le regole hanno un id nel selettore e un reset
 * mirato, cosi' gli stili del tema (button, h2, p, a, ul...) non li alterano.
 */

/* Font inclusi (licenza SIL OFL 1.1, file in fonts/): si scaricano solo se usati. */
@font-face { font-family: 'P2WC DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url(fonts/dmsans-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'P2WC DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url(fonts/dmsans-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'P2WC Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlowcondensed-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'P2WC Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlowcondensed-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --p2wc-primario: #7B5B3A;        /* brand-brown */
  --p2wc-primario-scuro: #5a3e26;  /* brand-brown-dark */
  --p2wc-accento: #A68038;         /* brand-gold */
  --p2wc-titoli: #18120a;          /* brand-dark */
  --p2wc-testo: #2d1f14;           /* brand-text */
  --p2wc-tenue: #6b5745;           /* brand-muted */
  --p2wc-bordo: #e9e3dc;           /* brand-border */
  --p2wc-crema: #f8f7f5;           /* brand-cream */
  --p2wc-sfondo: #fff;
  --p2wc-font: 'P2WC DM Sans', 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --p2wc-font-titoli: 'P2WC Barlow Condensed', 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --p2wc-raggio: 12px;             /* radius-brand */
  --p2wc-z: 2147483000;
}

/* ── Reset mirato: niente stili del tema dentro banner e pannello ── */
#p2wc, #p2wc *, #p2wc *::before, #p2wc *::after { box-sizing: border-box; }
#p2wc :where(div, p, h2, ul, li, a, button, span, strong, code, details, summary) {
  margin: 0; padding: 0; border: 0 solid; background: none; box-shadow: none; text-shadow: none;
  font: inherit; color: inherit; letter-spacing: normal; word-spacing: normal; text-transform: none;
  text-decoration: none; text-align: inherit; text-indent: 0; line-height: inherit; float: none;
  width: auto; min-width: auto; max-width: none; height: auto; min-height: auto; max-height: none;
  opacity: 1; transform: none; filter: none; outline: 0; border-radius: 0; vertical-align: baseline;
}
#p2wc :where(ul) { list-style: none; }
#p2wc :where(li)::before, #p2wc :where(li)::after, #p2wc :where(a)::before, #p2wc :where(a)::after,
#p2wc :where(button)::before { content: none; display: none; }
#p2wc :where(button) { cursor: pointer; -webkit-appearance: none; appearance: none; }
#p2wc svg { display: block; flex-shrink: 0; overflow: visible; }
#p2wc { position: static; font-family: var(--p2wc-font); font-size: 16px; font-weight: 400; font-style: normal; line-height: 1.5; color: var(--p2wc-testo); -webkit-font-smoothing: antialiased; text-align: left; }
/*
 * Pulsanti: alcuni temi forzano il font di tutti i button con !important (es. The7:
 * "button { font: 400 16px/22px Montserrat !important }"). Qui il font e' fissato con !important
 * e selettori piu' specifici, cosi' il tema non lo altera (valori di soimm.com).
 */
#p2wc button {
  font-family: var(--p2wc-font) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 1.5 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* ═══ Banner ═══ */
#p2wc .p2wc-banner {
  position: fixed;
  z-index: var(--p2wc-z);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--p2wc-sfondo);
  color: var(--p2wc-testo);
  font-family: var(--p2wc-font);
  border-top: 1px solid var(--p2wc-bordo);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(24, 18, 10, 0.18);
  outline: none;
  animation: p2wc-in 0.35s cubic-bezier(0.32, 0.72, 0.37, 1);
}
@media (min-width: 640px) {
  #p2wc .p2wc-banner {
    left: 24px;
    right: auto;
    bottom: 24px;
    width: min(580px, calc(100vw - 48px));
    border: 1px solid var(--p2wc-bordo);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(24, 18, 10, 0.26);
  }
}
#p2wc .p2wc-banner-inner {
  position: relative;
  max-height: min(80vh, 640px);
  overflow-y: auto;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  #p2wc .p2wc-banner-inner { padding: 26px 28px 24px; }
}

#p2wc .p2wc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 44px 10px 0;
  color: var(--p2wc-accento);
}
#p2wc .p2wc-title {
  display: block;
  font-family: var(--p2wc-font-titoli);
  font-size: 23px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.15;
  color: var(--p2wc-titoli);
  margin: 0;
}
#p2wc .p2wc-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--p2wc-testo);
  margin: 0 0 8px;
}
#p2wc .p2wc-links {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--p2wc-tenue);
  margin: 6px 0 0;
}
#p2wc .p2wc-links a {
  color: var(--p2wc-primario);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#p2wc .p2wc-links a:hover { color: var(--p2wc-primario-scuro); }

#p2wc .p2wc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
#p2wc .p2wc-btn-wide { grid-column: 1 / -1; }

/* Pulsanti: anche nei segnaposto (documento a parte) e nel riquadro della cookie policy. */
#p2wc .p2wc-btn, .p2wc-ph .p2wc-btn, .p2wc-choices.p2wc-choices .p2wc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  height: auto;
  width: auto;
  margin: 0;
  padding: 10px 16px;
  border: 1.5px solid var(--p2wc-primario);
  border-radius: 10px;
  box-shadow: none;
  font-family: var(--p2wc-font) !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  font-style: normal !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
#p2wc .p2wc-btn-solid, .p2wc-ph .p2wc-btn-solid, .p2wc-choices.p2wc-choices .p2wc-btn-solid { background: var(--p2wc-primario); color: #fff; }
#p2wc .p2wc-btn-solid:hover, .p2wc-ph .p2wc-btn-solid:hover, .p2wc-choices.p2wc-choices .p2wc-btn-solid:hover { background: var(--p2wc-primario-scuro); border-color: var(--p2wc-primario-scuro); color: #fff; }
#p2wc .p2wc-btn-outline, .p2wc-ph .p2wc-btn-outline { background: var(--p2wc-sfondo); color: var(--p2wc-primario); }
#p2wc .p2wc-btn-outline:hover, .p2wc-ph .p2wc-btn-outline:hover { background: var(--p2wc-crema); color: var(--p2wc-primario); }

#p2wc .p2wc-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--p2wc-tenue);
  cursor: pointer;
}
#p2wc .p2wc-close:hover { background: var(--p2wc-crema); color: var(--p2wc-titoli); }

#p2wc .p2wc-btn:focus-visible,
#p2wc .p2wc-close:focus-visible,
#p2wc .p2wc-switch:focus-visible,
#p2wc .p2wc-links a:focus-visible,
#p2wc .p2wc-services summary:focus-visible,
.p2wc-ph .p2wc-btn:focus-visible,
.p2wc-ph .p2wc-embed-note button:focus-visible,
.p2wc-choices .p2wc-btn:focus-visible {
  outline: 3px solid var(--p2wc-accento);
  outline-offset: 2px;
}

@keyframes p2wc-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #p2wc .p2wc-banner, #p2wc .p2wc-modal { animation: none; }
}

/* ── Pannello preferenze ── */
#p2wc .p2wc-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--p2wc-z) + 10);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(24, 18, 10, 0.5);
}
@media (min-width: 640px) {
  #p2wc .p2wc-overlay { align-items: center; padding: 24px; }
}
#p2wc .p2wc-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  background: var(--p2wc-sfondo);
  color: var(--p2wc-testo);
  font-family: var(--p2wc-font);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 24px 64px rgba(24, 18, 10, 0.3);
  outline: none;
  animation: p2wc-in 0.3s cubic-bezier(0.32, 0.72, 0.37, 1);
}
@media (min-width: 640px) {
  #p2wc .p2wc-modal { max-height: min(88vh, 820px); border-radius: 18px; }
}
#p2wc .p2wc-modal-head {
  position: relative;
  padding: 22px 64px 14px 22px;
  border-bottom: 1px solid var(--p2wc-bordo);
}
#p2wc .p2wc-modal-head .p2wc-text { margin: 8px 0 0; }
#p2wc .p2wc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
}
#p2wc .p2wc-modal-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--p2wc-bordo);
}
@media (min-width: 640px) {
  #p2wc .p2wc-modal-foot { grid-template-columns: 1fr 1fr 1fr; padding-bottom: 18px; }
  #p2wc .p2wc-modal-foot .p2wc-btn-wide { grid-column: auto; }
}

#p2wc .p2wc-cat {
  border: 1px solid var(--p2wc-bordo);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
#p2wc .p2wc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#p2wc .p2wc-cat-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--p2wc-titoli);
}
#p2wc .p2wc-cat-desc {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
}
#p2wc .p2wc-always {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #2d6a2d;
  background: #eaf4ea;
  padding: 5px 10px;
  border-radius: 999px;
}

#p2wc .p2wc-switch {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #b9aea3;
  cursor: pointer;
  transition: background-color 0.2s;
}
#p2wc .p2wc-switch::after {
  content: '';
  display: block;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
#p2wc .p2wc-switch[aria-checked='true'] { background: var(--p2wc-primario); }
#p2wc .p2wc-switch[aria-checked='true']::after { transform: translateX(22px); }
@media (prefers-reduced-motion: reduce) {
  #p2wc .p2wc-switch, #p2wc .p2wc-switch::after { transition: none; }
}

#p2wc .p2wc-services { display: block; margin-top: 10px; font-size: 13.5px; line-height: 1.55; }
#p2wc .p2wc-services summary {
  display: list-item;
  list-style: disclosure-closed inside;
  cursor: pointer;
  width: fit-content;
  color: var(--p2wc-primario);
  font-weight: 600;
  border-radius: 4px;
}
#p2wc .p2wc-services[open] summary { list-style-type: disclosure-open; }
#p2wc .p2wc-services ul { margin: 8px 0 0; padding: 0; list-style: none; }
#p2wc .p2wc-services li { padding: 10px 0 0; margin-top: 10px; border-top: 1px dashed var(--p2wc-bordo); }
#p2wc .p2wc-services strong { font-weight: 700; }

/* ═══ Contenuto esterno bloccato (segnaposto dentro l'iframe, come GoogleMapConsent di soimm.com) ═══ */
html:has(> body.p2wc-ph) { height: 100%; }
body.p2wc-ph { margin: 0; height: 100%; font-family: var(--p2wc-font); color: var(--p2wc-testo); -webkit-font-smoothing: antialiased; }
.p2wc-ph *, .p2wc-ph *::before, .p2wc-ph *::after { box-sizing: border-box; }
.p2wc-embed {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 100%;
  padding: 16px;
  overflow: auto;
  font-family: var(--p2wc-font);
  background-color: #ebe7e0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
/* Mappa senza anteprima: trama "stradale" disegnata in CSS, nessuna richiesta a terzi. */
.p2wc-embed--maps:not(.p2wc-embed--img) {
  background-color: #ebe7e0;
  background-image:
    linear-gradient(28deg, transparent 47.6%, rgba(255, 255, 255, 0.9) 48%, rgba(255, 255, 255, 0.9) 52%, transparent 52.4%),
    linear-gradient(118deg, transparent 48.6%, rgba(255, 255, 255, 0.75) 49%, rgba(255, 255, 255, 0.75) 51%, transparent 51.4%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 2px, transparent 2px),
    radial-gradient(circle at 78% 22%, #d5e8d4 0 9%, transparent 9.5%),
    radial-gradient(circle at 15% 85%, #cfe0ea 0 13%, transparent 13.5%);
  background-size: 100% 100%, 100% 100%, 46px 46px, 46px 46px, 100% 100%, 100% 100%;
}
.p2wc-embed--youtube, .p2wc-embed--vimeo { background-color: #1f1a16; }
.p2wc-embed--youtube.p2wc-embed--img::before, .p2wc-embed--vimeo.p2wc-embed--img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 10, 0.45);
}
.p2wc-embed-pin, .p2wc-embed-play {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  line-height: 1;
}
.p2wc-embed-pin {
  transform: translate(-50%, -100%);
  font-size: 44px;
  color: var(--p2wc-primario);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}
.p2wc-embed-play { transform: translate(-50%, -50%); font-size: 64px; color: rgba(255, 255, 255, 0.85); }
.p2wc-embed-pin svg, .p2wc-embed-play svg { display: block; }
.p2wc-embed-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--p2wc-raggio);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
@media (min-width: 640px) {
  .p2wc-embed-box { padding: 24px; }
}
/* Riquadro ampio: come soimm.com, segnaposto in basso a destra e icona al centro. */
@media (min-width: 900px) and (min-height: 380px) {
  .p2wc-embed { display: block; padding: 0; }
  .p2wc-embed-pin, .p2wc-embed-play { display: block; }
  .p2wc-embed-box { position: absolute; right: 32px; bottom: 44px; width: 440px; }
}
.p2wc-embed-title {
  font-family: var(--p2wc-font-titoli);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--p2wc-titoli);
  margin: 0 0 6px;
}
.p2wc-embed-text { font-size: 14px; line-height: 1.6; color: var(--p2wc-testo); margin: 0; }
.p2wc-embed-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}
@media (min-width: 420px) {
  .p2wc-embed-actions { grid-template-columns: 1fr 1fr; }
  .p2wc-embed-actions .p2wc-btn:only-child { grid-column: 1 / -1; justify-self: start; min-width: 50%; }
}
.p2wc-embed-note { font-size: 12.5px; line-height: 1.5; color: var(--p2wc-tenue); margin: 12px 0 0; }
.p2wc-embed-note button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--p2wc-primario);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.p2wc-embed-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  color: var(--p2wc-tenue);
}
/* Iframe piccoli: solo titolo e pulsante. */
@media (max-height: 300px) {
  .p2wc-embed { padding: 8px; }
  .p2wc-embed-box { padding: 12px 14px; }
  .p2wc-embed-text, .p2wc-embed-note { display: none; }
  .p2wc-embed-actions { margin-top: 8px; }
  .p2wc-embed-actions .p2wc-btn { min-height: 38px; padding: 6px 12px; }
}
@media (max-height: 170px) {
  .p2wc-embed-title { font-size: 16px; margin-bottom: 0; }
  .p2wc-embed-actions .p2wc-btn-outline { display: none; }
}

/* ═══ Riquadro "Le tue scelte" della cookie policy (CookieChoicesBox di soimm.com) ═══ */
.p2wc-choices.p2wc-choices {
  margin: 0 0 28px;
  padding: 22px 26px;
  border: 1px solid var(--p2wc-bordo);
  border-radius: var(--p2wc-raggio);
  background: var(--p2wc-sfondo);
  box-shadow: 0 2px 16px rgba(24, 18, 10, 0.07);
  color: var(--p2wc-testo);
  font-family: var(--p2wc-font);
  font-weight: 400;
  font-style: normal;
  text-align: left;
}
.p2wc-choices .p2wc-choices-title { font-family: var(--p2wc-font-titoli); font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--p2wc-titoli); margin: 0 0 10px; padding: 0; }
.p2wc-choices .p2wc-choices-text { font-size: 15px; line-height: 1.6; margin: 0 0 16px; padding: 0; }
.p2wc-choices .p2wc-choices-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.p2wc-choices .p2wc-choices-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; font-size: 14.5px; line-height: 1.5; border-bottom: 1px dashed var(--p2wc-bordo); list-style: none; }
.p2wc-choices .p2wc-choices-list li::before, .p2wc-choices .p2wc-choices-list li::after { content: none; display: none; }
.p2wc-choices .p2wc-choices-meta { font-size: 12.5px; line-height: 1.5; color: var(--p2wc-tenue); margin: 0 0 16px; padding: 0; word-break: break-word; }
.p2wc-choices .p2wc-choices-meta code { font-size: 12px; background: none; padding: 0; color: inherit; }
@media (max-width: 640px) {
  .p2wc-choices.p2wc-choices { padding: 18px 18px; }
  .p2wc-choices .p2wc-choices-list { grid-template-columns: 1fr; }
}
.p2wc-pill {
  display: inline-block;
  flex-shrink: 0;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1ece6;
  color: var(--p2wc-tenue);
  font-family: var(--p2wc-font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: middle;
}
.p2wc-pill-on { background: #eaf4ea; color: #2d6a2d; }
.p2wc-choices-list .p2wc-pill { margin-left: 0; }

/* ═══ Link aggiunti in fondo alla pagina quando il footer non ha "Preferenze cookie" ═══ */
.p2wc-footer-links {
  clear: both;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.p2wc-footer-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; opacity: 0.9; }
.p2wc-footer-links a:hover { opacity: 1; }
.p2wc-footer-links .p2wc-sep { opacity: 0.6; margin: 0 6px; }
