/* ===============================
   AVISO DE COOKIES
   =============================== */

.cookie-consent {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--color-border-login);
  border-radius: 16px;
  background-color: var(--color-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cookie-consent.is-visible {
  opacity: 1;
  transform: none;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-title);
}

.cookie-consent__title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

.cookie-consent__text {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--color-text);
}

.cookie-consent__text a {
  color: var(--color-title);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- opções ---------- */

.cookie-consent__options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.cookie-consent__options[hidden] {
  display: none;
}

.cookie-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border-login);
  cursor: pointer;
}

.cookie-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-option__text strong {
  font-size: 1.4rem;
  color: var(--color-title);
}

.cookie-option__text span {
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-text);
}

.cookie-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cookie-option__switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
  border-radius: 20px;
  background-color: var(--color-border-login);
  transition: background-color 0.3s ease;
}

.cookie-option__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
}

.cookie-option input:checked + .cookie-option__switch {
  background-color: var(--color-accent);
}

.cookie-option input:checked + .cookie-option__switch::after {
  transform: translateX(18px);
}

.cookie-option input:disabled + .cookie-option__switch {
  opacity: 0.6;
}

.cookie-option input:focus-visible + .cookie-option__switch {
  outline: 2px solid var(--color-title);
  outline-offset: 2px;
}

/* ---------- botões ---------- */

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.cookie-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 9px 18px;
  border: 1px solid var(--color-ui-dark);
  border-radius: 100px;
  font-family: var(--font-text);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}

/* Mesma animação dos botões do header */
.cookie-btn--solid::before,
.cookie-btn--outline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.cookie-btn--solid::before {
  background-color: var(--color-bg);
}

.cookie-btn--outline::before {
  background-color: var(--color-ui-dark);
}

.cookie-btn--solid:hover::before,
.cookie-btn--outline:hover::before {
  transform: translateX(0);
}

.cookie-btn--solid:hover {
  color: var(--color-title);
}

.cookie-btn--outline:hover {
  color: var(--color-bg);
}

.cookie-btn[hidden] {
  display: none;
}

.cookie-btn--solid {
  color: var(--color-bg);
  background-color: var(--color-ui-dark);
}

.cookie-btn--outline {
  color: var(--color-title);
  background-color: transparent;
}

.cookie-btn--link {
  padding: 9px 6px;
  border-color: transparent;
  color: var(--color-title);
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* link do rodapé */
.cookie-settings-link {
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  background: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- celular ---------- */

@media (max-width: 768px) {
  .cookie-consent {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: calc(100dvh - 24px);
    padding: 18px;
  }

  .cookie-consent__actions .cookie-btn--solid,
  .cookie-consent__actions .cookie-btn--outline {
    flex: 1 1 auto;
    text-align: center;
  }
}
