/**
 * Rodapé institucional travado — cores e tipografia NÃO herdam do tema.
 * Usar em todas as páginas via helpers/legal_footer_helper.php
 */

:root {
  --legal-footer-offset: 34px;
}

/* Layout fullscreen / painéis: página termina no rodapé */
html:has(body.has-legal-footer) {
  height: 100%;
}

body.has-legal-footer {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
}

body.has-legal-footer > .legal-footer-page-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* Login/register em grid: preenche a área acima do rodapé */
body.has-legal-footer > .legal-footer-page-main.grid {
  min-height: calc(100dvh - var(--legal-footer-offset) - env(safe-area-inset-bottom, 0px));
}

body.has-legal-footer > .legal-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/*
 * Painéis com menu lateral: o rodapé NÃO invade a sidebar.
 * Sidebar permanece full-height (top → bottom). Rodapé só na coluna de conteúdo.
 */
@media (min-width: 768px) {
  body.has-legal-footer:has(#sidebar) > .legal-footer,
  body.has-legal-footer:has(#admin-sidebar) > .legal-footer {
    margin-left: 16rem; /* alinhado ao md:w-64 / md:ml-64 */
    width: calc(100% - 16rem);
  }
}

/* Menu inferior flutuante (checkout etc.): sobe para não cobrir o rodapé */
body.has-legal-footer #mobile-footer {
  bottom: calc(var(--legal-footer-offset) + env(safe-area-inset-bottom, 0px)) !important;
}

/* ========== Rodapé (estética travada — escuro fosco) ========== */
.legal-footer {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 9px 16px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  background: #0a0a0a !important;
  border-top: 1px solid #1f1f1f !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color-scheme: only dark;
  z-index: 30; /* abaixo da sidebar (z-50) */
  position: relative;
}

.legal-footer *,
.legal-footer *::before,
.legal-footer *::after {
  box-sizing: border-box;
  color-scheme: only dark;
}

.legal-footer__inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0;
  text-align: center;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  font-weight: 400;
  letter-spacing: 0;
}

.legal-footer__meta,
.legal-footer__nav {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: inherit;
  font: inherit;
  text-align: inherit;
}

.legal-footer__name {
  font-weight: 600 !important;
  color: #ffffff !important;
}

.legal-footer__cnpj,
.legal-footer__sep {
  font-weight: 400 !important;
  color: #a3a3a3 !important;
}

.legal-footer__nav a {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 600 !important;
  line-height: inherit !important;
  color: #e5e5e5 !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.legal-footer__nav a:hover,
.legal-footer__nav a:focus-visible {
  color: #ffffff !important;
  text-decoration: underline !important;
  outline: none;
}

.legal-footer__nav a:focus-visible {
  text-decoration-thickness: 1px;
}

/* Páginas legais (mesmo visual escuro do site) */
.legal-page {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: #0a0a0a;
  color: #e5e5e5;
}

.legal-page__wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}

.legal-page__wrap h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.25;
}

.legal-page__wrap .legal-page__sub {
  font-size: 0.875rem;
  color: #a3a3a3;
  margin: 0 0 28px;
  line-height: 1.45;
}

.legal-page__wrap h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f5f5f5;
  margin: 28px 0 10px;
}

.legal-page__wrap p,
.legal-page__wrap li {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #d4d4d4;
  margin: 0 0 12px;
}

.legal-page__wrap ul {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.legal-page__wrap a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
}

.legal-page__wrap a:hover {
  color: #fafafa;
}
