.picc-root,
.picc-root * {
  box-sizing: border-box;
}

.picc-root {
  position: relative;
  z-index: 2147482000;
  font-family: inherit;
  color: var(--picc-text);
}

.picc-root [hidden] {
  display: none !important;
}

.picc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
  z-index: 2147482000;
}

.picc-banner,
.picc-preferences {
  background: var(--picc-bg);
  color: var(--picc-text);
  border: 1px solid var(--picc-border);
  border-radius: var(--picc-radius);
  box-shadow: 0 18px 55px rgba(15, 23, 42, .22);
  z-index: 2147482001;
}

.picc-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  width: auto;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
}

.picc-position-center .picc-banner {
  left: 50%;
  right: auto;
  bottom: auto;
  top: 50%;
  width: min(680px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  grid-template-columns: 1fr;
}

.picc-position-center .picc-backdrop {
  display: block;
}

.picc-copy h2,
.picc-preferences h2 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
  color: var(--picc-text);
}

.picc-copy p,
.picc-preferences p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--picc-text);
}

.picc-policy-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--picc-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.picc-actions,
.picc-preferences-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.picc-btn {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.picc-btn:hover {
  transform: translateY(-1px);
}

.picc-btn:focus-visible,
.picc-close:focus-visible,
.picc-floating-button:focus-visible,
.picc-switch input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--picc-primary) 30%, transparent);
  outline-offset: 2px;
}

.picc-btn-primary {
  background: var(--picc-primary);
  color: #fff;
  border-color: var(--picc-primary);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--picc-primary) 24%, transparent);
}

.picc-btn-outline {
  background: var(--picc-bg);
  color: var(--picc-primary);
  border-color: var(--picc-primary);
}

.picc-btn-plain {
  background: transparent;
  color: var(--picc-text);
  border-color: var(--picc-border);
}

.picc-close {
  position: absolute;
  top: 9px;
  right: 11px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--picc-text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.picc-preferences {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(720px, calc(100% - 30px));
  max-height: min(820px, calc(100vh - 30px));
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 24px;
}

.picc-preferences-head {
  position: relative;
  padding-right: 40px;
  margin-bottom: 18px;
}

.picc-preferences-head .picc-close {
  top: -8px;
  right: -6px;
}

.picc-category-list {
  border-top: 1px solid var(--picc-border);
}

.picc-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--picc-border);
}

.picc-category-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  color: var(--picc-text);
}

.picc-category-copy p {
  font-size: 13px;
  opacity: .82;
}

.picc-preferences-actions {
  padding-top: 20px;
}

.picc-switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 27px;
  flex: 0 0 auto;
}

.picc-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.picc-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background .2s ease;
}

.picc-switch span::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .22);
  transition: transform .2s ease;
}

.picc-switch input:checked + span {
  background: var(--picc-primary);
}

.picc-switch input:checked + span::before {
  transform: translateX(21px);
}

.picc-switch-locked span {
  cursor: not-allowed;
  opacity: .75;
}

.picc-floating-button {
  position: fixed;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--picc-border);
  border-radius: 999px;
  background: var(--picc-bg);
  color: var(--picc-text);
  box-shadow: 0 7px 24px rgba(15, 23, 42, .16);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 2147481999;
}

.picc-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

iframe[data-picc-src] {
  min-height: 150px;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
}

@media (max-width: 840px) {
  .picc-banner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .picc-actions {
    justify-content: stretch;
  }

  .picc-actions .picc-btn {
    flex: 1 1 180px;
  }
}

@media (max-width: 560px) {
  .picc-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 18px 16px 16px;
    border-radius: min(var(--picc-radius), 14px);
  }

  .picc-position-bottom .picc-banner {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    padding: 16px 16px 14px;
    border-radius: 0 !important;
  }

  .picc-copy h2,
  .picc-preferences h2 {
    font-size: 18px;
  }

  .picc-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .picc-actions .picc-btn,
  .picc-preferences-actions .picc-btn {
    width: 100%;
  }

  .picc-preferences {
    width: calc(100% - 18px);
    max-height: calc(100vh - 18px);
    padding: 20px 16px;
  }

  .picc-category {
    gap: 12px;
  }

  .picc-preferences-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .picc-floating-button span:last-child {
    display: none;
  }

  .picc-floating-button {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
  }
}

/* La barra in basso non oscura la navigazione; la finestra centrale usa invece lo sfondo. */
.picc-position-bottom .picc-backdrop {
  display: none !important;
}

/* Banner piena larghezza in basso */
.picc-position-bottom .picc-banner {
  position: fixed;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto;
  transform: none;
  width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0 !important;
  padding: 22px 56px 22px 24px;
  box-shadow: 0 -10px 34px rgba(15, 23, 42, .16);
}

.picc-position-bottom .picc-copy {
  max-width: 780px;
}

.picc-position-bottom .picc-close {
  top: 14px;
  right: 16px;
}

.picc-service-details {
  margin-top: 8px;
  font-size: 12px;
}

.picc-service-details summary {
  color: var(--picc-primary);
  font-weight: 700;
  cursor: pointer;
}

.picc-service-details ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.picc-service-details li {
  margin: 4px 0;
  line-height: 1.45;
}

.picc-service-details a {
  color: var(--picc-primary);
  text-decoration: underline;
}
