/* =========================
   HEADER
========================= */
.header {
  background: #1e2a3a;
  padding: 0.7rem 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* classe adicionada por main.js quando a página já deslizou */
.header.is-scrolled {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.header,
.header * {
  box-sizing: border-box;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 3%;
}

.header-brand {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 70px;
  width: auto;
  display: block;
}

/* Menu Desktop */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-desktop a {
  color: #e5e7eb;
  font-size: 1.1rem;
  text-decoration: none;
  font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  position: relative;
  white-space: nowrap;
}

/* Underline animado */
.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #c9b227;
  transition: width 0.3s ease;
}

.nav-desktop a:hover::after,
.nav-desktop a:focus::after,
.nav-desktop a.active::after {
  width: 100%;
}

.nav-desktop a:hover,
.nav-desktop a:focus {
  color: #c9b227;
}

.nav-desktop a.active {
  color: #c9b227;
}

/* Redes Sociais no Header */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-social a:hover {
  transform: translateY(-2px);
}

.header-social a img {
  width: 20px;
  height: 20px;
  filter: brightness(0) saturate(100%) invert(72%) sepia(50%) saturate(500%) hue-rotate(10deg) brightness(92%) contrast(85%);
  transition: filter 0.2s ease;
}

.header-social a:hover img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(55%) saturate(550%) hue-rotate(10deg) brightness(100%) contrast(90%);
}

/* Botão Área Privada */
.header-area-privada {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #c9b227;
  color: #1e2a3a;
  padding: 0.5rem 1.3rem;
  border-radius: 5px;
  text-decoration: none;
  font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.header-area-privada:hover {
  background: #d4be2e;
  transform: translateY(-1px);
}

.header-area-privada svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #1e2a3a;
}

/* =========================
   HAMBÚRGUER
========================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  justify-self: end;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease, background 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background: #c9b227;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background: #c9b227;
}

/* =========================
   MENU MOBILE (CORRIGIDO)
========================= */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #1e2a3a;
  z-index: 999;
  padding: 90px 2.5rem calc(2rem + env(safe-area-inset-bottom)) 2.5rem;
  box-sizing: border-box;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease, visibility 0.3s ease;
  visibility: hidden;
  overflow-y: auto;
}

.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 0.9rem 0;
  margin: 0;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 1.1rem;
  font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.2s ease;
  box-sizing: border-box;
  text-align: left;
}

.mobile-menu a {
  opacity: 0;
  transform: translateX(16px);
}

.mobile-menu.active a {
  opacity: 1;
  transform: none;
  transition: color 0.2s ease, opacity 0.35s ease, transform 0.35s ease;
}

.mobile-menu.active a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.active a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.active a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.active a:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.active a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu.active a:nth-child(6) { transition-delay: 0.3s; }

.mobile-menu a:hover,
.mobile-menu a.active {
  color: #c9b227;
}

.mobile-area-privada {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  color: #c9b227 !important;
  font-weight: 500;
}

.mobile-area-privada svg {
  color: #c9b227;
  flex-shrink: 0;
}

/* =========================
   FOOTER
========================= */
.rg-footer {
  background-color: #243447;
  color: #e5e7eb;
  padding: 4.5rem 3rem 3.5rem;
  border-top: 1px solid #1b2836;
  font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.rg-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 3.5rem;
}

.rg-footer-brand {
  margin-bottom: 1.5rem;
}

.rg-footer-brand h2,
.rg-footer-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.05em;
}

.rg-footer-logo {
  max-width: 220px;
  height: auto;
  display: block;
}

.rg-footer-text {
  font-size: 0.95rem;
  color: #cbd5f5;
  max-width: 380px;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.rg-footer-social {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.rg-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px 0 -10px -10px;
}

.rg-footer-social a img {
  width: 24px;
  height: 24px;
  display: block;
  filter: brightness(0) saturate(100%) invert(79%) sepia(61%) saturate(425%) hue-rotate(360deg) brightness(104%) contrast(96%);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.rg-footer-social a:hover img {
  transform: translateY(-2px);
  filter: brightness(0) saturate(100%) invert(85%) sepia(61%) saturate(425%) hue-rotate(360deg) brightness(106%) contrast(96%);
}

/* Colunas do Footer */
.rg-footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}

.rg-footer-column h4,
.rg-footer-heading {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  color: #f9fafb;
  position: relative;
}

.rg-footer-column h4::after,
.rg-footer-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: #c9b227;
  margin-top: 0.5rem;
  border-radius: 999px;
}

.rg-footer-column a {
  display: block;
  font-size: 0.9rem;
  color: #ffffff;
  text-decoration: none;
  padding: 0.3rem 0;
  margin-bottom: 0.25rem;
  transition: color 0.2s ease;
}

.rg-footer-column a:hover {
  color: #c9b227;
}

/* Secção de Contactos no Footer */
.rg-footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rg-footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  color: #ffffff;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.rg-footer-contact-item a {
  color: inherit;
  text-decoration: none;
}

.rg-footer-contact-item a:hover {
  color: #c9b227;
}

.contact-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 100%;
  height: 100%;
  fill: #c9b227;
}

.rg-footer-contact-item span:last-child {
  flex: 1;
}

/* Footer Bottom */
.rg-footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding-top: 1.8rem;
  border-top: 1px solid #1b2836;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #ffffff;
}

.rg-footer-links {
  display: flex;
  gap: 1.5rem;
}

.rg-footer-links a {
  color: #ffffff;
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.rg-footer-links a:hover {
  color: #c9b227;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
  .rg-footer-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .rg-footer-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    padding: 0 1rem; /* cabeçalho compacto no telemóvel: mais espaço para o conteúdo */
  }

  .nav-desktop {
    display: none;
  }

  .header-social {
    display: none;
  }

  .header-area-privada {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .header-logo {
    height: 50px;
  }
}

@media (max-width: 640px) {
  .rg-footer-links {
    gap: 0.5rem 1.25rem;
  }

  .rg-footer {
    padding: 3.5rem 1.75rem 3rem;
  }

  .rg-footer-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .rg-footer-bottom {
    flex-direction: column;
    gap: 0.9rem;
    text-align: center;
  }

  .rg-footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-logo {
    height: 45px;
  }

  .mobile-menu {
    width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
/* =========================
   TOQUE (telemóvel/tablet): ligações do rodapé com área de toque ≥ 44px
========================= */
@media (max-width: 768px) {
  .rg-footer-column a {
    padding: 0.75rem 0;
    margin-bottom: 0;
  }

  .rg-footer-links a {
    padding: 0.75rem 0;
  }

  .rg-footer-contact-item a {
    display: inline-block;
    padding: 0.6rem 0;
  }
}
