/* ICECO2 - Otimizações Mobile e 4G (VERSÃO FINAL v9 - Tabela Reordenada) */

/* Performance */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tipografia Mobile */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  h1 {
    font-size: 2rem !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.75rem !important;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem !important;
    line-height: 1.4;
  }

  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* --- 1. IMAGENS E VÍDEOS --- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

video {
  max-width: 100%;
}

/* --- 2. FIX NAVBAR MOBILE --- */
@media (max-width: 768px) {

  /* Esconde botões extras */
  header a[href*="wa.me"],
  header a[href*="wa.link"],
  header a[href*="whatsapp"] {
    display: none !important;
  }

  /* Layout Header */
  header .container>div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: auto !important;
    min-height: 80px;
  }

  header button {
    display: block !important;
    margin-left: auto !important;
  }

  .lucide-menu {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
    color: white !important;
  }

  /* Fundo Sólido */
  header {
    background-color: #0f172b !important;
    background-image: none !important;
    backdrop-filter: none !important;
    border-bottom: 1px solid rgba(6, 182, 212, 0.3) !important;
  }

  header nav {
    background-color: #0f172b !important;
    opacity: 1 !important;
    z-index: 50;
  }
}

@media (min-width: 769px) {

  header a[href*="wa.me"],
  header a[href*="wa.link"] {
    display: inline-flex !important;
  }

  header .lucide-menu {
    display: none !important;
  }
}

/* --- 3. LOGOS --- */
header img[src*="header_icon"],
header img[alt="ICECO₂"],
footer img[src*="header_icon"],
footer img[alt="ICECO₂"] {
  display: block !important;
  object-fit: contain !important;
  width: auto !important;
}

@media (max-width: 768px) {

  header img[src*="header_icon"],
  header img[alt="ICECO₂"] {
    max-height: 45px !important;
    max-width: 150px !important;
  }

  footer img[src*="header_icon"],
  footer img[alt="ICECO₂"] {
    max-height: 50px !important;
    margin-bottom: 1rem !important;
  }
}

@media (min-width: 769px) {
  header img[src*="header_icon"] {
    max-height: 60px !important;
  }

  footer img[src*="header_icon"] {
    height: 3rem !important;
  }
}

/* --- 4. GALERIA --- */
button[class*="group"] img,
div[class*="aspect-video"] img,
.pane-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
}

/* --- 5. OUTROS --- */
.fixed.bottom-6.right-6 {
  bottom: 1rem !important;
  right: 1rem !important;
  z-index: 9999 !important;
}

.hero-section,
.hero-video-container {
  background-color: #0A1F3F;
  min-height: 100vh;
  position: relative;
}

[data-hero-video] {
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 0 !important;
}

.before-after-container {
  width: 100% !important;
  display: flex !important;
  gap: 0 !important;
}

@media (max-width: 768px) {
  .before-after-container {
    flex-direction: column !important;
  }
}

@media (min-width: 769px) {
  .before-after-container {
    flex-direction: row !important;
  }
}

.before-after-container .pane {
  position: relative !important;
  flex: 1 1 50% !important;
  overflow: hidden !important;
}

.before-after-container .pane-img {
  position: absolute !important;
  inset: 0 !important;
}

.before-after-container .pane::before {
  content: "";
  display: block;
  padding-bottom: 56.25%;
}

@media (max-width: 767px) {
  .before-after-container .pane::before {
    padding-bottom: 75% !important;
  }
}

/* --- 6. FIX TABELA COMPARATIVA (REORDENADA) --- */

/* Ativa Grid para poder usar 'order' */
.grid.grid-cols-3 {
  display: grid !important;
}

/* REORDENAÇÃO DAS COLUNAS (Aspecto | ICECO2 | Tradicional) */
/* Coluna 1: Aspecto (Mantém) */
.grid.grid-cols-3>div:nth-child(1) {
  order: 1;
}

/* Coluna 3 (ICECO2): Move para o MEIO (Posição 2) */
.grid.grid-cols-3>div:nth-child(3) {
  order: 2;
  border-left: 2px solid rgba(6, 182, 212, 0.3) !important;
  /* Borda destaque */
  border-right: 2px solid rgba(6, 182, 212, 0.3) !important;
}

/* Coluna 2 (Tradicional): Move para o FINAL (Posição 3) */
.grid.grid-cols-3>div:nth-child(2) {
  order: 3;
  border-left: none !important;
}

/* Mobile Scroll */
@media (max-width: 768px) {

  .overflow-x-auto,
  .table-container {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .grid.grid-cols-3 {
    /* Larguras fixas para caber conteúdo */
    grid-template-columns: 140px 200px 200px !important;
    gap: 0 !important;
    width: max-content !important;
  }

  .grid.grid-cols-3>div {
    padding: 1rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .grid.grid-cols-3 {
    grid-template-columns: 1fr 1fr 1fr !important;
    width: 100% !important;
  }
}