/* ==========================================================
   KLARZ — Responsividade Global V1
   Breakpoints:
   - Mobile:  até 640px
   - Tablet:  641px — 1024px
   - Desktop: 1025px+
   ========================================================== */

/* ---------- Fundamentos ---------- */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100vw; }
img, svg, video, canvas { max-width: 100%; height: auto; }

/* ---------- TABLET (até 1024px) ---------- */
@media (max-width: 1024px) {
  /* Hero: desativa grid 2-colunas e empilha */
  .hero-grid, .hero-content-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  /* Reduz padding lateral */
  .section-container, .hero-container {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
  /* Grids 2-3 colunas ficam em 2 */
  .grid-3-cols { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2-cols { grid-template-columns: 1fr !important; }

  /* Painéis do hero (Prism/GeoScope tabs) */
  .hero-panel, .hero-panel-prism, .hero-panel-geo, .hero-panel-kmi {
    max-width: 100% !important;
    margin-top: 32px !important;
  }

  /* Header: esconde nav horizontal, mostra hamburger */
  .nav-desktop { display: none !important; }
  .nav-hamburger { display: flex !important; }
  /* Esconde os botões de ação do header (Acessar Portal, Falar com especialista) — ficam no menu mobile e footer */
  .header-actions { display: none !important; }
}

/* ---------- MOBILE (até 640px) ---------- */
@media (max-width: 640px) {
  /* Padding ainda menor */
  .section-container, .hero-container, section > div {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Todos os grids viram 1 coluna */
  [style*="grid-template-columns"]:not(.keep-cols) {
    grid-template-columns: 1fr !important;
  }

  /* Flex rows que empilham */
  .flex-stack-mobile {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Tipografia Hero — reduz */
  h1 { font-size: clamp(28px, 8vw, 42px) !important; line-height: 1.15 !important; }
  h2, .section-headline { font-size: clamp(22px, 6vw, 32px) !important; line-height: 1.2 !important; }
  h3 { font-size: clamp(18px, 5vw, 24px) !important; }

  /* Caveat/Awesome Ways grandes — reduz */
  em, [style*="Caveat"] { font-size: 1.3em !important; }

  /* Imagens e cards */
  img { max-width: 100%; }
  [style*="width:"][style*="px"]:not([style*="max-width"]) { max-width: 100% !important; }

  /* Orbital SVG decorativo — esconde e/ou redimensiona */
  svg[viewBox] { max-width: 100%; }
  [style*="width:500px"], [style*="width: 500px"],
  [style*="width:520px"], [style*="width: 520px"],
  [style*="width:480px"], [style*="width: 480px"] {
    width: 100% !important;
    max-width: 320px !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  /* Qualquer height fixo grande vira auto */
  [style*="height:500px"], [style*="height: 500px"],
  [style*="height:520px"], [style*="height: 520px"] {
    height: auto !important;
    min-height: 280px;
  }

  /* Footer: 4 colunas → 1 */
  footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Tabs no hero — scroll horizontal */
  .hero-tabs, .tabs-row {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Esconde decorações grandes */
  .hide-mobile { display: none !important; }

  /* Paddings verticais menores */
  section { padding-top: 60px !important; padding-bottom: 60px !important; }

  /* Botões largos no mobile */
  .btn-primary, .btn-outline, button[class*="btn"] {
    width: 100%;
    max-width: 100%;
  }

  /* Orbital/animações decorativas — esconder */
  .orbit-container, .orbital { display: none !important; }

  /* Marketscape section do sobre — empilha */
  .marketscape-row {
    flex-direction: column !important;
    gap: 24px !important;
  }
}

/* ---------- Hamburger menu ---------- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}
.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: #fff;
  transition: all 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100dvh;
  background: #0A111C !important;
  z-index: 99999 !important;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 80px 40px 40px;
  overflow-y: auto;
  margin: 0 !important;
}
.mobile-menu.open { display: flex !important; }
body.menu-open { overflow: hidden; }
.mobile-menu a {
  font-size: 24px;
  font-family: 'Marble', sans-serif;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 8px 16px;
  display: block;
}
.mobile-menu a:hover, .mobile-menu a:active { color: var(--ciano, #00AEEF); }

/* Hamburger sempre acima do mobile menu para poder fechar */
.nav-hamburger { z-index: 9999; position: relative; }
.nav-hamburger.open span { background: #fff; }

/* Header precisa ter z-index maior que conteúdo mas menor que mobile menu quando fechado */
.header { z-index: 50; }

/* ================================================
   DROPDOWN — Soluções (desktop)
   ================================================ */
.has-dropdown { position: relative; display: inline-flex; align-items: center; }
.dropdown-trigger { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.dropdown-trigger::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
  opacity: 0.6;
}
.has-dropdown:hover .dropdown-trigger::after,
.has-dropdown.open .dropdown-trigger::after { transform: rotate(-135deg) translateY(-2px); opacity: 1; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 340px;
  background: rgba(15,23,42,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.02);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1001;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu,
.has-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
/* invisible bridge so hover doesn't break when crossing gap */
.has-dropdown::before {
  content: "";
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: 14px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff !important;
  transition: background 0.15s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dp-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05), 0 0 12px currentColor;
}
.dp-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dp-name { font-family: 'Marble', sans-serif; font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -0.01em; }
.dp-desc { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.3; }

/* Cores dos produtos */
.dp-geoscope { color: #00AEEF; }
.dp-prism    { color: #8B5CF6; }
.dp-marketpulse { color: #F59E0B; }
.dp-insight  { color: #4F46E5; }
.dp-salesleads { color: #22C55E; }

/* Mobile: dropdown vira accordion inline dentro do menu hamburger */
@media (max-width: 1024px) {
  .has-dropdown .dropdown-menu { display: none; }
}
.mobile-accordion { width: 100%; max-width: 320px; }
.mobile-accordion-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 24px; font-family: 'Marble',sans-serif; font-weight: 700;
  color: #fff; cursor: pointer; padding: 8px 16px;
  background: transparent; border: none; width: 100%;
}
.mobile-accordion-head::after {
  content: "+"; font-size: 28px; font-weight: 300; line-height: 1;
  transition: transform 0.2s;
}
.mobile-accordion.open .mobile-accordion-head::after { content: "−"; }
.mobile-accordion-body {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0 8px;
  border-left: 2px solid rgba(255,255,255,0.1);
  margin-left: 20px;
  padding-left: 18px;
}
.mobile-accordion.open .mobile-accordion-body { display: flex; }
.mobile-accordion-body a {
  font-size: 17px !important;
  font-weight: 500 !important;
  text-align: left !important;
  padding: 6px 0 !important;
  display: flex !important; align-items: center; gap: 10px;
}
.mobile-accordion-body .dp-dot { width: 8px; height: 8px; }
