:root {
  --brand: #003d3b;
  --brand-600: #01504c;
  --hdr-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --menu-pad: 20px;
  --cta-bar-h: 64px;
}

/* 1. Header Fixes */
.header {
  height: var(--hdr-h);
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

@media (max-width: 767px) {
  body {
    padding-top: calc(var(--hdr-h) + var(--safe-top));
  }
}

.header nav a {
  color: var(--brand) !important;
  font-weight: 700;
  position: relative;
  text-decoration: none;
}

.header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-600));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease-out;
  border-radius: 2px;
}

.header nav a:hover::after,
.header nav a:focus-visible::after {
  transform: scaleX(1);
}

/* 2. Header CTA Button Fix (Desktop) */
.header .cta,
.header [data-role="cta"],
.header a[href*="asesor"] {
  background: var(--brand) !important;
  color: #fff !important;
  font-weight: 800;
  border: 1px solid var(--brand) !important;
}

.header .cta svg,
.header [data-role="cta"] svg {
  stroke: #fff !important;
  fill: #fff !important;
}

.header .cta:hover,
.header [data-role="cta"]:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
}

/* 3. Mobile CTA Overlap Fix */
.cta-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom));
  height: 64px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
  z-index: 1100;
  transition: transform .2s ease, opacity .2s ease;
}

.cta-bar.is-hidden {
  transform: translateY(120%);
  opacity: 0;
}

.cta-gift,
.widget-chat {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom) + 64px + 10px);
  z-index: 1101;
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(64px + var(--safe-bottom) + 24px);
  }
  .cta-bar-dup,
  .whatsapp-widget-fixed {
    display: none !important;
  }
}

/* Mobile Menu Overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
}

.nav-overlay__content {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  padding: calc(var(--safe-top) + var(--menu-pad)) var(--menu-pad) calc(var(--safe-bottom) + var(--menu-pad));
  overflow: auto;
  max-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

.nav-overlay__list a {
  display: block;
  padding: 16px 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.nav-overlay__cta {
  margin-top: 16px;
  position: sticky;
  bottom: 0;
  padding-bottom: calc(var(--safe-bottom) + 6px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .96) 40%, rgba(255, 255, 255, .96) 100%);
}

body.nav-open {
  height: 100dvh;
  overflow: hidden;
}

body.nav-open .cta-bar,
body.nav-open .cta-gift,
body.nav-open .widget-chat {
  display: none !important;
}