/* Ostune - Cookie consent banner (custom, no third-party CMP) */

#ostune-cookie-banner,
#ostune-cookie-modal,
#ostune-cookie-float {
  box-sizing: border-box;
  font-family: 'Red Hat Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

#ostune-cookie-banner *,
#ostune-cookie-modal *,
#ostune-cookie-float * {
  box-sizing: border-box;
}

#ostune-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: #1e2121;
  color: #ffffff;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

#ostune-cookie-banner.ostune-hidden,
#ostune-cookie-modal.ostune-hidden,
#ostune-cookie-float.ostune-hidden {
  display: none !important;
}

#ostune-cookie-banner .ostune-cc-text {
  flex: 1 1 420px;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  color: #f2f6f9;
}

#ostune-cookie-banner .ostune-cc-text a {
  color: #d9b36c;
  text-decoration: underline;
}

#ostune-cookie-banner .ostune-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.ostune-cc-btn {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.ostune-cc-btn:hover {
  opacity: 0.85;
}

.ostune-cc-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.ostune-cc-btn-outline {
  background: transparent;
  border-color: #b88a38;
  color: #d9b36c;
}

.ostune-cc-btn-solid {
  background: #b88a38;
  color: #ffffff;
}

/* Modal */
#ostune-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 33, 33, 0.55);
}

#ostune-cookie-modal .ostune-cc-panel {
  background: #ffffff;
  color: #1e2121;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#ostune-cookie-modal h2 {
  font-size: 20px;
  margin: 0 0 8px;
  color: #1e2121;
}

#ostune-cookie-modal p {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  margin: 0 0 20px;
}

#ostune-cookie-modal a {
  color: #b88a38;
}

.ostune-cc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #eee;
}

.ostune-cc-row:first-of-type {
  border-top: 1px solid #eee;
}

.ostune-cc-row-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #1e2121;
}

.ostune-cc-row-text span {
  display: block;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.ostune-cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}

.ostune-cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ostune-cc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.2s;
}

.ostune-cc-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.ostune-cc-switch input:checked + .ostune-cc-slider {
  background: #b88a38;
}

.ostune-cc-switch input:checked + .ostune-cc-slider::before {
  transform: translateX(20px);
}

.ostune-cc-switch input:disabled + .ostune-cc-slider {
  background: #1e2121;
  opacity: 0.4;
  cursor: not-allowed;
}

#ostune-cookie-modal .ostune-cc-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Pulsante "Gestisci cookie", visibile dopo la scelta. In colonna con il "torna su" del tema (.back-to-top:
   destra 30px, 48px, #212121): in basso quando il "torna su" è nascosto, sopra di lui quando compare
   (classe ostune-cc-sopra, messa da cookie-consent.js seguendo la classe "display" del "torna su"). */
#ostune-cookie-float {
  position: fixed !important;
  right: 30px;
  bottom: 30px;
  left: auto !important;
  z-index: 999;
  width: 48px !important;
  height: 48px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 15px !important;
  border: none !important;
  border-radius: 30px !important;
  background: #212121 !important;
  color: #ffffff !important;
  line-height: 1 !important;
  font-size: 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none !important;
  -webkit-transition: bottom 0.4s, background-color 0.2s;
  transition: bottom 0.4s, background-color 0.2s;
}

#ostune-cookie-float:hover,
#ostune-cookie-float:focus-visible {
  background: #757575 !important;
}

#ostune-cookie-float .ostune-cc-icona {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  line-height: 0;
}

#ostune-cookie-float.ostune-cc-sopra {
  bottom: 90px;
}

#ostune-cookie-float svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  visibility: visible !important;
  opacity: 1 !important;
  fill: none !important;
  stroke: #ffffff !important;
  pointer-events: none;
}

#ostune-cookie-float svg circle {
  fill: #ffffff !important;
  stroke: none !important;
}

@media (max-width: 600px) {
  /* Banner compatto: meno altezza, il contenuto della pagina resta visibile */
  #ostune-cookie-banner {
    padding: 12px 14px;
    gap: 10px;
  }

  #ostune-cookie-banner .ostune-cc-text {
    flex-basis: 100%;
    font-size: 12px;
    line-height: 1.45;
  }

  #ostune-cookie-banner .ostune-cc-actions {
    width: 100%;
    gap: 8px;
  }

  .ostune-cc-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 9px 8px;
    font-size: 12px;
    white-space: normal;
  }
}
