/**
 * ====================================================================
 * GRUPO JVITTI - GLOBAL STYLES (v5.0 Production)
 * ====================================================================
 * Finalidade: Estilos globais, variáveis CSS, componentes reutilizáveis
 * Responsável: Tecnologia da Informação
 * Autor: Hudson R. Silva
 * Data: 2026-01-26
 * Última Atualização: 2026-01-26 (Adicionado JVitti Agro)
 * ====================================================================
 */

/* ============================================================
   1. VARIÁVEIS CSS - DESIGN SYSTEM
   ============================================================ */
:root {
  /* Cores Institucionais Principais */
  --jvitti-verde-escuro: #04433c;
  --jvitti-verde-deep: #021a17;
  --jvitti-dourado: #a88f4f;
  --jvitti-dourado-hover: #c9aa5f;

  /* Cores das Subsidiárias */
  --goiascal-verde: #18634b;
  --goiascal-amarelo: #f3b722;
  --goiasfiller-primary: #1e614d;
  --goiasfiller-secondary: #a88f4f;
  --agrocal-primary: #34605c;
  --agrocal-secondary: #f48c3c;
  --primacal-verde: #04433c;
  --primacal-dourado: #eac65b;
  --jvittiagro-primary: #1a4a36;
  --jvittiagro-secondary: #cca760;

  /* Cores Base do Sistema */
  --primary-color: var(--jvitti-verde-escuro);
  --secondary-color: var(--jvitti-dourado);
  --text-main: #333333;
  --text-light: #666666;
  --text-white: #ffffff;
  --bg-light: #f8f8f8;
  --bg-dark: #eeeeee;
  --border-color: #dddddd;

  /* Tipografia */
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Open Sans", sans-serif;
}

/* ============================================================
   2. RESET E NORMALIZAÇÃO
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--text-white);
  -webkit-font-smoothing: antialiased;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* ============================================================
   3. TIPOGRAFIA
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--jvitti-verde-deep);
  margin-bottom: 0.8em;
  line-height: 1.2;
}

h1 {
  font-size: 2.8rem;
  font-weight: 700;
}

h2 {
  font-size: 2.2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5em;
}

h3 {
  font-size: 1.6rem;
  font-weight: 500;
}

p {
  margin-bottom: 1rem;
  text-align: justify;
}

p1 {
  margin-bottom: 1rem;
  text-align: center;
}

/* ============================================================
   4. CONTAINER E LAYOUT
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ============================================================
   5. COMPONENTES - BOTÕES
   ============================================================ */
.btn,
.btn-secundario,
.btn-outline {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

/* Botão Primário - Verde */
.btn {
  background-color: var(--primary-color);
  color: var(--text-white);
  border: 2px solid var(--primary-color);
}

.btn:hover {
  background-color: #033530;
  border-color: #033530;
}

/* Botão Secundário - Dourado */
.btn-secundario {
  background-color: var(--secondary-color);
  color: var(--text-white);
  border: 2px solid var(--secondary-color);
}

.btn-secundario:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Botão Outline - Transparente com borda */
.btn-outline {
  background-color: transparent;
  border: 2px solid var(--text-white);
  color: var(--text-white);
}

.btn-outline:hover {
  background-color: var(--text-white);
  color: var(--jvitti-verde-escuro);
}

/* ============================================================
   6. HEADER GLOBAL
   ============================================================ */
header {
  background-color: var(--text-white);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

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

.logo-img {
  height: 50px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.02);
}

/* Navegação */
header nav ul {
  display: flex;
  gap: 25px;
  align-items: center;
}

header nav ul li a {
  color: var(--text-main);
  font-weight: 500;
  padding: 5px 0;
  position: relative;
  font-size: 0.95rem;
}

/* Efeito underline nos links (exceto botões) */
header nav ul li a:not(.btn)::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  bottom: 0;
  left: 0;
  transition: width 0.3s ease;
}

header nav ul li a:not(.btn):hover::after {
  width: 100%;
}

header nav ul li a:not(.btn):hover {
  color: var(--primary-color);
}

/* ============================================================
   6.1 MENU DROPDOWN (Produtos)
   - Desktop: hover + submenus laterais
   - Mobile: acordeão via classe .active (JS)
   ============================================================ */

/* -------- Desktop (>= 769px) -------- */
@media (min-width: 769px) {
  header nav ul li.dropdown {
    position: relative;
  }

  .dropdown-toggle i {
    font-size: 0.7em;
    margin-left: 5px;
    transition: transform 0.3s ease;
  }

  header nav ul li.dropdown:hover .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
  }

  /* Dropdown principal */
  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--text-white);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--jvitti-dourado);
    border-radius: 0 0 5px 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    z-index: 9999;
  }

  header nav ul li.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Itens do dropdown */
  .dropdown-menu li {
    width: 100%;
    border-bottom: 1px solid var(--bg-dark);
  }

  .dropdown-menu li:last-child {
    border-bottom: none;
  }

  .dropdown-menu li a {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    width: 100%;
  }

  .dropdown-menu li a:hover {
    background-color: var(--bg-light);
    color: var(--jvitti-verde-escuro);
    padding-left: 25px;
  }

  .dropdown-menu li a::after {
    display: none;
  }

  /* Sub-dropdown (cascata lateral) */
  .dropdown-sub {
    position: relative;
  }

  .dropdown-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    background-color: var(--text-white);
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-left: 3px solid var(--jvitti-verde-escuro);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    padding: 10px 0;
    display: block;
  }

  .dropdown-sub:hover > .dropdown-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }

  .dropdown-sub:hover > a {
    color: var(--jvitti-dourado);
    background-color: var(--bg-light);
  }
}

/* ============================================================
   7. SCROLLBAR CUSTOMIZADA
   ============================================================ */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--jvitti-verde-escuro);
}

::-webkit-scrollbar-thumb {
  background-color: var(--jvitti-dourado);
  border-radius: 6px;
  border: 3px solid var(--jvitti-verde-escuro);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--jvitti-dourado-hover);
}

/* ============================================================
   8. BOTÕES FLUTUANTES (WhatsApp & Back to Top)
   ============================================================ */
.floating-buttons {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 9999;
  align-items: center;
}

.btn-float {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-size: 1.4rem;
  position: relative;
}

.btn-float:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Botão WhatsApp */
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: var(--text-white);
  font-size: 32px;
  animation: pulse-whatsapp 2s infinite;
}

@keyframes pulse-whatsapp {
  0%,
  100% {
    box-shadow:
      0 6px 20px rgba(0, 0, 0, 0.2),
      0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  50% {
    box-shadow:
      0 6px 20px rgba(0, 0, 0, 0.2),
      0 0 0 15px rgba(37, 211, 102, 0);
  }
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
}

/* Pulse Ring (anel pulsante do WhatsApp) */
.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid #25d366;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  opacity: 0;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Botão Voltar ao Topo */
.btn-top {
  background: linear-gradient(
    135deg,
    var(--jvitti-verde-escuro) 0%,
    var(--jvitti-verde-deep) 100%
  );
  color: var(--text-white);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.btn-top.show {
  opacity: 1;
  visibility: visible;
}

.btn-top:hover {
  background: linear-gradient(
    135deg,
    var(--jvitti-dourado) 0%,
    var(--jvitti-dourado-hover) 100%
  );
}

/* ============================================================
   9. MENU WHATSAPP (Dropdown de Seleção)
   ============================================================ */
.whatsapp-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.whatsapp-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 320px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow: hidden;
  z-index: 10000;
}

.whatsapp-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.whatsapp-menu-header {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.close-menu {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-menu:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.whatsapp-menu-list {
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.whatsapp-menu-list li {
  margin-bottom: 8px;
}

.whatsapp-menu-list li:last-child {
  margin-bottom: 0;
}

.whatsapp-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: var(--bg-light);
  border: 2px solid transparent;
}

.whatsapp-item:hover {
  transform: translateX(5px);
  border-color: #25d366;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.whatsapp-item-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.whatsapp-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.whatsapp-item-info strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.whatsapp-item-info span {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Cores específicas por empresa */
.goiascal-item .whatsapp-item-icon {
  background-color: var(--goiascal-verde);
}

.goiascal-item:hover {
  background-color: rgba(24, 99, 75, 0.05);
}

.goiasfiller-item .whatsapp-item-icon {
  background-color: var(--goiasfiller-primary);
}

.goiasfiller-item:hover {
  background-color: rgba(30, 97, 77, 0.05);
}

.agrocal-item .whatsapp-item-icon {
  background-color: var(--agrocal-secondary);
}

.agrocal-item:hover {
  background-color: rgba(244, 140, 60, 0.05);
}

.primacal-item .whatsapp-item-icon {
  background-color: var(--primacal-dourado);
}

.primacal-item:hover {
  background-color: rgba(234, 198, 91, 0.05);
}

.jvittiagro-item .whatsapp-item-icon {
  background-color: var(--jvittiagro-primary);
}

.jvittiagro-item:hover {
  background-color: rgba(26, 74, 54, 0.05);
}

/* ============================================================
   10. FOOTER GLOBAL
   ============================================================ */
footer {
  background-color: var(--jvitti-verde-deep);
  color: rgba(255, 255, 255, 0.8);
  padding: 80px 0 30px;
  font-size: 0.95rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 60px;
}

.footer-section {
  flex: 1;
  min-width: 220px;
}

.footer-section h3 {
  color: var(--jvitti-dourado);
  font-size: 1.2rem;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
  text-align: left;
}

.footer-section h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--jvitti-dourado);
}

.footer-section ul li {
  margin-bottom: 12px;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.footer-section a:hover {
  color: var(--jvitti-dourado);
  padding-left: 5px;
}

.footer-section i {
  color: var(--jvitti-dourado);
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* Botão Ver no Mapa */
.btn-location {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--jvitti-dourado);
  border-radius: 4px;
  color: var(--jvitti-dourado);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 10px;
}

.btn-location:hover {
  background-color: var(--jvitti-dourado);
  color: var(--jvitti-verde-deep) !important;
  padding-left: 20px;
  text-decoration: none;
}

.btn-location:hover i {
  color: var(--jvitti-verde-deep) !important;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   11. MENU MOBILE (Hamburger)
   ============================================================ */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--jvitti-verde-escuro);
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

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

.menu-toggle.open span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* ============================================================
   12. LIGHTBOX (Galeria de Imagens)
   ============================================================ */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 10000;
}

.lightbox-close:hover {
  color: #ccc;
}

/* ============================================================
   13. RESPONSIVIDADE GLOBAL
   ============================================================ */
@media (max-width: 768px) {
  /* Menu Mobile */
  .menu-toggle {
    display: block;
  }

  header nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--text-white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s ease-in-out;
  }

  header nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  header nav ul {
    flex-direction: column;
    padding: 20px 0;
    gap: 0;
  }

  header nav ul li {
    width: 100%;
    border-bottom: 1px solid var(--bg-dark);
  }

  header nav ul li:last-child {
    border: none;
  }

  header nav ul li a {
    display: block;
    padding: 15px;
    text-align: center;
  }

  header nav ul li .btn {
    margin: 15px auto;
    display: table;
  }

  /* ============================================================
     DROPDOWN NO MOBILE (Acordeão)
     - Reaproveita a estrutura do HTML (.dropdown / .dropdown-sub)
     - JS aplica/remove .active
     ============================================================ */

  /* No mobile o dropdown não fica em absolute */
  .dropdown-menu,
  .dropdown-submenu {
    position: static;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none; /* fechado por padrão */
  }

  /* Abre nível 1 */
  .dropdown.active > .dropdown-menu {
    display: block;
  }

  /* Abre nível 2 */
  .dropdown-sub.active > .dropdown-submenu {
    display: block;
  }

  /* Ajuste visual dos itens do dropdown */
  .dropdown-toggle,
  .dropdown-sub > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .dropdown-toggle i {
    transition: transform 0.2s ease;
  }

  .dropdown.active > .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
  }

  .dropdown-sub.active > a i.fa-chevron-right {
    transform: rotate(90deg);
  }

  /* Recuo dos subitens */
  .dropdown-menu li a {
    text-align: left;
    padding: 12px 18px;
  }

  .dropdown-submenu li a {
    padding-left: 35px;
  }

  /* Separadores */
  .dropdown-menu li {
    border-bottom: 1px solid var(--bg-dark);
  }

  .dropdown-submenu li {
    border-bottom: 1px solid var(--bg-dark);
  }

  .footer-content {
    flex-direction: column;
    gap: 40px;
  }

  /* Ajuste botões flutuantes para tablet */
  .floating-buttons {
    bottom: 20px;
    right: 20px;
    gap: 12px;
  }

  .btn-float {
    width: 55px;
    height: 55px;
    min-width: 55px;
    min-height: 55px;
    font-size: 1.1rem;
  }

  .btn-whatsapp {
    font-size: 28px;
  }

  /* WhatsApp Menu - Tablet/Large Mobile */
  .whatsapp-menu {
    width: 300px;
    bottom: 70px;
    right: 0;
  }
}

@media (max-width: 480px) {
  /* Mobile Small */
  .floating-buttons {
    right: 15px;
    bottom: 15px;
  }

  /* Menu WhatsApp Full Responsive */
  .whatsapp-menu {
    width: calc(100vw - 30px);
    max-width: 350px;
    right: 0;
    bottom: 70px;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);
  }

  /* Áreas de toque maiores */
  .whatsapp-item {
    padding: 18px 20px;
  }

  .whatsapp-menu-header {
    padding: 20px;
  }
}
