/* =========================================================
   COOKIE CONSENT
   FILIPE ASSIS | DEV
========================================================= */

:root {
  --cookie-red: #e10600;
  --cookie-bg: #0b0b0b;
  --cookie-border: #282828;
}


/* =========================================================
   ROOT
   SEMPRE PRESO À VIEWPORT
========================================================= */

.cookie-consent {
  position: fixed !important;

  inset: 0;

  z-index: 99999;

  width: 100%;
  height: 100%;

  pointer-events: none;

  font-family: "Inter", sans-serif;
}


.cookie-consent[hidden] {
  display: none !important;
}


/* =========================================================
   BANNER
========================================================= */

.cookie-banner {
  position: fixed !important;

  left: 50%;
  bottom: 22px;

  z-index: 100000;

  width: min(1180px, calc(100% - 40px));

  transform: translateX(-50%);

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 36px;

  padding: 22px 24px;

  border: 1px solid var(--cookie-border);
  border-radius: 18px;

  background: rgba(8, 8, 8, 0.97);

  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.015);

  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);

  pointer-events: auto;
}


.cookie-banner[hidden] {
  display: none !important;
}


/* =========================================================
   CONTEÚDO
========================================================= */

.cookie-banner__content {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 20px;
}


.cookie-banner__icon {
  width: 48px;
  height: 48px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #303030;
  border-radius: 14px;

  color: var(--cookie-red);

  background: #111111;
}


.cookie-banner__icon svg {
  width: 25px;
  height: 25px;
}


.cookie-banner__text {
  max-width: 660px;
}


.cookie-banner__eyebrow {
  display: block;

  margin-bottom: 5px;

  color: var(--cookie-red);

  font-size: 0.65rem;
  font-weight: 600;

  line-height: 1;

  letter-spacing: 0.18em;
}


.cookie-banner h2 {
  margin: 0 0 6px;

  color: #ffffff;

  font-size: 1.08rem;
  font-weight: 600;

  line-height: 1.2;

  letter-spacing: -0.02em;
}


.cookie-banner p {
  margin: 0;

  color: #999999;

  font-size: 0.82rem;

  line-height: 1.55;
}


.cookie-banner__privacy {
  display: inline-flex;
  align-items: center;

  gap: 6px;

  margin-top: 8px;

  color: #c7c7c7;

  font-size: 0.74rem;
  font-weight: 500;

  text-decoration: none;

  transition: color 0.2s ease;
}


.cookie-banner__privacy:hover {
  color: #ffffff;
}


.cookie-banner__privacy span {
  color: var(--cookie-red);
}


/* =========================================================
   AÇÕES
========================================================= */

.cookie-banner__actions {
  display: flex;
  align-items: center;

  flex-shrink: 0;

  gap: 8px;
}


/* =========================================================
   BOTÕES
========================================================= */

.cookie-button {
  min-height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 17px;

  border-radius: 999px;

  font-family: "Inter", sans-serif;

  font-size: 0.76rem;
  font-weight: 600;

  line-height: 1;

  cursor: pointer;

  white-space: nowrap;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}


.cookie-button:hover {
  transform: translateY(-1px);
}


.cookie-button--primary {
  border: 1px solid var(--cookie-red);

  background: var(--cookie-red);

  color: #ffffff;
}


.cookie-button--primary:hover {
  border-color: #f11913;

  background: #f11913;
}


.cookie-button--secondary {
  border: 1px solid #363636;

  background: #151515;

  color: #ffffff;
}


.cookie-button--secondary:hover {
  border-color: #555555;

  background: #1b1b1b;
}


.cookie-button--ghost {
  border: 1px solid transparent;

  background: transparent;

  color: #999999;
}


.cookie-button--ghost:hover {
  border-color: #333333;

  color: #ffffff;
}


/* =========================================================
   MODAL
========================================================= */

.cookie-modal {
  position: fixed !important;

  inset: 0;

  z-index: 100001;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  pointer-events: auto;
}


.cookie-modal[hidden] {
  display: none !important;
}


.cookie-modal__overlay {
  position: absolute;

  inset: 0;

  background: rgba(0, 0, 0, 0.72);

  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}


.cookie-modal__dialog {
  position: relative;

  z-index: 1;

  width: min(640px, 100%);

  max-height: min(720px, calc(100vh - 48px));

  overflow-y: auto;

  padding: 30px;

  border: 1px solid #2d2d2d;
  border-radius: 22px;

  background: #0b0b0b;

  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.65);
}


/* =========================================================
   CABEÇALHO MODAL
========================================================= */

.cookie-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 30px;
}


.cookie-modal__eyebrow {
  display: block;

  margin-bottom: 7px;

  color: var(--cookie-red);

  font-size: 0.65rem;
  font-weight: 600;

  letter-spacing: 0.18em;
}


.cookie-modal__header h2 {
  margin: 0;

  color: #ffffff;

  font-size: 1.7rem;
  font-weight: 600;

  line-height: 1.1;

  letter-spacing: -0.04em;
}


.cookie-modal__close {
  width: 38px;
  height: 38px;

  flex-shrink: 0;

  border: 1px solid #303030;
  border-radius: 50%;

  background: #111111;

  color: #aaaaaa;

  font-size: 1.35rem;

  line-height: 1;

  cursor: pointer;

  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}


.cookie-modal__close:hover {
  border-color: #505050;

  background: #171717;

  color: #ffffff;
}


.cookie-modal__description {
  margin: 18px 0 26px;

  color: #969696;

  font-size: 0.87rem;

  line-height: 1.65;
}


/* =========================================================
   PREFERÊNCIAS
========================================================= */

.cookie-preferences {
  border-top: 1px solid #252525;
}


.cookie-preference {
  display: grid;

  grid-template-columns: minmax(0, 1fr) auto;

  align-items: center;

  gap: 26px;

  padding: 22px 0;

  border-bottom: 1px solid #252525;
}


.cookie-preference__heading {
  display: flex;
  align-items: center;

  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 7px;
}


.cookie-preference h3 {
  margin: 0;

  color: #ffffff;

  font-size: 0.93rem;
  font-weight: 600;
}


.cookie-preference p {
  max-width: 475px;

  margin: 0;

  color: #808080;

  font-size: 0.8rem;

  line-height: 1.55;
}


.cookie-preference__required {
  padding: 4px 8px;

  border-radius: 999px;

  background: rgba(225, 6, 0, 0.1);

  color: var(--cookie-red);

  font-size: 0.62rem;
  font-weight: 600;

  text-transform: uppercase;

  letter-spacing: 0.08em;
}


/* =========================================================
   SWITCH
========================================================= */

.cookie-switch {
  position: relative;

  width: 46px;
  height: 26px;

  flex-shrink: 0;

  display: block;

  cursor: pointer;
}


.cookie-switch input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;
}


.cookie-switch > span:not(.sr-only) {
  position: absolute;

  inset: 0;

  border: 1px solid #3a3a3a;
  border-radius: 999px;

  background: #181818;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}


.cookie-switch > span:not(.sr-only)::after {
  content: "";

  position: absolute;

  top: 3px;
  left: 3px;

  width: 18px;
  height: 18px;

  border-radius: 50%;

  background: #777777;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}


.cookie-switch input:checked + span {
  border-color: var(--cookie-red);

  background: rgba(225, 6, 0, 0.18);
}


.cookie-switch input:checked + span::after {
  transform: translateX(20px);

  background: var(--cookie-red);
}


.cookie-switch input:focus-visible + span {
  outline: 2px solid #ffffff;

  outline-offset: 3px;
}


.cookie-switch--locked {
  cursor: default;
}


.cookie-switch--locked > span {
  border-color: var(--cookie-red);

  background: rgba(225, 6, 0, 0.18);
}


.cookie-switch--locked > span::after {
  transform: translateX(20px);

  background: var(--cookie-red);
}


/* =========================================================
   RODAPÉ MODAL
========================================================= */

.cookie-modal__footer {
  display: flex;
  justify-content: flex-end;

  gap: 9px;

  margin-top: 26px;
}


/* =========================================================
   ACESSIBILIDADE
========================================================= */

.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;
}


/* =========================================================
   BLOQUEIA SCROLL QUANDO MODAL ESTIVER ABERTO
========================================================= */

html.cookie-modal-open,
html.cookie-modal-open body {
  overflow: hidden;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 980px) {

  .cookie-banner {
    align-items: flex-end;

    gap: 24px;
  }


  .cookie-banner__content {
    align-items: flex-start;
  }


  .cookie-banner__actions {
    flex-direction: column;

    align-items: stretch;
  }


  .cookie-button {
    min-width: 145px;
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

  .cookie-banner {
    left: 16px;
    right: 16px;

    bottom: calc(
      16px + env(safe-area-inset-bottom)
    );

    width: auto;

    transform: none;

    display: block;

    padding: 20px;

    border-radius: 17px;
  }


  .cookie-banner__content {
    align-items: flex-start;

    gap: 14px;
  }


  .cookie-banner__icon {
    width: 42px;
    height: 42px;

    border-radius: 12px;
  }


  .cookie-banner__icon svg {
    width: 22px;
    height: 22px;
  }


  .cookie-banner h2 {
    font-size: 1rem;
  }


  .cookie-banner p {
    font-size: 0.79rem;
  }


  .cookie-banner__actions {
    width: 100%;

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 18px;
  }


  .cookie-button {
    width: 100%;
    min-width: 0;
  }


  .cookie-button--primary {
    grid-column: 1 / -1;

    order: -1;
  }


  .cookie-modal {
    align-items: flex-end;

    padding: 12px;
  }


  .cookie-modal__dialog {
    width: 100%;

    max-height: calc(100dvh - 24px);

    padding: 24px 20px;

    border-radius: 20px;
  }


  .cookie-preference {
    gap: 18px;
  }


  .cookie-modal__footer {
    display: grid;

    grid-template-columns: 1fr;

    gap: 8px;
  }

}


/* =========================================================
   MOBILE PEQUENO
========================================================= */

@media (max-width: 480px) {

  .cookie-banner {
    left: 10px;
    right: 10px;

    bottom: calc(
      10px + env(safe-area-inset-bottom)
    );

    padding: 18px 16px;
  }


  .cookie-banner__icon {
    display: none;
  }


  .cookie-banner__actions {
    grid-template-columns: 1fr;
  }


  .cookie-button--primary {
    grid-column: auto;
  }


  .cookie-preference {
    grid-template-columns: minmax(0, 1fr) auto;

    gap: 14px;
  }


  .cookie-modal__header h2 {
    font-size: 1.5rem;
  }

}


/* =========================================================
   REDUÇÃO DE MOVIMENTO
========================================================= */

@media (prefers-reduced-motion: reduce) {

  .cookie-button,
  .cookie-banner__privacy,
  .cookie-modal__close,
  .cookie-switch > span,
  .cookie-switch > span::after {
    transition: none;
  }

}


/* =========================================================
   PROTEÇÃO CONTRA CSS DAS PÁGINAS INTERNAS
========================================================= */

body .cookie-consent {
  position: fixed !important;

  inset: 0 !important;

  width: 100vw !important;
  height: 100vh !important;

  margin: 0 !important;
  padding: 0 !important;

  z-index: 99999 !important;

  pointer-events: none !important;
}


body .cookie-consent .cookie-banner {
  position: fixed !important;

  left: 50% !important;
  right: auto !important;

  bottom: 22px !important;
  top: auto !important;

  width: min(1180px, calc(100vw - 40px)) !important;
  max-width: 1180px !important;

  margin: 0 !important;

  transform: translateX(-50%) !important;

  box-sizing: border-box !important;

  pointer-events: auto !important;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

  body .cookie-consent .cookie-banner {
    left: 16px !important;
    right: 16px !important;

    bottom: calc(
      16px + env(safe-area-inset-bottom)
    ) !important;

    width: auto !important;
    max-width: none !important;

    transform: none !important;
  }

}


@media (max-width: 480px) {

  body .cookie-consent .cookie-banner {
    left: 10px !important;
    right: 10px !important;

    bottom: calc(
      10px + env(safe-area-inset-bottom)
    ) !important;

    width: auto !important;
  }

}