/* Glow Holding · Mobile & Responsive */

@media (max-width: 820px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Header sempre visível no mobile (home esconde no desktop na seção tese) */
  header {
    padding-left: 16px !important;
    padding-right: 56px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: background 200ms ease-out, border-color 200ms ease-out, backdrop-filter 200ms ease-out !important;
  }

  /* Glassmorphism no header sticky (mobile) */
  body.glow-header-scrolled header {
    background: rgba(242, 241, 237, 0.82) !important;
    backdrop-filter: blur(18px) saturate(1.15) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
    border-bottom: 1px solid #D9DBDF !important;
  }

  body.glow-header-scrolled.glow-header-dark header {
    background: rgba(10, 10, 10, 0.84) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  header > a img {
    height: 28px !important;
  }

  /* Esconde nav dentro do header; o painel mobile fica no body */
  header nav[aria-label="Institucional"] {
    display: none !important;
  }

  /* Botão fixo no body: não some quando o React re-renderiza o header */
  .glow-nav-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed;
    top: 14px;
    right: 16px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    margin: 0;
    border: 1px solid rgba(14, 16, 19, 0.14);
    background: #AEEA00;
    color: #0E1013;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 99999;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
  }

  .glow-nav-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transition: transform 200ms ease-out, opacity 200ms ease-out;
  }

  body.glow-nav-open .glow-nav-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  body.glow-nav-open .glow-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.glow-nav-open .glow-nav-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .glow-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.45);
    z-index: 99990;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.glow-nav-open header {
    z-index: 99992 !important;
  }

  /* Painel no body: escapa do stacking context do header (z-index 50) */
  #glow-main-nav {
    display: none !important;
    position: fixed !important;
    top: 72px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 24px 20px 48px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    background: #F2F1ED !important;
    border-top: 1px solid #D9DBDF;
    z-index: 99991 !important;
    color: #0E1013 !important;
    box-sizing: border-box;
  }

  body.glow-nav-open #glow-main-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  #glow-main-nav > a,
  #glow-main-nav > .eco-nav > a {
    display: flex !important;
    align-items: center;
    min-height: 48px;
    padding: 12px 0 !important;
    font-size: 16px !important;
    color: #0E1013 !important;
    border-bottom: 1px solid #D9DBDF !important;
    white-space: normal !important;
  }

  #glow-main-nav .eco-nav {
    display: block !important;
    width: 100%;
    border-bottom: 1px solid #D9DBDF;
  }

  #glow-main-nav .eco-caret {
    display: none;
  }

  #glow-main-nav .eco-menu {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    padding: 0 0 8px !important;
  }

  #glow-main-nav .eco-menu > div {
    min-width: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 0 0 0 12px !important;
    background: transparent !important;
  }

  #glow-main-nav .eco-menu a {
    min-height: 44px;
    padding: 10px 0 !important;
    color: #0E1013 !important;
    border-bottom: 1px solid rgba(14, 16, 19, 0.06) !important;
  }

  /* Grids empilhados via JS (.glow-mobile-stack / .glow-mobile-fullcol) */
  .glow-mobile-stack {
    grid-template-columns: 1fr !important;
    row-gap: 32px !important;
  }

  .glow-mobile-fullcol {
    grid-column: 1 / -1 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Hero home: texto acima, imagem abaixo (CSS puro, sem depender do JS) */
  section[data-screen-label="SEC-01 Hero"] > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
    align-items: stretch !important;
  }

  section[data-screen-label="SEC-01 Hero"] > div > div {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 0 !important;
    flex: 0 0 auto !important;
  }

  section[data-screen-label="SEC-01 Hero"] .glow-mobile-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
  }

  section[data-screen-label="SEC-01 Hero"] .glow-mobile-fullcol {
    order: unset;
  }

  /* ── Espaçamento de seções ── */
  section,
  footer[data-theme] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  section[style*="padding:200px"],
  section[style*="padding: 200px"] {
    padding-top: 112px !important;
    padding-bottom: 64px !important;
  }

  section[style*="padding:160px"],
  section[style*="padding: 160px"] {
    padding-top: 80px !important;
    padding-bottom: 56px !important;
  }

  section[style*="padding:128px"],
  section[style*="padding: 128px"] {
    padding-top: 64px !important;
    padding-bottom: 48px !important;
  }

  section[style*="padding:120px"],
  section[style*="padding: 120px"],
  section[style*="min-height:100vh"],
  section[style*="min-height: 100vh"] {
    min-height: auto !important;
    padding-top: 96px !important;
    padding-bottom: 48px !important;
  }

  section[style*="20vw"],
  section[style*="18vw"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  footer[data-theme] {
    padding-top: 64px !important;
    padding-bottom: 32px !important;
  }

  /* ── Tipografia & blocos ── */
  [style*="max-width:calc(100% / 7"] {
    max-width: 100% !important;
  }

  h1[style*="clamp(48px"],
  h1[style*="clamp(38px"],
  h2[style*="clamp(40px"],
  h2[style*="clamp(36px"],
  h2[style*="clamp(34px"] {
    font-size: clamp(32px, 9vw, 48px) !important;
  }

  /* ── Logos parceiros home (2 colunas via grid) ── */
  .brand-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 32px 20px !important;
    justify-items: center !important;
    align-items: center !important;
  }

  .brand-grid .brand-slot {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 52px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .brand-grid .brand-slot img {
    max-width: 100% !important;
    max-height: 44px !important;
    width: auto !important;
    height: auto !important;
  }

  .brand-slot {
    min-width: 0 !important;
  }

  /* ── Formulários ── */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  form[style*="display:flex"][style*="align-items:stretch"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }

  form[style*="display:flex"][style*="align-items:stretch"] button[type="submit"] {
    width: 100% !important;
    min-height: 48px;
  }

  /* ── Botões touch-friendly ── */
  button,
  a[style*="padding:16px 32px"],
  a[style*="padding:15px 30px"],
  a[style*="padding:14px 28px"],
  a[style*="padding:14px 26px"] {
    min-height: 44px;
  }

  footer a[aria-label="LinkedIn"],
  footer a[aria-label="Instagram"],
  footer a[aria-label="YouTube"],
  footer a[aria-label="WhatsApp Glow Holding"] {
    width: 44px !important;
    height: 44px !important;
  }

  /* ── Iframes embed ── */
  iframe[title*="ecossistema"],
  iframe[title*="Ecossistema"],
  iframe[src*="eco-3d"],
  iframe[src*="globo-3d"] {
    height: 70vh !important;
    min-height: 420px;
  }

  /* ── Imagens hero ── */
  [style*="height:min(64vh"],
  [style*="height:min(58vh"] {
    height: min(48vh, 420px) !important;
  }

  /* ── Flex rows estreitas ── */
  [style*="display:flex"][style*="flex-wrap:nowrap"] {
    flex-wrap: wrap !important;
  }

  /* ── Margens internas grandes ── */
  [style*="margin-top:128px"],
  [style*="margin-top: 128px"],
  [style*="margin-top:96px"],
  [style*="margin-top: 96px"],
  [style*="margin-top:88px"],
  [style*="margin-top: 88px"],
  [style*="margin-top:80px"],
  [style*="margin-top: 80px"] {
    margin-top: 48px !important;
  }

  [style*="margin-top:72px"],
  [style*="margin-top: 72px"],
  [style*="margin-top:64px"],
  [style*="margin-top: 64px"],
  [style*="margin-top:56px"],
  [style*="margin-top: 56px"] {
    margin-top: 40px !important;
  }

  /* ── Gaps de grid ── */
  [style*="column-gap:48px"],
  [style*="column-gap: 48px"],
  [style*="gap:64px"],
  [style*="gap: 64px"] {
    gap: 24px !important;
    row-gap: 32px !important;
  }

  [style*="minmax(300px"],
  [style*="minmax(220px"] {
    min-width: 0 !important;
  }

  #club-cursor {
    display: none !important;
  }

  [style*="overflow-x:auto"],
  [style*="overflow-x: auto"] {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #glow-main-nav > a,
  #glow-main-nav > .eco-nav > a {
    font-size: 15px !important;
  }

  section[style*="padding:200px"],
  section[style*="padding: 200px"] {
    padding-top: 104px !important;
  }
}

@media (min-width: 821px) {
  .glow-nav-toggle,
  .glow-nav-overlay {
    display: none !important;
  }
}

@media (hover: none) {
  .eco-nav:hover .eco-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow-nav-toggle span {
    transition: none !important;
  }
}
