/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .header-main-menu > li > a { padding: 10px 12px; font-size: 12px; }
  .header-secondary-menu a { padding: 5px 9px; font-size: 12px; }
}

@media (max-width: 992px) {
  .solutions-grid { grid-template-columns: 1fr; }
  .solution-card { flex-direction: row; }
  .solution-card-img { width: 200px; min-height: 200px; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  /* !important: alguns templates (ex. hub de produtos) definem
     grid-template-columns inline via PHP — precisa vencer no responsivo. */
  .numbers-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 32px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .segments-grid { grid-template-columns: repeat(3, 1fr); }
  .segment-card { height: 360px; }
  .history-grid { grid-template-columns: repeat(2, 1fr); }
  .diferenciais-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-video-content h1 { font-size: 38px; }
}

/* ========== MOBILE — Abrangente e cuidadoso ========== */
@media (max-width: 768px) {

  /* --- HEADER MOBILE: transparente, fixo, overlay sobre hero/video --- */
  .header-top { display: none !important; }

  /* Fixo e transparente: hero/video sobe até o topo por baixo */
  .site-header {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    background: transparent !important;
    box-shadow: none !important;
    transition: none !important;
  }
  .site-header .header-bottom {
    background: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
  }

  /* Hero estático: flex-start + padding-top garante conteúdo abaixo do header fixo (46px).
     height: auto sem min-height fixo — hero cresce exatamente o que o conteúdo precisar. */
  .hero { height: auto !important; align-items: flex-start !important; }

  /* Logo: sempre visível, branca, menor */
  .site-header .header-bottom-logo,
  .site-header.scrolled .header-bottom-logo {
    max-width: 220px !important;
    opacity: 1 !important;
    overflow: visible !important;
    transition: none !important;
    display: flex !important;
    align-items: center !important;
  }
  .site-header .header-bottom-logo img,
  .site-header.scrolled .header-bottom-logo img {
    height: 46px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    filter: none !important;
  }
  .site-header .header-bottom-logo .logo-desktop { display: none !important; }
  .site-header .header-bottom-logo .logo-mobile  { display: block !important; }

  .header-bottom-inner {
    height: 46px !important;
    transition: none !important;
    justify-content: space-between;
  }

  /* Hamburger branco */
  .nav-hamburger span { background: var(--white) !important; }

  /* Menu principal oculto até abrir */
  .header-main-menu { display: none !important; }
  .header-secondary-menu { display: none; }
  .header-social { display: none; }
  .header-top-icons { display: none; }
  .nav-hamburger { display: flex; }

  /* Lang switcher: desativa :hover (fica grudado em touch), só JS controla via .open */
  .header-lang-switcher:hover .lang-dropdown { display: none !important; }
  .header-lang-switcher.open .lang-dropdown  { display: block !important; }

  /* Lang switcher — branco, à esquerda do hamburger */
  .header-lang-switcher--bottom {
    display: flex !important;
    margin-left: auto;
    margin-right: 8px;
    padding-right: 0;
    border-right: 0;
  }
  .header-lang-switcher--bottom .lang-current { color: var(--white); }
  .header-lang-switcher--bottom .lang-current svg path { stroke: var(--white); }
  .header-lang-switcher--bottom .lang-current:hover { background: rgba(255,255,255,.14); }

  /* Scroll frosted glass (mobile) */
  .site-header.scrolled-mobile {
    background: rgba(248,248,248,.88) !important;
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    box-shadow: 0 1px 0 rgba(0,0,0,.1) !important;
    transition: background .3s ease, box-shadow .3s ease !important;
  }
  .site-header.scrolled-mobile .header-bottom { background: transparent !important; border-bottom: none !important; }
  .site-header.scrolled-mobile .nav-hamburger span { background: var(--gray11) !important; }
  .site-header.scrolled-mobile .header-lang-switcher--bottom .lang-current { color: var(--gray11) !important; }
  .site-header.scrolled-mobile .header-lang-switcher--bottom .lang-current svg path { stroke: var(--gray11) !important; }
  .site-header.scrolled-mobile .header-bottom-logo .logo-mobile  { display: none !important; }
  .site-header.scrolled-mobile .header-bottom-logo .logo-desktop { display: block !important; height: 46px !important; width: auto !important; filter: none !important; }

  /* Menu aberto: header sólido branco, logo colorida, hamburger vira X vermelho */
  .site-header.menu-open {
    background: var(--white) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.15) !important;
  }
  .site-header.menu-open .header-bottom { background: var(--white) !important; border-bottom: 3px solid var(--gray4) !important; }
  .site-header.menu-open .nav-hamburger span { background: var(--red) !important; }
  .site-header.menu-open .header-lang-switcher--bottom .lang-current { color: var(--gray11) !important; }
  .site-header.menu-open .header-lang-switcher--bottom .lang-current:hover { background: rgba(0,0,0,.05) !important; }
  .site-header.menu-open .header-bottom-logo .logo-mobile  { display: none !important; }
  .site-header.menu-open .header-bottom-logo .logo-desktop { display: block !important; height: 46px !important; width: auto !important; filter: none !important; }

  /* Menu mobile aberto — estilo original (fundo branco, texto escuro, alinhado a esquerda) */
  .header-main-menu.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #ffffff;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    animation: mobileMenuIn 0.22s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
  }

  @keyframes mobileMenuIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .header-main-menu.mobile-open {
    align-items: stretch !important;
  }
  .header-main-menu.mobile-open > li {
    border-bottom: 1px solid #eee;
    width: 100%;
  }

  .header-main-menu.mobile-open > li > a {
    padding: 18px 24px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #1a1a1a !important;
    border-radius: 0;
    background: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  /* Seta chevron preta a direita nos itens com sub-menu */
  .header-main-menu.mobile-open > li > a .menu-arrow,
  .header-main-menu.mobile-open > li > a img {
    filter: brightness(0);
    margin-left: auto;
  }
  .header-main-menu.mobile-open > li > a .arrow path {
    stroke: #333 !important;
  }
  .header-main-menu.mobile-open > li > a .arrow {
    width: 12px;
    height: 8px;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Sub-menus mobile: fundo cinza claro */
  /* Neutraliza hover do desktop (especificidade maior que .sub-menu hover) */
  .header-main-menu.mobile-open > li:hover > .sub-menu { display: none; }
  .header-main-menu.mobile-open .sub-menu li.has-flyout:hover > .flyout-menu { display: none; }
  .header-main-menu.mobile-open .sub-menu {
    display: none;
    position: static; box-shadow: none;
    background: #f5f5f5;
    border-radius: 0; padding: 4px 0;
    animation: mobileMenuIn 0.15s ease;
  }
  /* mob-open com !important para ganhar de qualquer hover residual */
  .header-main-menu.mobile-open li.mob-open > .sub-menu { display: block !important; }
  .header-main-menu.mobile-open .sub-menu li a {
    color: #333 !important;
    padding: 12px 36px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #e8e8e8;
  }
  .header-main-menu.mobile-open .sub-menu li a:hover {
    background: var(--red) !important; color: var(--white) !important; font-weight: 700 !important;
  }
  .header-main-menu.mobile-open .sub-menu li:last-child a { border-bottom: none; }

  /* --- MOBILE SECONDARY MENU (Empresa, Contato, PEAD, Reciclagem, WhatsApp, Busca) --- */
  .mobile-secondary-menu {
    display: none;
  }
  .mobile-secondary-menu.visible {
    display: block;
    position: static;
    background: #f0f0f0;
    padding: 0;
    box-shadow: none;
  }
  .mobile-sec-divider {
    height: 1px; background: #ddd; margin: 0;
  }
  .mobile-secondary-menu ul {
    list-style: none; padding: 0; margin: 0;
  }
  .mobile-secondary-menu > ul > li {
    border-bottom: 1px solid #ddd;
  }
  .mobile-secondary-menu > ul > li > a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; font-size: 13px; font-weight: 700;
    color: #333; text-transform: uppercase; letter-spacing: 0.5px;
  }
  .mobile-secondary-menu .arrow {
    width: 10px; height: 6px; transition: transform 0.2s;
  }
  .mobile-secondary-menu .has-sub.open .arrow { transform: rotate(180deg); }
  .mobile-secondary-menu .mobile-sub {
    display: none; background: #e8e8e8; padding: 0;
  }
  .mobile-secondary-menu .has-sub.open .mobile-sub { display: block; }
  .mobile-secondary-menu .mobile-sub li a {
    display: block; padding: 10px 36px; font-size: 13px;
    color: #333; border-bottom: 1px solid #ddd; font-weight: 400;
  }
  .mobile-secondary-menu .mobile-sub li:last-child a { border-bottom: none; }
  .mobile-secondary-menu .mobile-sub li a:hover {
    background: var(--red); color: var(--white);
  }
  .mobile-sec-icons {
    display: flex; align-items: center; justify-content: center;
    gap: 24px; padding: 16px 24px;
    border-top: 1px solid #ddd; background: #e8e8e8;
  }
  .mobile-sec-icons a,
  .mobile-search-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--red); color: var(--white);
    border: none; cursor: pointer; padding: 0;
  }
  .mobile-sec-icons .icon-svg { width: 20px; height: 20px; fill: currentColor; }

  /* --- BRANDT STRIP menor --- */
  .brandt-strip { height: auto; padding: 8px 0; overflow: visible; }
  .brandt-strip .container { flex-wrap: wrap; justify-content: center; gap: 0; }
  .brandt-strip p { font-size: 13px; letter-spacing: 0; line-height: 1.2; white-space: normal; text-align: center; overflow: visible; text-overflow: clip; }
  .brandt-strip strong { font-size: 13px; }

  /* --- HERO --- */
  /* Preenche a viewport mobile igual Apple: vídeo claro no topo, overlay só embaixo no texto */
  /* Vídeo mobile é 720×720 (quadrado); object-fit:cover encaixa a altura (480px) e corta só as laterais → frame completo na vertical, centrado */
  .hero-video-section { height: 570px; max-height: none; }
  /* Gradiente duplo: escuro no topo (legibilidade do header) + escuro no rodapé (texto) */
  .hero-video-overlay { background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.08) 22%, transparent 42%, rgba(0,0,0,.55) 78%, rgba(0,0,0,.72) 100%); }
  .hero-video-content h1 { font-size: 28px; letter-spacing: -0.3px; }
  .hero-video-content { padding: 0 20px 52px; }
  .hero .hero-content { padding: 52px 24px 28px !important; text-align: center; }
  .hero-tag { margin-top: 0; margin-bottom: 8px; }
  /* Subtítulo do hero de páginas internas: limitar a 2 linhas no mobile */
  .hero-content p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Espaço entre hero e primeiro conteúdo do body */
  .cat-landing { padding-top: 24px !important; }
  .fi-section { padding: 10px 0 5px !important; }
  .tool-main-section { padding-top: 24px !important; }
  /* Breadcrumb oculto no mobile: compensar espaçamento nas páginas de solução */
  .product-overview { padding-top: 24px !important; padding-bottom: 12px !important; }

  /* --- PÁGINAS DE SOLUÇÃO (single-segmento) --- */
  /* overview-grid: gap 10px entre imagem e texto quando empilhados */
  .overview-grid { gap: 10px; }
  /* Parágrafos do contexto com mais respiro */
  .overview-desc p { margin-bottom: 16px; line-height: 1.7; }
  .overview-desc p:last-child { margin-bottom: 0; }
  /* Barra de números: reduz padding para encolher espaço entre seções */
  .segment-numbers { padding: 24px 0 !important; }
  /* Tabela de soluções: menos espaço acima */
  .specs-section { padding-top: 16px !important; }
  /* Desafios e Soluções: 2 colunas × N linhas em vez de 4 em linha */
  .advantages-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .advantage-card { padding: 16px 12px; }
  /* Problema/Solução (produto) e "Como Aplicamos" de /segmento/ — 1fr por linha.
     /solucoes/ usa .method-grid (assets/css/pages/responsive.css), não este seletor. */
  .pas-grid { grid-template-columns: 1fr !important; }

  /* --- SEGMENTOS: 2x2 (4 cards), esconde o 5o --- */
  .segments-section { padding: 0; }
  .segments-grid { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .segment-card { height: 220px; }
  .segment-card:nth-child(5) { display: none; }
  .segment-card-overlay { padding: 14px 16px; }
  .segment-card-overlay h2,
  .segment-card-overlay h3 { font-size: 16px !important; margin-bottom: 0; }
  .segment-card-overlay p { display: none; }
  /* Tag: estilo hero-tag — pill vermelho sólido, sem glass/borda */
  .segment-tag {
    font-size: 9px !important; letter-spacing: 2px !important; padding: 3px 10px; margin-bottom: 8px;
    background: rgba(238,49,36,.9) !important; color: #fff !important;
    border: none !important; border-radius: 50px !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  }
  /* Desativa todos os efeitos hover — touch não tem hover real */
  .segment-card:hover { box-shadow: none; }
  .segment-card:hover img { transform: none !important; filter: brightness(0.92) !important; }
  .segment-card:hover .segment-card-overlay { background: linear-gradient(175deg, transparent 0%, rgba(0,0,0,.1) 45%, rgba(0,0,0,.6) 100%) !important; }
  .segment-card:hover .segment-tag { background: rgba(238,49,36,.9) !important; color: #fff !important; border: none !important; }
  .segment-card-overlay .segment-link { display: none; }

  /* --- HISTORIA: carrossel horizontal com scroll snap --- */
  .history-section {
    padding: 32px 0 24px;
    position: relative;  /* âncora para o fade e a seta */
  }
  /* Fade gradiente na borda direita indicando que há mais cards */
  .history-section::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 72px;
    background: linear-gradient(to right, transparent, #f8f9fa 85%);
    pointer-events: none;
    z-index: 2;
  }
  /* Seta ">" sobre o fade */
  .history-section::before {
    content: '›';
    position: absolute;
    right: 10px;
    bottom: 42px;          /* alinhada verticalmente com os cards */
    font-size: 28px;
    line-height: 1;
    color: var(--red);
    font-weight: 700;
    z-index: 3;
    pointer-events: none;
    animation: hist-bounce 1.4s ease-in-out infinite;
  }
  @keyframes hist-bounce {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50%       { transform: translateX(4px); opacity: 0.6; }
  }
  .history-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 0 24px 16px;
    margin: 0 -24px;
    scrollbar-width: none;
  }
  .history-grid::-webkit-scrollbar { display: none; }
  .history-card {
    min-width: 48vw;
    max-width: 200px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .history-card-img { height: 90px; }

  /* --- DIFERENCIAIS: 2 colunas compactas ---
     Atualizado 02/08/2026 junto com a virada para blocos vermelhos sólidos: sem
     descrição, o alinhamento vertical passa a ser center também aqui (esta regra
     redeclarava flex-start e desfaria o desktop no mobile), o badge de ícone deixa
     de existir, e a regra de .diferencial-text p sai porque o <p> não é mais
     renderizado. Especificidade mantida idêntica à de sections-home.css — subir
     para .diferenciais-grid h3 venceria em TODOS os breakpoints e estouraria os
     títulos longos em 375px. */
  .diferenciais-section { padding: 32px 0 24px; }
  .diferenciais-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .diferencial-card { padding: 13px 14px; gap: 10px; align-items: center; border-radius: 12px; }
  .diferencial-icon { width: 22px; height: 22px; border-radius: 0; flex-shrink: 0; }
  .diferencial-icon svg { width: 100%; height: 100%; }
  .diferencial-text h3 { font-size: 13px; margin-bottom: 0; }

  /* --- NUMEROS --- */
  .numbers-section { padding: 36px 0; }
  .numbers-section .numbers-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
  .number-item .number { font-size: 30px; }
  .number-item .label { font-size: 11px; }

  /* --- SOLUCOES --- */
  .solutions-section { padding: 32px 0 24px; }
  .solution-card { flex-direction: column; }
  .solution-card-img { width: 100%; min-height: 160px; max-height: 200px; }
  .solution-card-body { padding: 20px 18px; }
  .solution-card-body h3 { font-size: 17px; }
  .solutions-section .section-header h2 { display: block; text-align: center; }
  .solutions-section .section-header h2 .marker { display: none; }
  .solution-card:nth-child(n+3) { display: none; }

  /* --- SOBRE --- */
  .about-section { padding: 32px 0 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 0; }
  .about-image { display: none; }
  .about-text p:nth-of-type(n+2) { display: none; }

  /* --- ARTIGOS --- */
  .articles-section { padding: 32px 0 24px; }
  .articles-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .article-card:nth-child(n+3) { display: none; }

  /* --- SECTION HEADERS --- */
  .section-header h2 { font-size: 22px; }
  .section-header { margin-bottom: 20px; }

  /* --- FOOTER --- */
  .footer-logo-small { height: 75px; }
  .footer-col:first-child { text-align: center; }
  .footer-col:first-child .footer-logo-small { margin: 0 auto; }
  .footer-col:first-child .footer-social { justify-content: center; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; padding-top: 32px; }
  .footer-bottom__row { flex-direction: column; text-align: center; gap: 6px; }

  /* Accordion de Unidades e Produtos (cada um independente) */
  .footer-sub__toggle { cursor: pointer; }
  .footer-sub__toggle .footer-col__chevron { display: block; }
  .footer-sub + .footer-sub { margin-top: 8px; }
  .footer-sub--collapsible .footer-sub__body { max-height: 0; transition: max-height .3s ease; }
  .footer-sub--collapsible.is-open .footer-sub__body { max-height: 400px; }
  .footer-sub--collapsible.is-open .footer-col__chevron { transform: rotate(180deg); }
  .footer-sub__toggle { margin-bottom: 0; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .footer-sub--collapsible.is-open .footer-sub__toggle { border-bottom-color: transparent; }
}

@media (max-width: 480px) {
  .hero-video-content h1 { font-size: 24px; }
  .number-item .number { font-size: 26px; }
  .history-card { min-width: 48vw; max-width: 190px; }
  .solution-card-body h3 { font-size: 16px; }
  .articles-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .segment-card { height: 180px; }
  .segment-card-overlay h2,
  .segment-card-overlay h3 { font-size: 16px !important; }
}
