/*
 * Virtual 360 Zone: banner e preferencias de cookies (site inteiro).
 * Carregado por inc/layout/vrl-consent.php. Prefixo: vrl-cc
 * Independente das variaveis do tema: funciona no site brasileiro e em /it/.
 * Os tres botoes de escolha tem o mesmo peso visual (aceitar, recusar, personalizar).
 * v2: banner abaixo do cursor V360 Node nas paginas italianas; switches sem cursor nativo.
 */

.vrl-cc,
.vrl-cc-fab {
  --cc-bg: rgba(8, 12, 30, 0.94);
  --cc-line: rgba(90, 155, 246, 0.24);
  --cc-soft: rgba(255, 255, 255, 0.08);
  --cc-text: #eef0f8;
  --cc-text-2: #a9b0c8;
  --cc-blue: #3a7bd5;
  --cc-blue-light: #5a9bf6;
  --cc-orange: #ff7a3d;
  --cc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.vrl-cc[hidden],
.vrl-cc-fab[hidden],
.vrl-cc [hidden] { display: none !important; }

.vrl-cc {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 2147482600; /* abaixo do cursor V360 Node (2147483000) */
  width: min(960px, calc(100% - 40px));
  transform: translate3d(-50%, 24px, 0);
  opacity: 0;
  transition: opacity 0.35s var(--cc-ease), transform 0.35s var(--cc-ease);
  font-family: inherit;
  color: var(--cc-text);
  line-height: 1.5;
  text-align: left;
}

.vrl-cc.is-open {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.vrl-cc *,
.vrl-cc *::before,
.vrl-cc *::after { box-sizing: border-box; }

.vrl-cc :where(p) { margin: 0; }

.vrl-cc__box {
  position: relative;
  padding: 24px 28px;
  border: 1px solid var(--cc-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(58, 123, 213, 0.16), transparent 55%),
    var(--cc-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

/* Fechar (equivale a recusar na primeira visita) */

.vrl-cc__x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.vrl-cc__x span {
  position: absolute;
  top: 17px;
  left: 10px;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--cc-text-2);
  transition: background-color 0.2s ease;
}

.vrl-cc__x span:first-child { transform: rotate(45deg); }
.vrl-cc__x span:last-child { transform: rotate(-45deg); }
.vrl-cc__x:hover span { background: #ffffff; }

/* Vista principal */

.vrl-cc__view--main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
}

.vrl-cc__intro {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.vrl-cc__mark {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border: 1px solid rgba(90, 155, 246, 0.4);
  border-radius: 50%;
}

.vrl-cc__mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(238, 240, 248, 0.35);
  border-radius: 50%;
  animation: vrl-cc-spin 14s linear infinite;
}

.vrl-cc__mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--cc-orange);
  box-shadow: 0 0 10px rgba(255, 122, 61, 0.7);
}

@keyframes vrl-cc-spin {
  to { transform: rotate(360deg); }
}

.vrl-cc__title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.vrl-cc__title:focus { outline: none; }

.vrl-cc__text {
  margin-top: 6px;
  max-width: 64ch;
  color: var(--cc-text-2);
  font-size: 14px;
  line-height: 1.6;
}

.vrl-cc__text--small { margin-top: 4px; font-size: 13px; }

.vrl-cc__link {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--cc-orange);
  transition: color 0.2s ease;
}

.vrl-cc__link:hover,
.vrl-cc__link:focus-visible { color: var(--cc-orange); }

/* Botoes: mesmo destaque para as tres escolhas */

.vrl-cc__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.vrl-cc__view--main .vrl-cc__actions { min-width: 440px; }

.vrl-cc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--cc-ease);
}

.vrl-cc__btn:hover {
  border-color: var(--cc-blue-light);
  background: rgba(58, 123, 213, 0.22);
  transform: translateY(-1px);
}

.vrl-cc__btn:focus-visible,
.vrl-cc__x:focus-visible,
.vrl-cc__back:focus-visible,
.vrl-cc__link:focus-visible,
.vrl-cc-fab:focus-visible {
  outline: 2px solid var(--cc-orange);
  outline-offset: 3px;
}

/* Vista de preferencias */

.vrl-cc__view--prefs { padding-right: 28px; }

.vrl-cc__rows {
  display: grid;
  gap: 10px;
  margin: 18px 0 20px;
}

.vrl-cc__row {
  padding: 14px 16px;
  border: 1px solid var(--cc-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.vrl-cc__row-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vrl-cc__row-title {
  flex: 1;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.vrl-cc__always {
  color: var(--cc-text-2);
  font-size: 12px;
}

.vrl-cc__row-desc {
  margin-top: 4px;
  color: var(--cc-text-2);
  font-size: 13px;
  line-height: 1.55;
}

.vrl-cc__switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
}

.vrl-cc__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.vrl-cc__input:disabled { cursor: not-allowed; }

.vrl-cc__track {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.vrl-cc__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cc-text-2);
  transition: transform 0.25s var(--cc-ease), background-color 0.25s ease;
}

.vrl-cc__input:checked + .vrl-cc__track {
  border-color: var(--cc-blue-light);
  background: var(--cc-blue);
}

.vrl-cc__input:checked + .vrl-cc__track::after {
  background: #ffffff;
  transform: translateX(20px);
}

.vrl-cc__switch.is-locked .vrl-cc__track { opacity: 0.6; }

.vrl-cc__input:focus-visible + .vrl-cc__track {
  outline: 2px solid var(--cc-orange);
  outline-offset: 3px;
}

.vrl-cc__back {
  margin-top: 14px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--cc-text-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.vrl-cc__back:hover { color: #ffffff; }

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

/* Botao discreto para rever a escolha */

.vrl-cc-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 2147482000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(90, 155, 246, 0.28);
  border-radius: 50%;
  background: rgba(8, 12, 30, 0.82);
  color: var(--cc-text-2);
  cursor: pointer;
  opacity: 0.72;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--cc-ease);
}

.vrl-cc-fab svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.vrl-cc-fab svg circle {
  fill: currentColor;
  stroke: none;
}

.vrl-cc-fab:hover {
  opacity: 1;
  color: #ffffff;
  border-color: var(--cc-orange);
  transform: translateY(-2px);
}

/* Nas paginas italianas o cursor V360 Node substitui o cursor nativo */

html.vrl-it-cursor-on .vrl-cc__btn,
html.vrl-it-cursor-on .vrl-cc__x,
html.vrl-it-cursor-on .vrl-cc__back,
html.vrl-it-cursor-on .vrl-cc__row-title,
html.vrl-it-cursor-on .vrl-cc-fab,
html.vrl-it-cursor-on body.vrl-it .vrl-cc .vrl-cc__input { cursor: none; }

/* Tablet e celular */

@media (max-width: 1024px) {
  .vrl-cc__view--main {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .vrl-cc__view--main .vrl-cc__actions { min-width: 0; }
}

@media (max-width: 560px) {
  .vrl-cc {
    bottom: 0;
    width: 100%;
  }

  .vrl-cc__box {
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    max-height: 88vh;
    max-height: 88dvh;
  }

  .vrl-cc__view--main,
  .vrl-cc__view--prefs { padding-right: 0; }

  .vrl-cc__intro { padding-right: 32px; }

  .vrl-cc__mark { width: 28px; height: 28px; }

  .vrl-cc__actions { grid-template-columns: 1fr; }

  .vrl-cc__btn { min-height: 48px; white-space: normal; }

  .vrl-cc-fab {
    left: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vrl-cc,
  .vrl-cc__btn,
  .vrl-cc__track::after,
  .vrl-cc-fab { transition: none; }

  .vrl-cc__mark::before { animation: none; }
}

@media print {
  .vrl-cc,
  .vrl-cc-fab { display: none !important; }
}
