/* ════════════════════════════════════════════════════════════════
   Componentes compartidos: Header (navbar + mobile menu) y Footer
   Usado por todas las páginas a través de partials/ + components.js
   ════════════════════════════════════════════════════════════════ */

:root { --header-h: 145px; }

/* ─── Header ─── */
.header {
  background: var(--navy);
  height: var(--header-h, 145px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 80px 0 90px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border-radius: 4px;
  transition: background 0.18s ease;
  z-index: 71;
  border: none;
  cursor: pointer;
}
.hamburger:hover { background: rgba(255,255,255,0.08); }
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--white, #FFFFFF);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 60; opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-menu {
  display: none;
  position: fixed; top: 0; right: 0;
  width: min(85vw, 340px);
  height: 100vh;
  background: var(--navy);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(.2,.7,.3,1);
  flex-direction: column;
  padding: 88px 36px 32px;
  box-shadow: -10px 0 30px rgba(0,0,0,0.3);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu .mobile-logo { position: absolute; top: 24px; left: 28px; }
.mobile-menu .mobile-logo img { height: 48px; width: auto; display: block; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mobile-menu nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 19px;
  color: var(--offwhite, #F1F2F6);
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.18s ease, padding-left 0.18s ease;
  text-decoration: none;
}
.mobile-menu nav a:hover, .mobile-menu nav a.active {
  color: var(--orange, #F45D00);
  padding-left: 8px;
}

.header .logo { display: flex; align-items: center; cursor: pointer; }
.header .logo-img { height: 73px; width: auto; display: block; }

.nav {
  display: flex;
  gap: 56px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.nav a {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  color: var(--offwhite, #F1F2F6);
  position: relative;
  padding: 6px 2px;
  transition: color 0.18s ease;
  text-decoration: none;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--orange, #F45D00);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}
.nav a.active::after, .nav a:hover::after { transform: scaleX(1); }
.nav a:hover { color: var(--white, #FFFFFF); }

/* ─── Footer ─── */
.footer {
  background: var(--navy);
  color: var(--white, #FFFFFF);
  padding: 72px 90px 48px;
  position: relative;
}
.footer * { color: var(--white, #FFFFFF); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 80px;
  max-width: 1180px;
  margin: 0 auto;
}
.footer .logo-img { height: 64px; }
.footer-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  color: var(--offwhite, #F1F2F6);
  line-height: 1.5;
  margin: 18px 0 32px;
}
.footer-contact { display: flex; flex-direction: column; gap: 16px; }
.footer-contact a {
  display: flex; align-items: center; gap: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  color: var(--offwhite, #F1F2F6);
  transition: color 0.18s ease;
  text-decoration: none;
}
.footer-contact a:hover { color: var(--orange, #F45D00); }
.footer-contact .ico {
  width: 22px; height: 22px;
  color: var(--orange, #F45D00);
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-contact .ico svg { width: 100%; height: 100%; fill: currentColor; }

.footer-col h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 19px;
  color: var(--offwhite, #F1F2F6);
  margin: 0 0 24px;
}
.footer-col ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.footer-col a {
  font-family: 'Montserrat', sans-serif;
  font-size: 14.5px;
  color: var(--offwhite, #F1F2F6);
  transition: color 0.18s ease, padding-left 0.18s ease;
  display: inline-block;
  text-decoration: none;
}
.footer-col a:hover { color: var(--orange, #F45D00); padding-left: 4px; }

.footer-bottom {
  max-width: 1180px;
  margin: 56px auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(241, 242, 246, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.copyright {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: var(--offwhite, #F1F2F6);
  opacity: 0.75;
}
.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(241, 242, 246, 0.12);
  color: var(--offwhite, #F1F2F6);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
  text-decoration: none;
}
.footer-socials a:hover { background: var(--orange, #F45D00); transform: translateY(-2px); }
.footer-socials svg { width: 21px; height: 21px; fill: currentColor; }

.scroll-top {
  position: absolute;
  right: 90px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  background: var(--orange, #F45D00);
  color: var(--white, #FFFFFF) !important;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  transition: background 0.18s ease, transform 0.18s ease;
  border: none;
  cursor: pointer;
}
.scroll-top:hover { background: var(--orange-hover, #d65200); transform: translateY(-50%) scale(1.08); }
.scroll-top svg { width: 14px; height: 14px; fill: currentColor; }

/* ─── Responsive ─── */
@media (min-width: 1920px) {
  :root { --header-h: 160px; }
  .header { padding: 0 160px; height: 160px; }
  .nav a { font-size: 24px; }
  .footer { padding: 100px 160px 64px; }
  .footer-grid { max-width: 1600px; }
  .scroll-top { right: 160px; }
}

@media (max-width: 1280px) {
  .header { padding: 0 56px; }
  .nav { gap: 32px; }
  .nav a { font-size: 19px; }
  .footer { padding: 64px 56px 40px; }
  .scroll-top { right: 56px; }
}

@media (max-width: 1024px) {
  :root { --header-h: 120px; }
  .header { height: 120px; padding: 0 40px; }
  .nav { gap: 28px; }
  .nav a { font-size: 18px; }
  .footer { padding: 56px 40px 36px; }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; }
  .scroll-top { right: 40px; }
}

@media (max-width: 820px) {
  :root { --header-h: 90px; }
  .header { height: 90px; padding: 0 24px; gap: 14px; }
  .header .logo-img { height: 52px !important; width: auto !important; }
  .nav { display: none; }
  .hamburger { display: flex; }
  .mobile-overlay, .mobile-menu { display: flex; }
  body.menu-open { overflow: hidden; }

  .footer { padding: 48px 28px 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 18px; align-items: flex-start; }
  .scroll-top {
    position: fixed; right: 20px; bottom: 20px; top: auto;
    transform: none; width: 46px; height: 46px;
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.4);
    z-index: 60;
  }
  .scroll-top:hover { transform: scale(1.08); }
}

@media (max-width: 560px) {
  :root { --header-h: 80px; }
  .header { padding: 0 18px; height: 80px; }
  .header .logo-img { height: 44px !important; }
  .footer { padding: 40px 20px 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid > div:first-child { grid-column: auto; }
  .scroll-top { right: 14px; bottom: 14px; }
}

@media (max-width: 480px) {
  :root { --header-h: 72px; }
  .header { padding: 0 16px; height: 72px; }
  .header .logo-img { height: 40px !important; }
  .hamburger { width: 40px; height: 40px; }

  .footer { padding: 32px 18px 24px; }
  .footer-grid { gap: 26px; }
  .footer .logo-img { height: 52px !important; }
  .footer-tag { font-size: 13px; margin: 14px 0 22px; }
  .footer-contact a { font-size: 13.5px !important; }
  .footer-col h4 { font-size: 16px; margin-bottom: 18px; }
  .footer-col a { font-size: 13.5px !important; }
  .footer-bottom { margin-top: 36px; padding-top: 22px; }
  .footer-socials a { width: 40px; height: 40px; }
  .footer-socials svg { width: 18px; height: 18px; }
  .copyright { font-size: 10.5px; }
}
