/* BS Cookie Banner */
.bscb[hidden],
.bscb [hidden],
.bscb-reopen[hidden] {
  display: none !important;
}

.bscb {
  position: fixed;
  z-index: 2147483000;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  font-size: 14px;
  line-height: 1.5;
}

.bscb *,
.bscb *::before,
.bscb *::after {
  box-sizing: border-box;
}

.bscb__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  pointer-events: auto;
  opacity: 0;
  transition: opacity .25s ease;
}

.bscb__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-height: 90vh;
  padding: 20px 24px;
  background: var(--bscb-bg, #fff);
  color: var(--bscb-text, #333);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .15);
  pointer-events: auto;
  outline: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}

.bscb--visible .bscb__dialog,
.bscb--visible .bscb__overlay {
  opacity: 1;
  transform: none;
}

/* ---- Layout: barre ---- */
.bscb--bar_top {
  top: 0;
  bottom: auto;
}

.bscb--bar_top .bscb__dialog {
  box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
  transform: translateY(-16px);
}

@media (min-width: 992px) {
  .bscb--bar_bottom .bscb__dialog,
  .bscb--bar_top .bscb__dialog {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 32px;
    padding: 20px max(24px, calc((100vw - 1320px) / 2));
  }

  .bscb--bar_bottom .bscb__content,
  .bscb--bar_top .bscb__content {
    flex: 1 1 480px;
  }

  .bscb--bar_bottom.bscb--prefs-open .bscb__content,
  .bscb--bar_top.bscb--prefs-open .bscb__content {
    flex-basis: 100%;
  }

  .bscb--bar_bottom.bscb--prefs-open .bscb__actions,
  .bscb--bar_top.bscb--prefs-open .bscb__actions {
    margin-left: auto;
  }

  .bscb--bar_bottom .bscb__actions,
  .bscb--bar_top .bscb__actions {
    flex: 0 0 auto;
  }
}

/* ---- Layout: riquadri e modale ---- */
@media (min-width: 576px) {
  .bscb--box_left,
  .bscb--box_right {
    left: auto;
    right: auto;
    bottom: 20px;
  }

  .bscb--box_left {
    left: 20px;
  }

  .bscb--box_right {
    right: 20px;
  }

  .bscb--box_left .bscb__dialog,
  .bscb--box_right .bscb__dialog {
    width: 420px;
    max-height: calc(100vh - 40px);
    border-radius: calc(var(--bscb-radius, 6px) * 2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
  }

  .bscb--modal {
    top: 0;
    align-items: center;
    padding: 20px;
  }

  .bscb--modal .bscb__dialog {
    max-width: 640px;
    border-radius: calc(var(--bscb-radius, 6px) * 2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .3);
    transform: scale(.96);
  }
}

@media (max-width: 575.98px) {
  .bscb--modal .bscb__dialog,
  .bscb--box_left .bscb__dialog,
  .bscb--box_right .bscb__dialog {
    border-radius: calc(var(--bscb-radius, 6px) * 2) calc(var(--bscb-radius, 6px) * 2) 0 0;
  }
}

/* ---- Contenuti ---- */
.bscb__content {
  overflow-y: auto;
  min-height: 0;
  padding-right: 24px;
}

.bscb__title {
  margin: 0 0 6px;
  font-size: 1.15em;
  font-weight: 700;
  color: inherit;
}

.bscb__message,
.bscb__message p {
  margin: 0;
  color: inherit;
}

.bscb__message p + p,
.bscb__message .bscb__policy {
  margin-top: 6px;
}

.bscb__sep {
  margin: 0 6px;
  opacity: .6;
}

.bscb a {
  color: var(--bscb-link, inherit);
  text-decoration: underline;
}

.bscb a:hover,
.bscb a:focus {
  color: var(--bscb-link, inherit);
  text-decoration: none;
}

.bscb__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .7;
  cursor: pointer;
}

.bscb__close:hover,
.bscb__close:focus-visible {
  opacity: 1;
  background: rgba(127, 127, 127, .15);
}

/* ---- Preferenze ---- */
.bscb__prefs {
  margin-top: 16px;
  border-top: 1px solid rgba(127, 127, 127, .25);
}

.bscb__prefs-title {
  margin: 14px 0 4px;
  font-weight: 700;
  color: inherit;
}

.bscb__cat {
  padding: 12px 0;
  border-bottom: 1px solid rgba(127, 127, 127, .25);
}

.bscb__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bscb__cat-label {
  margin: 0;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.bscb__always {
  font-size: .9em;
  font-weight: 600;
  opacity: .7;
}

.bscb__cat-desc {
  margin: 4px 0 0;
  font-size: .92em;
  opacity: .85;
  color: inherit;
}

.bscb__switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}

.bscb__switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.bscb__slider {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: rgba(127, 127, 127, .45);
  transition: background .2s ease;
}

.bscb__slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}

.bscb__switch input:checked + .bscb__slider {
  background: var(--bscb-primary, #222);
}

.bscb__switch input:checked + .bscb__slider::before {
  transform: translateX(20px);
}

.bscb__switch input:focus-visible + .bscb__slider {
  outline: 2px solid var(--bscb-primary, #222);
  outline-offset: 2px;
}

/* ---- Pulsanti ---- */
.bscb__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bscb__btn {
  flex: 1 1 auto;
  min-height: 44px;
  margin: 0;
  padding: 10px 20px;
  border: 2px solid var(--bscb-primary, #222);
  border-radius: var(--bscb-radius, 6px);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s ease, opacity .15s ease;
}

.bscb__btn:hover {
  filter: brightness(1.12);
}

.bscb__btn:focus-visible,
.bscb-reopen:focus-visible,
.bscb__close:focus-visible {
  outline: 2px solid var(--bscb-link, #222);
  outline-offset: 2px;
}

.bscb__btn--primary {
  background: var(--bscb-primary, #222);
  border-color: var(--bscb-primary, #222);
  color: var(--bscb-primary-text, #fff);
}

.bscb__btn--secondary {
  background: var(--bscb-secondary, #fff);
  border-color: var(--bscb-secondary-text, #222);
  color: var(--bscb-secondary-text, #222);
}

@media (max-width: 575.98px) {
  .bscb__dialog {
    padding: 18px 16px 16px;
  }

  .bscb__actions {
    flex-direction: column;
  }

  .bscb__btn {
    width: 100%;
    white-space: normal;
  }
}

/* ---- Pulsante di riapertura ---- */
.bscb-reopen {
  position: fixed;
  z-index: 2147482999;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bscb-primary, #222);
  color: var(--bscb-primary-text, #fff);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  cursor: pointer;
  opacity: .85;
  transition: opacity .15s ease, transform .15s ease;
}

.bscb-reopen:hover {
  opacity: 1;
  transform: scale(1.06);
}

.bscb-reopen--left {
  left: 16px;
}

.bscb-reopen--right {
  right: 16px;
}

html.bscb-lock,
html.bscb-lock body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .bscb__dialog,
  .bscb__overlay,
  .bscb__slider,
  .bscb__slider::before,
  .bscb-reopen {
    transition: none;
  }
}
