/* style.css — NoLoss Supply Chain
   Estrutura base, layout e responsividade.
   Controla o comportamento de todos os componentes em todas as resoluções.
   O theme.css define a aparência visual; este arquivo define como ela se encaixa. */


/* === RESET === */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* === VARIÁVEIS === */

:root {
  --color-brand:      #007bff;
  --color-brand-dim:  #6c757d;
  --color-ink:        #28a745;
  --color-bg:         #ffffff;
  --color-text:       #333333;
  --color-text-muted: #666666;

  --font-primary:   'Arial', sans-serif;
  --font-secondary: 'Georgia', serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  3rem;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 4rem;

  --container-max: 1200px;
  --content-max:   800px;

  --transition-fast:   0.06s ease;
  --transition-normal: 0.3s ease;
  --transition-slow:   0.5s ease;

  /* Altura do header — sobrescrita pelo theme.css conforme a logo definida */
  --header-height: 60px;
}


/* === BASE === */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}


/* === TIPOGRAFIA === */

h1, h2, h3, h4, h5, h6 {
  margin-bottom: var(--space-sm);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  margin-bottom: var(--space-sm);
  font-size: var(--text-base);
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--color-ink);
}


/* === IMAGENS === */

img {
  max-width: 100%;
  height: auto;
  display: block;
}


/* === CONTAINERS === */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-sm);
}

.section {
  padding: var(--space-lg) 0;
}


/* === BOTÕES === */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-primary {
  background-color: var(--color-brand);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-ink);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


/* === SPLIT BUTTON === */

.btn-split-wrap {
  position: relative;
  display: inline-flex;
}

.btn-split-main {
  border-radius: 4px 0 0 4px;
}

.btn-split-arrow {
  padding: 0 0.875rem;
  border-left: 1px solid var(--color-white-dim);
  border-radius: 0 4px 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-split-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  border-radius: 4px;
  display: none;
  z-index: 200;
}

.btn-split-wrap.open .btn-split-dropdown {
  display: block;
}


/* === GRID === */

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }


/* === HEADER / NAV === */

.header {
  width: 100%;
  padding: var(--space-sm) 0;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative; /* ativa z-index e cria contexto de empilhamento claro */
  z-index: 1000;
  /* sticky aplicado apenas no desktop — ver @media (min-width: 1200px) */
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-sm);
}

.nav-menu a {
  color: var(--color-text);
  font-weight: 500;
  transition: color var(--transition-normal);
}

.nav-menu a:hover {
  color: var(--color-brand);
}

/* Hamburguer — oculto no desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}


/* === DROPDOWN NAV === */

.nav-item {
  position: relative;
}

.nav-item.has-dropdown > a {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 220px;
  list-style: none;
  padding: 0.5rem 0;
  z-index: 1002;
}

.dropdown li {
  width: 100%;
}

.dropdown a {
  display: block;
  padding: 0.65rem 1.25rem;
  white-space: nowrap;
}

/* Desktop: hover abre | JS .open também abre */
.nav-item.has-dropdown:hover > .dropdown,
.nav-item.has-dropdown.open > .dropdown {
  display: block;
}


/* === CARDS === */

.card {
  background: white;
  border-radius: 8px;
  padding: var(--space-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-normal),
              box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}


/* === FOOTER === */

.footer {
  background-color: var(--color-brand-dim);
  color: white;
  padding: var(--space-lg) 0;
  text-align: center;
}


/* === FORMULÁRIOS === */

.form-group {
  margin-bottom: var(--space-sm);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: var(--text-base);
  font-family: var(--font-primary);
  transition: border-color var(--transition-normal);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-brand);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}


/* === UTILITÁRIOS === */

.hide-mobile { display: block; }
.show-mobile { display: none; }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }


/* === ANIMAÇÕES === */

.fade-in {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================
   MEDIA QUERIES
   ============================================ */


/* === SMARTPHONES PEQUENOS (até 479px) === */

@media (max-width: 479px) {
  :root {
    --text-3xl: 2rem;
    --text-2xl: 1.5rem;
    --text-xl:  1.25rem;
    --space-lg: 2rem;
    --space-xl: 2.5rem;
  }

  html { font-size: 14px; }

  .container { padding: 0 1rem; }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .btn { width: 100%; padding: 1rem; }
  .btn-split-wrap { width: 100%; }
  .btn-split-main { flex: 1; width: auto; }
  .btn-split-arrow { width: auto; }

  /* Tema — componentes em telas muito pequenas */
  .pillars-section .grid-4 { grid-template-columns: 1fr; }
  .pillar-item { padding: var(--space-sm); border-right: none; }

  /* MVV */
  .mvv-timeline::before { display: none; }
  .mvv-step { gap: var(--space-sm); }
  .mvv-node { width: 36px; height: 36px; }
  .mvv-node svg { width: 16px; height: 16px; }
  .mvv-statement { font-size: var(--text-base); padding-left: var(--space-sm); }
  .mvv-values-grid { grid-template-columns: 1fr !important; }
}


/* === SMARTPHONES (480px – 599px) === */

@media (min-width: 480px) and (max-width: 599px) {
  :root {
    --text-3xl: 2.25rem;
    --text-2xl: 1.75rem;
  }

  html { font-size: 14px; }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}


/* === SMARTPHONES GRANDES (600px – 767px) === */

@media (min-width: 600px) and (max-width: 767px) {
  :root {
    --text-3xl: 2.5rem;
    --text-2xl: 1.875rem;
  }

  html { font-size: 15px; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}


/* === MOBILE + TABLET (até 1399px) — hamburguer ativo === */

@media (max-width: 1399px) {
  html { overflow-x: hidden; } /* evita scroll horizontal causado pelo menu fixed */

  /* Header fixo no mobile com smart sticky */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transition: transform var(--transition-fast); /* revelar */
  }

  .header--hidden {
    transform: translateY(-100%);
    transition: transform var(--transition-normal); /* esconder */
  }

  /* Compensa o espaço ocupado pelo header fixo — logo mobile tem 90px (vs 100px no desktop) */
  body { padding-top: calc(90px + 2 * var(--space-sm)); }


  /* Hamburguer visível */
  .nav-toggle {
    display: block;
    position: relative; /* necessário para z-index funcionar */
    width: 36px;
    height: 36px;
    z-index: 1060;
    align-self: flex-end;
    margin-bottom: 8px;
    margin-right: 1rem;
  }

  /* Linhas do ícone */
  .hamburger,
  .hamburger::before,
  .hamburger::after {
    display: block;
    width: 36px;
    height: 3px;
    background-color: #333;
    position: relative;
    transition: all 0.3s ease;
  }

  .hamburger::before,
  .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
  }

  .hamburger::before { top: -9px; }
  .hamburger::after  { top: 9px; }

  /* Menu lateral — oculto por padrão, começa abaixo do header */
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 60%;
    max-width: 300px;
    height: auto;
    max-height: calc(100vh - var(--header-height));
    background-color: var(--color-bg-header);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: var(--space-md);
    box-shadow: var(--shadow-dropdown);
    transition: right 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--color-border);
  }

  /* Menu aberto via JS */
  .nav-menu.active {
    right: 0;
  }

  /* Hamburguer transforma em X quando ativo */
  .nav-toggle.active .hamburger {
    background-color: transparent;
  }

  .nav-toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
  }

  .nav-toggle.active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
  }

  /* Impede scroll do body com menu aberto */
  body.menu-open {
    overflow: hidden;
  }

  /* Dropdown inline no mobile/tablet */
  .dropdown {
    position: static;
    min-width: 100%;
    padding: 0;
    box-shadow: none;
    border: none;
  }

  .nav-item.has-dropdown > a {
    justify-content: space-between;
  }

  /* Desativa hover no mobile/tablet — somente JS .open funciona */
  .nav-item.has-dropdown:hover > .dropdown {
    display: none;
  }

  .nav-item.has-dropdown.open > .dropdown {
    display: block;
  }

  /* Utilitários de visibilidade */
  .hide-mobile { display: none; }
  .show-mobile { display: block; }
  .text-center-mobile { text-align: center; }
}


/* === TABLET PORTRAIT (768px – 991px) === */

@media (min-width: 768px) and (max-width: 991px) {
  :root {
    --text-3xl: 2.75rem;
    --text-2xl: 2rem;
    --space-lg: 3.5rem;
  }

  html { font-size: 15px; }

  .container { padding: 0 2rem; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }

  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}


/* === TABLET LANDSCAPE / SMALL DESKTOP (992px – 1199px) === */

@media (min-width: 992px) and (max-width: 1199px) {
  html { font-size: 16px; }

  .container { max-width: 960px; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}


/* === DESKTOP (1400px+) — sticky header ativo === */

@media (min-width: 1400px) {
  .header {
    position: sticky;
    top: 0;
  }

  .footer-links ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}


/* === DESKTOP (1200px – 1399px) === */

@media (min-width: 1200px) and (max-width: 1399px) {
  .container { max-width: 1140px; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}


/* === DESKTOP GRANDE (1400px – 1599px) === */

@media (min-width: 1400px) and (max-width: 1599px) {
  .container { max-width: 1320px; }
}


/* === DESKTOP XL (1600px+) === */

@media (min-width: 1600px) {
  .container { max-width: 1400px; }

  :root {
    --text-3xl: 3.5rem;
    --text-2xl: 2.5rem;
    --space-xl: 5rem;
  }
}


/* === ORIENTAÇÃO LANDSCAPE (mobile/tablet) === */

@media (max-width: 1399px) and (orientation: landscape) {
  :root { --space-lg: 2rem; }

  .section { padding: var(--space-md) 0; }
}


/* ============================================
   RESPONSIVIDADE DOS COMPONENTES DO TEMA
   Classes definidas no theme.css;
   comportamento responsivo controlado aqui.
   ============================================ */


/* === DESKTOP (1200px+) — segmentos: remove scroll, distribui igualmente === */

@media (min-width: 1200px) {
  .segments-track {
    overflow-x: visible;
    justify-content: space-between;
  }

  .segment-item {
    flex: 1;
  }

  .segments-scroll-bar {
    display: none;
  }

  .partner-card .partner-photo {
    width: 128px;
    height: 128px;
  }

  .page-sobre .hero .hero-content {
    max-width: 1200px;
    margin-left: 0;
  }

  .page-sobre .hero .hero-subtitle {
    max-width: 100%;
  }

  .nav-controls {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
  }

  .lang-btn {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
}


/* === TABLET E ABAIXO (até 991px) === */

@media (max-width: 991px) {
  .pillar-item {
    border-right: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand,
  .footer-contact,
  .footer-links {
    grid-column: auto;
    grid-row: auto;
  }

}


/* === CONTATO — layout lado a lado no desktop, empilhado no mobile === */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}


/* === SERVIÇOS — cards de navegação (seção Destaques) === */

.service-nav-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

@media (min-width: 600px) {
  .service-nav-cards {
    flex-direction: row;
    justify-content: center;
  }
}


/* === SERVIÇOS — grid das seções de serviço (Tecnologias e Alimentos) === */

.service-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.service-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
}

@media (min-width: 768px) {
  .service-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  /* Tecnologias Disruptivas: texto à esquerda, imagem à direita.
     No DOM a imagem vem primeiro (mobile-first: acima no empilhamento).
     No desktop, o texto recebe order:-1 e vai para a coluna da esquerda. */
  .service-layout--reverse .service-text {
    order: -1;
  }
}


/* === SOBRE NÓS — fecha gap sub-pixel entre seções de mesmo fundo === */

.page-sobre .highlights-section + .segments-section {
  margin-top: -2px;
  margin-bottom: -2px;
}


/* === MOBILE (até 767px) === */

@media (max-width: 767px) {
  .hero {
    min-height: 85vh;
  }

  .hero h1 {
    letter-spacing: -0.5px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-ghost {
    width: 100%;
    text-align: center;
  }

  .pillars-section .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .whatsapp-btn {
    bottom: 1.25rem;
    right: 1.25rem;
  }

  .card   { padding: var(--space-sm); }
  .footer { padding: var(--space-md) 0; }

  /* Previne zoom automático em inputs no iOS */
  .form-input,
  .form-textarea { font-size: 16px; }
}


/* === ACESSIBILIDADE === */

::selection {
  background-color: var(--color-brand);
  color: white;
}

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* === CURSOS & INFOPRODUTOS === */

.course-content h2 {
  margin-bottom: var(--space-sm);
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.course-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.course-learn {
  margin-bottom: var(--space-md);
}

.course-learn-list {
  list-style: none;
  padding: 0;
  margin-top: var(--space-xs);
}

.course-learn-list li {
  padding: 0.35rem 0 0.35rem var(--space-md);
  position: relative;
  font-size: var(--text-base);
}

.course-learn-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
}

.cursos-soon-inner {
  max-width: 680px;
  margin: 0 auto;
}

.soon-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin: var(--space-md) 0;
}

.soon-tag {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 600;
}


/* === CASES & PORTFÓLIO — TIMELINE === */

.cases-section { background-color: var(--color-bg); }

.cases-timeline {
  position: relative;
  margin-top: var(--space-xl);
}

.cases-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
}

.case-item {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 0 var(--space-md);
  align-items: center;
  margin-bottom: var(--space-xl);
}

.case-item--reverse .case-image     { order: 3; }
.case-item--reverse .case-connector { order: 2; }
.case-item--reverse .case-card      { order: 1; }

.case-image {
  position: relative;
}

.case-image img {
  width: 100%;  
  object-fit: contain;
  border-radius: 8px;
}

.case-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  align-self: stretch;
}

.case-node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.case-detail,
.case-related {
  margin-top: var(--space-sm);
}

.case-detail:last-of-type { margin-bottom: 0; }

.case-detail ul {
  list-style: none;
  margin-top: var(--space-xs);
  padding-left: 0;
}

.case-detail li {
  padding: 0.2rem 0 0.2rem var(--space-sm);
  position: relative;
  font-size: var(--text-sm);
}

.case-detail li::before {
  content: '—';
  position: absolute;
  left: 0;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.case-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}


/* === CASES — MOBILE (até 767px) === */

@media (max-width: 767px) {
  .cases-timeline::before {
    left: 10px;
    transform: none;
  }

  .case-item,
  .case-item--reverse {
    display: block;
    padding-left: calc(var(--space-md) + var(--space-sm));
    position: relative;
    margin-bottom: var(--space-lg);
  }

  .case-item::before,
  .case-item--reverse::before {
    content: '';
    position: absolute;
    left: 4px;
    top: var(--space-sm);
    width: 14px;
    height: 14px;
    border-radius: 50%;
  }

  .case-connector { display: none; }

  .case-image { margin-bottom: var(--space-sm); }
}


/* === IMPRESSÃO === */

@media print {
  * { background: white !important; color: black !important; box-shadow: none !important; }
  .header, .footer, .btn, .nav { display: none; }
  a { text-decoration: underline; }
}
