/**
 * Confut Sudamericana — CSS isolado do evento.
 *
 * Importante:
 * - NÃO depende de CSS de USA/Euro.
 * - Estiliza apenas o header/menu (markup segue o componente base do macro).
 */

body.confut-sudamericana-refactor.event-sudamericana {
  --suda-accent: #265eea;
  --suda-accent-hover: #21931b;
}

/* Preloader do tema (designesia): no refactor ele pode travar/clipping em alguns cenários.
   Euro desliga via CSS — fazemos o mesmo aqui. */
body.confut-sudamericana-refactor #de-loader {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Header base (markup do componente) */
body.confut-sudamericana-refactor header.sudamericana-site-header {
  position: relative;
  z-index: 12000;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: #fff;
  /* Hidden by default (desktop). Enabled only on mobile via media query. */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__toggle-box {
  width: 24px;
  height: 18px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__toggle-bar {
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  display: block;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__bar {
  padding: 0.9rem 0;
  background: rgba(10, 22, 51, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.95rem;
  align-items: center;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  position: relative;
  display: inline-block;
  padding: 0 !important;
  margin: 0;
  line-height: 1;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item:hover,
body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item:focus-visible {
  color: #fff !important;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  /* keep a small gap under the text (like USA) */
  bottom: -7px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center center;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.15s ease;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item:hover::after,
body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item:focus-visible::after {
  background: linear-gradient(90deg, rgba(38, 94, 234, 0.95), rgba(33, 147, 27, 0.85));
  opacity: 0.9;
  transform: scaleX(1);
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item.active {
  color: #fff !important;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-link.menu-item.active::after {
  background: linear-gradient(90deg, var(--suda-accent), rgba(33, 147, 27, 0.85));
  box-shadow: 0 0 18px rgba(38, 94, 234, 0.35);
  opacity: 1;
  transform: scaleX(1);
}

/* CTA */
body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-weight: 750;
  background: var(--suda-accent);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__cta:hover {
  background: var(--suda-accent-hover);
}

/* Dropdown (desktop) */
@media (min-width: 992px) {
  /* Desktop: keep hamburger hidden */
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__toggle {
    display: none !important;
  }
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-item--dropdown {
    position: relative;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__submenu {
    position: absolute;
    top: calc(100% - 0.55rem);
    left: 0;
    transform: translateY(0.05rem);
    min-width: 12.5rem;
    margin: 0;
    padding: 0.4rem 0;
    list-style: none;
    background: rgba(10, 22, 51, 0.96);
    border: 1px solid rgba(38, 94, 234, 0.22);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 200;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-item--dropdown:hover .suda-header__submenu,
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__menu-item--dropdown:focus-within .suda-header__submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* CTA duplicado: footer do painel só no mobile */
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__nav-footer {
    display: none !important;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__submenu-link {
    display: block;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92) !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__submenu-link:hover,
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__submenu-link:focus-visible {
    background: rgba(38, 94, 234, 0.22);
    color: #fff !important;
    outline: none;
  }
}

/* Mobile overlay — espelha Euro/Nordeste (overlay não pode cobrir logo/hamburger; painel abaixo da barra) */
@media (max-width: 991px) {
  /*
   * Tema global (`style.css`): `header.header-mobile` força padding-bottom e fundo no <header>
   * → faixa cinza / layout quebrado sob a barra Sudamericana.
   */
  body.confut-sudamericana-refactor.dark-scheme header.sudamericana-site-header.header-mobile {
    background: transparent !important;
    padding-bottom: 0 !important;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__container {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__bar {
    padding: clamp(0.72rem, 2.4vw, 0.95rem) 0;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__inner {
    align-items: center;
    min-height: 48px;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__actions.menu_side_area {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end;
    margin-left: auto !important;
    flex-shrink: 0;
    align-self: center;
    gap: 0.35rem;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    line-height: 1;
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__logo-img {
    max-height: min(52px, 16vw);
  }

  /* `<nav>` fullscreen (z-index 12001) ficava por cima do botão hamburger */
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__inner > .suda-header__brand,
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__inner > .suda-header__actions {
    position: relative;
    z-index: 12002;
  }

  /* CTA duplicado: no mobile, CTA fica dentro do painel */
  body.confut-sudamericana-refactor header.sudamericana-site-header .suda-header__actions .suda-header__cta {
    display: none !important;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header.header-mobile {
    overflow: visible !important;
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header.header-mobile .suda-header__bar {
    background: rgba(10, 22, 51, 0.97) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
    filter: none !important;
  }

  body.confut-sudamericana-refactor .suda-header__nav {
    position: fixed !important;
    inset: 0 !important;
    z-index: 12001;
    display: block !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    visibility: hidden;
    pointer-events: none;
  }

  body.suda-nav--open .suda-header__nav {
    visibility: visible;
    pointer-events: none;
  }

  body.suda-nav--open .suda-header__nav .suda-header__nav-scrim,
  body.suda-nav--open .suda-header__nav .suda-header__nav-panel {
    pointer-events: auto;
  }

  body.confut-sudamericana-refactor .suda-header__nav-scrim {
    display: block !important;
    position: absolute;
    z-index: 0;
    top: var(--suda-bar-h, 64px);
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    background: rgba(4, 10, 24, 0.72);
    opacity: 0;
    transition: opacity 0.32s ease;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  body.suda-nav--open .suda-header__nav-scrim {
    opacity: 1;
  }

  body.confut-sudamericana-refactor .suda-header__nav-panel {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    z-index: 2;
    top: var(--suda-bar-h, 64px);
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    max-height: none;
    padding: 1.35rem 1.15rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(188deg, #0a1633 0%, #111f46 42%, #0b2345 100%);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    border-top: 1px solid rgba(38, 94, 234, 0.28);
    border-radius: 16px 16px 0 0;
  }

  body.confut-sudamericana-refactor .suda-header__nav-panel .suda-header__menu {
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    align-content: flex-start;
    gap: 0;
    width: 100%;
  }

  body.confut-sudamericana-refactor .suda-header__nav-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1rem;
  }

  body.suda-nav--open .suda-header__nav-panel {
    transform: translateY(0);
    opacity: 1;
  }

  body.confut-sudamericana-refactor .suda-header__submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0.35rem 0.75rem;
    border-left: 2px solid rgba(38, 94, 234, 0.45);
  }

  body.confut-sudamericana-refactor header.sudamericana-site-header.header-mobile .suda-header__menu .suda-header__menu-item:last-child {
    margin-bottom: 0 !important;
  }
}

/* ========== Fix: footer não pode ficar "cortado" ========== */
body.confut-sudamericana-refactor #wrapper {
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.confut-sudamericana-refactor #content {
  overflow: visible;
  padding-bottom: 1.25rem;
  flex: 1 0 auto;
}

body.confut-sudamericana-refactor {
  /* Garante scroll do documento (evita "clipping" quando alguma regra/JS
     deixa overflow/altura travados em 100vh). */
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100dvh;
}

body.confut-sudamericana-refactor footer {
  overflow: visible;
  position: relative;
  z-index: 2;
  padding-bottom: max(30px, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}

/* ========== Fix definitivo: evita corte do footer (igual USA) ========== */
html body.confut-sudamericana-refactor,
body.confut-sudamericana-refactor {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
}

body.confut-sudamericana-refactor #wrapper,
body.confut-sudamericana-refactor #content {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

