/* ==========================================================================
   HEADER & NAVBAR — Laura Álvarez Asesora Inmobiliaria
   ========================================================================== */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--header-padding-y) var(--header-padding-x);
  background: linear-gradient(to bottom, var(--overlay-dark-top) 0%, rgba(10, 18, 28, 0.2) 65%, transparent 100%);
  transition: background var(--transition-smooth), padding var(--transition-smooth), box-shadow var(--transition-smooth);
}

/* El contenedor de navegación mantiene altura reservada */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

/* --------------------------------------------------------------------------
   Logo & Monogram
   -------------------------------------------------------------------------- */
.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--color-text-white);
  transition: opacity var(--transition-fast);
}

.header-brand:hover {
  opacity: 0.92;
}

.brand-monogram-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 52px;
  flex-shrink: 0;
  color: var(--color-text-white);
}

.brand-monogram-wrapper svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 500;
  color: var(--color-text-white);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand-tagline {
  font-family: var(--font-ui, var(--font-sans));
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   Navigation Menu — Liquid Glass Pill Capsule
   -------------------------------------------------------------------------- */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 999px;
  isolation: isolate;
  list-style: none;
  margin: 0;
  
  /* Liquid Glass Frosted Aesthetic */
  background: rgba(255, 255, 255, 0.12);
  background: color-mix(in oklab, white 15%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 16px 36px -12px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  
  transition: padding 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              gap 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              top 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Zona segura de interacción (buffer invisible) para evitar que el cursor pierda el hover */
.nav-list::before {
  content: '';
  position: absolute;
  inset: -10px -12px;
  border-radius: 999px;
  pointer-events: auto;
  z-index: -1;
}

/* En desktop (> 768px): La píldora se mantiene fija desde el inicio para que la transición
   de contracción/expansión sea 100% visible, fluida y continua sin parpadeos */
@media (min-width: 769px) {
  .header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    min-width: 660px;
    pointer-events: none;
  }

  .nav-list {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: auto;
  }
}

/* Estado Flotante con scroll */
.nav-list.is-floating {
  top: 18px;
  background: rgba(14, 22, 34, 0.78);
  background: color-mix(in oklab, #0E1622 72%, rgba(255, 255, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 
    inset 0 1px 1.5px rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px rgba(0, 0, 0, 0.25),
    0 22px 50px -12px rgba(0, 0, 0, 0.72),
    0 0 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-ui, var(--font-sans));
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  transition: width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              min-width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              min-height 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              gap 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease,
              color 0.25s ease,
              transform 0.2s ease,
              box-shadow 0.25s ease;
}

.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  color: currentColor;
  margin: 0;
  padding: 0;
  transition: transform 0.2s ease;
}

.nav-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-lbl {
  display: inline-block;
  max-width: 145px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 1;
  margin: 0;
  padding: 0;
  line-height: 1;
  transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease;
}

.nav-link.is-active .nav-lbl,
.nav-link[href="#financiamiento"] .nav-lbl {
  max-width: 160px;
}

/* Hover & Focus states */
.nav-link:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.nav-link:hover .nav-ico {
  transform: scale(1.08);
}

.nav-link:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Active State (Liquid Gold Pill Tab) */
.nav-link.is-active,
.nav-link[aria-current="page"] {
  background: var(--color-accent-gold, #C7A76C);
  background: linear-gradient(135deg, #d8bc82 0%, #C7A76C 100%);
  color: #111A24;
  font-weight: 600;
  box-shadow: 0 4px 14px -2px rgba(199, 167, 108, 0.45),
              inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.nav-link.is-active .nav-ico,
.nav-link[aria-current="page"] .nav-ico {
  color: #111A24;
}

.nav-link.is-active:hover,
.nav-link[aria-current="page"]:hover {
  background: linear-gradient(135deg, #dfc58f 0%, #caa971 100%);
  color: #0c141d;
  transform: translateY(-1px);
}

.nav-link.is-active::after {
  display: none;
}

/* Compact mode (On scroll down: contracción orgánica suave por ancho de elementos sin scaleX) */
.nav-list.is-compact {
  padding: 5px 6px;
  gap: 4px;
  background: rgba(14, 22, 32, 0.65);
  background: color-mix(in oklab, #1B2A3D 52%, rgba(255, 255, 255, 0.14));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 14px 32px -8px rgba(0, 0, 0, 0.55);
}

.nav-list.is-compact .nav-link {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  gap: 0;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.nav-list.is-compact .nav-ico {
  margin: 0 auto;
}

.nav-list.is-compact .nav-lbl {
  max-width: 0;
  width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-list,
  .nav-lbl,
  .nav-link,
  .nav-ico {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Header CTA Button ("Hablemos") — Liquid Glass WhatsApp Pill
   -------------------------------------------------------------------------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-header-cta,
#header-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px;
  min-height: 42px;
  border-radius: 999px;
  isolation: isolate;
  position: relative;
  
  /* Liquid Glass Frosted Aesthetic */
  background: rgba(255, 255, 255, 0.12);
  background: color-mix(in oklab, white 15%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12),
    0 12px 28px -10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  
  color: var(--color-text-white);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.5, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              color 0.25s ease;
}

.btn-header-cta .icon-whatsapp {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: currentColor;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.5, 1), fill 0.25s ease;
}

.btn-header-cta:hover,
#header-cta-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.65);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 1px 1.5px rgba(255, 255, 255, 0.75),
    0 16px 36px -8px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(37, 211, 102, 0.3);
  color: #FFFFFF;
}

.btn-header-cta:hover .icon-whatsapp,
#header-cta-btn:hover .icon-whatsapp {
  transform: scale(1.18) rotate(-4deg);
  fill: #25D366;
}

.btn-header-cta:active,
#header-cta-btn:active {
  transform: translateY(0);
}

.btn-header-cta:focus-visible,
#header-cta-btn:focus-visible {
  outline: 2px solid #25D366;
  outline-offset: 2px;
}

/* El CTA dentro del menú móvil solo debe existir en mobile */
.nav-mobile-cta {
  display: none;
}

/* --------------------------------------------------------------------------
   Mobile Menu Toggle Button (Hamburger)
   -------------------------------------------------------------------------- */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text-white);
  z-index: 110;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav-toggle span:not(:last-child) {
  margin-bottom: 5px;
}

/* Open state for hamburger animation */
.mobile-nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.mobile-nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
