/* ============================================================
   YELLOW ENERGY — Header & Footer Styles
   ============================================================ */

/* ====== HEADER ====== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 14px 0;
  transition: all .35s ease;
  background: transparent;
}

.site-header.scrolled {
  background: var(--yellow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 0;
  box-shadow: 0 2px 20px rgba(245,193,14,.4);
}

/* Links ficam pretos quando header é amarelo */
.site-header.scrolled .nav-left a,
.site-header.scrolled .nav-right a:not(.btn):not(.btn-header-link) {
  color: var(--black);
}
.site-header.scrolled .nav-left a:hover,
.site-header.scrolled .nav-right a:not(.btn):not(.btn-header-link):hover,
.site-header.scrolled .nav-left a.active,
.site-header.scrolled .nav-right a.active {
  color: var(--black);
  background: rgba(0,0,0,.1);
}
.site-header.scrolled .btn-header-link {
  color: rgba(0,0,0,.7) !important;
}
.site-header.scrolled .btn-header-link:hover {
  color: var(--black) !important;
  background: rgba(0,0,0,.08) !important;
}
.site-header.scrolled .btn-cta-header {
  background: var(--black);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.site-header.scrolled .btn-cta-header:hover {
  background: var(--dark2);
}
.site-header.scrolled .mobile-toggle span {
  background: var(--black);
}
.site-header.scrolled .dropdown {
  background: var(--dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.header-logo {
  flex-shrink: 0;
  transition: transform .3s ease;
}
.header-logo:hover { transform: scale(1.04); }
.header-logo img {
  width: 160px;
  height: auto;
  /* Logo branca e nítida no header transparente, sem brilho */
  filter: brightness(0) invert(1);
  transition: filter .35s ease, transform .3s ease;
}
.header-logo:hover img {
  filter: brightness(0) invert(1);
}
/* Quando scrollado (fundo amarelo), logo volta à cor original */
.site-header.scrolled .header-logo img {
  filter: brightness(1) invert(0);
}

/* Nav shared */
.nav-left,
.nav-right {
  flex: 1;
}
.nav-left { display: flex; justify-content: flex-end; }
.nav-right { display: flex; justify-content: flex-start; }

.nav-left ul,
.nav-right ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-left a,
.nav-right a:not(.btn):not(.btn-header-link) {
  color: var(--white);
  font-size: .88rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-left a:hover,
.nav-right a:not(.btn):not(.btn-header-link):hover,
.nav-left a.active,
.nav-right a.active {
  color: var(--yellow);
  background: rgba(245,193,14,.1);
}

/* Área do Cliente link */
.btn-header-link {
  color: rgba(255,255,255,.8) !important;
  font-size: .85rem !important;
  font-weight: 500 !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  transition: var(--transition) !important;
  white-space: nowrap;
}
.btn-header-link:hover {
  color: var(--yellow) !important;
  background: rgba(245,193,14,.1) !important;
}

/* CTA button in header */
.btn-cta-header {
  font-size: .85rem !important;
  padding: 10px 20px !important;
}

/* Dropdown */
.has-dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 0px); /* sem gap para o mouse transitar sem perder o hover */
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--dark);
  border: 1px solid rgba(245,193,14,.15);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 4px 8px 8px; /* padding-top menor: área de buffer */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

/* Pseudo-elemento bridge: preenche o gap entre link e dropdown */
.has-dropdown > a::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 16px;
  bottom: -16px;
  background: transparent;
}

.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown li a {
  display: block !important;
  padding: 10px 16px !important;
  border-radius: 8px !important;
  font-size: .88rem !important;
  color: rgba(255,255,255,.85) !important;
  background: none !important;
  white-space: nowrap;
}
.dropdown li a:hover {
  color: var(--yellow) !important;
  background: rgba(245,193,14,.1) !important;
}

/* Dropdown arrow indicator */
.has-dropdown > a svg {
  transition: transform .25s ease;
}
.has-dropdown:hover > a svg { transform: rotate(180deg); }

/* Header scrolled — ajustes no dropdown arrow e SVG */
.site-header.scrolled .has-dropdown > a svg {
  stroke: var(--black);
}
.site-header.scrolled .has-dropdown:hover > a { color: var(--black) !important; }

/* Mobile toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.mobile-toggle span {
  width: 26px; height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: all .3s ease;
  transform-origin: center;
}
.mobile-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Mobile menu — oculto por padrão, só abre via toggle */
.mobile-menu {
  display: none;           /* escondido no desktop */
  background: var(--dark);
  border-top: 1px solid rgba(245,193,14,.15);
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
  /* Nunca aparece ao rolar: sempre precisa do .open */
  pointer-events: none;
  opacity: 0;
  transition: max-height .4s ease, opacity .3s ease, padding .3s ease;
}
.mobile-menu.open {
  max-height: 700px;
  padding: 16px 24px 24px;
  pointer-events: all;
  opacity: 1;
}

.mobile-menu ul li a,
.mobile-menu ul li summary {
  display: block;
  padding: 12px 0;
  color: rgba(255,255,255,.85);
  font-size: .95rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.mobile-menu ul li a:hover { color: var(--yellow); }
.mobile-menu details ul {
  padding-left: 16px;
}
.mobile-menu details summary { cursor: pointer; list-style: none; }
.mobile-menu details summary::-webkit-details-marker { display: none; }

/* Botão CTA dentro do mobile menu — alinhado e centralizado */
.mobile-menu .btn-primary {
  display: flex !important;
  width: 100% !important;
  justify-content: center !important;
  margin-top: 12px !important;
  padding: 14px 20px !important;
  font-size: .95rem !important;
  border-radius: 12px !important;
  text-align: center;
}

@media (max-width: 900px) {
  .nav-left, .nav-right { display: none; }
  .mobile-toggle { display: flex; }
  /* mobile-menu: bloco visível mas com overflow hidden + opacity 0 */
  .mobile-menu { display: block; }
}

/* ====== FOOTER ====== */
.site-footer {
  background: var(--white);
  color: var(--dark);
  margin-top: auto;
  border-top: 1px solid #e5e7eb;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding: 72px 0 48px;
}

.footer-brand img { margin-bottom: 16px; }
.footer-brand p   { color: var(--gray); font-size: .92rem; line-height: 1.7; margin-bottom: 20px; }

.footer-social {
  display: flex;
  gap: 12px;
}
.footer-social a {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gray-light);
  color: var(--dark);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--yellow); color: var(--black); }
.footer-social svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.footer-links h4 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 16px;
  font-weight: 700;
}
.footer-links ul li {
  margin-bottom: 10px;
}
.footer-links ul li a {
  color: var(--gray);
  font-size: .9rem;
  transition: var(--transition);
}
.footer-links ul li a:hover { color: var(--yellow-dark); padding-left: 4px; }

.footer-contact h4 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 16px;
  font-weight: 700;
}
.footer-contact p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--gray);
  font-size: .9rem;
  margin-bottom: 10px;
}
.footer-contact p svg {
  fill: none;
  stroke: var(--yellow-dark);
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  border-top: 1px solid #e5e7eb;
  padding: 24px 0;
  background: var(--gray-light);
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-bottom p { color: var(--gray); font-size: .85rem; }
.footer-bottom strong { color: var(--yellow-dark); }
.footer-bottom-center { display: flex; align-items: center; justify-content: center; }
.footer-selo {
  height: 52px;
  width: auto;
  object-fit: contain;
  opacity: .85;
  transition: opacity .3s ease;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.12));
}
.footer-selo:hover { opacity: 1; }

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}
