/* Consentimento de cookies por categoria: cartão flutuante no primeiro
   acesso e painel "Gerenciar" (<dialog>). Tema do site: vermelho #ea3636,
   escuro #14191d, texto #2d3643, Inter. */

.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 2rem;
  z-index: 10000;
  padding: 0 2rem;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-consent.is-hidden {
  transform: translateY(calc(100% + 3rem));
  opacity: 0;
  pointer-events: none;
}

.cookie-consent-card {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  max-width: 104rem;
  margin: 0 auto;
  padding: 1.8rem 2.2rem;
  border-radius: 1.6rem;
  background: #fff;
  box-shadow: 0 1.2rem 4rem rgba(20, 25, 29, 0.18);
}

.cookie-consent-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  background: rgba(234, 54, 54, 0.1);
  color: #ea3636;
}

.cookie-consent-icon svg {
  width: 2.2rem;
  height: 2.2rem;
}

.cookie-consent-text {
  flex: 1;
  min-width: 0;
}

.cookie-consent-text strong {
  display: block;
  font-weight: 600;
  font-size: 1.6rem;
  color: #14191d;
}

.cookie-consent-text p {
  margin-top: 0.3rem;
  font-size: 1.4rem;
  color: #5b6670;
}

.cookie-consent-text a,
.cookie-prefs-foot a {
  display: inline; /* o reset do template força a { display: block } */
  font-size: 1.4rem;
  color: #ea3636;
  text-decoration: underline;
}

.cookie-consent-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.8rem;
}

/* Botões: o reset "button { all: unset }" do main.min exige o box-sizing */
.cookie-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 1.8rem;
  border: 1px solid #d5dbe3;
  border-radius: 1rem;
  background: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 1.4rem;
  color: #2d3643;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cookie-btn:hover {
  border-color: #b9c1cc;
  background: #f5f7fa;
}

.cookie-btn-primary {
  border-color: #ea3636;
  background: #ea3636;
  color: #fff;
}

.cookie-btn-primary:hover {
  border-color: #ba1717;
  background: #ba1717;
}

.cookie-btn:focus-visible,
.cookie-prefs-close:focus-visible,
.cookie-prefs-shortcuts button:focus-visible,
.cookie-prefs-list input:focus-visible {
  outline: 2px solid #ea3636;
  outline-offset: 2px;
}

/* ----- Painel "Gerenciar" ----- */

.cookie-prefs {
  width: min(52rem, calc(100% - 3.2rem));
  max-height: calc(100% - 3.2rem);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 1.6rem;
  overflow: hidden;
  box-shadow: 0 2.4rem 6rem rgba(20, 25, 29, 0.35);
}

.cookie-prefs::backdrop {
  background: rgba(20, 25, 29, 0.55);
}

.cookie-prefs-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 3.2rem);
}

.cookie-prefs-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.4rem;
  padding: 2.4rem 5.6rem 1.8rem 2.4rem;
  background: #14191d;
}

.cookie-prefs-head .cookie-consent-icon {
  background: rgba(255, 255, 255, 0.08);
}

.cookie-prefs-head h2 {
  font-weight: 600;
  font-size: 1.8rem;
  color: #fff;
}

.cookie-prefs-head p {
  margin-top: 0.4rem;
  font-size: 1.4rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.cookie-prefs-close {
  box-sizing: border-box;
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.cookie-prefs-close svg {
  width: 1.8rem;
  height: 1.8rem;
}

.cookie-prefs-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cookie-prefs-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1.2rem 2.4rem 1.6rem;
  background: #14191d;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.65);
}

.cookie-prefs-shortcuts > span:last-child {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cookie-prefs-shortcuts button {
  font-family: inherit;
  font-weight: 600;
  font-size: 1.3rem;
  color: #fff;
  cursor: pointer;
}

.cookie-prefs-shortcuts button:hover {
  color: #ea3636;
}

.cookie-prefs-list {
  overflow-y: auto;
  list-style: none;
  background: #fff;
}

.cookie-prefs-list li + li {
  border-top: 1px solid #e6eaef;
}

.cookie-prefs-list label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem 2.4rem;
  cursor: pointer;
}

.cookie-prefs-list strong {
  display: block;
  font-weight: 600;
  font-size: 1.5rem;
  color: #14191d;
}

.cookie-prefs-list small {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.35rem;
  line-height: 1.45;
  color: #5b6670;
}

.cookie-prefs-list input {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  accent-color: #ea3636;
  cursor: pointer;
}

.cookie-prefs-list input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-prefs-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.6rem 2.4rem 2rem;
  border-top: 1px solid #e6eaef;
  background: #fff;
}

.cookie-prefs-foot p {
  font-size: 1.4rem;
  color: #5b6670;
}

.cookie-prefs-foot > div {
  display: flex;
  gap: 0.8rem;
}

/* Link "Preferências de cookies" do rodapé */
.footer .cookie-prefs-link {
  font-family: inherit;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
}

.footer .cookie-prefs-link:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .cookie-consent {
    bottom: 1.2rem;
    padding: 0 1.2rem;
  }

  .cookie-consent-card {
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1.6rem;
  }

  .cookie-consent-icon {
    width: 3.6rem;
    height: 3.6rem;
  }

  .cookie-consent-text {
    flex: 1 1 calc(100% - 5rem);
  }

  .cookie-consent-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .cookie-consent-actions .cookie-btn {
    flex: 1 1 auto;
  }

  .cookie-consent-actions .cookie-btn-primary {
    flex-basis: 100%;
  }

  .cookie-prefs-foot > div,
  .cookie-prefs-foot .cookie-btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent {
    transition: none;
  }
}

/* O tema pinta todo elemento com "* { color: #2d3643 }": sem isso os
   ícones (stroke=currentColor) e os textos internos não herdam a cor. */
.cookie-consent-icon svg,
.cookie-consent-icon svg *,
.cookie-prefs-close svg,
.cookie-prefs-close svg * {
  color: inherit;
}

.cookie-prefs-shortcuts span {
  color: rgba(255, 255, 255, 0.65);
}

/* Título recebe o foco ao abrir o painel (leitores de tela anunciam o painel) */
.cookie-prefs-head h2:focus {
  outline: none;
}
