/*
 *  PropertyVisibles — Header & Navigation
 *  Source of truth: homepage-concept.html (NAV REDESIGN section)
 *  Shared across ALL pages
 */

/* ═══ HEADER ═══ */
header {
  position: sticky; top: 0; z-index: 9999;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}

.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 2rem;
  height: 64px; display: flex; align-items: center;
  justify-content: space-between; gap: 1.5rem;
}

/* ── Logo ── */
.logo { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.logo-text { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; color: var(--logo-dark); transition: color .3s; }
.logo-accent { color: var(--orange); }
.pv-icon .dark-part { fill: var(--logo-dark); transition: fill .3s; }

/* ── Primary Nav ── */
.nav-primary { display: flex; gap: .25rem; align-items: center; flex: 1; }

.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: .28rem;
  font-size: .73rem; font-weight: 400;
  color: var(--text-secondary);
  padding: .35rem .65rem; border-radius: 3px;
  cursor: pointer; transition: color .2s, background .2s;
  white-space: nowrap; border: none; background: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: .01em;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: var(--bg-secondary); }
.nav-link.active { color: var(--orange); background: var(--orange-soft); }
.nav-chevron {
  font-size: .55rem; opacity: .5;
  transition: transform .2s, opacity .2s;
  line-height: 1;
}
.nav-item:hover .nav-chevron { transform: rotate(180deg); opacity: 1; }

/* ── Dropdown Panel ── */
.nav-dropdown {
  /* Use visibility+opacity instead of display:none so transition-delay works */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 5px; box-shadow: 0 8px 28px rgba(0,0,0,.1);
  min-width: 220px; padding: .5rem; z-index: 1100;
  transition: opacity .15s ease, visibility .15s ease, background .3s, border-color .3s;
  /* Tiny delay before HIDING — gives user time to reach the dropdown */
  transition-delay: 0s;
}
[data-theme="dark"] .nav-dropdown { box-shadow: 0 8px 28px rgba(0,0,0,.4); }
.nav-item:hover .nav-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}
/* Hide delay: keep open briefly after hover leaves */
.nav-item:not(:hover) .nav-dropdown {
  transition-delay: 0.15s;
}
/* Invisible bridge: fills the 8px gap between nav-link and dropdown */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -10px; left: 0; right: 0;
  height: 10px;
}

.dd-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .6rem .75rem; border-radius: 3px;
  cursor: pointer; transition: background .15s; text-decoration: none;
}
.dd-item:hover { background: var(--bg-secondary); }
.dd-icon {
  width: 28px; height: 28px; border-radius: 4px;
  background: var(--orange-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0; transition: background .3s;
}
.dd-item:hover .dd-icon { background: var(--orange); }
.dd-label {
  font-size: .74rem; font-weight: 500;
  color: var(--text-primary); transition: color .3s; line-height: 1.3;
}
.dd-sub {
  font-family: 'Inter', sans-serif;
  font-size: .63rem; color: var(--text-muted);
  margin-top: .1rem; transition: color .3s;
}
.dd-divider {
  height: 1px; background: var(--border);
  margin: .35rem .75rem; transition: background .3s;
}
.dd-count {
  margin-left: auto;
  font-family: 'Inter', sans-serif;
  font-size: .6rem; color: var(--text-muted);
  background: var(--bg-secondary);
  padding: .15rem .45rem; border-radius: 10px;
  flex-shrink: 0; align-self: center;
  transition: background .3s, color .3s;
}

/* ── Nav Right Actions ── */
.nav-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

/* Language Switcher */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 400;
  color: var(--text-secondary);
  padding: .32rem .6rem; border-radius: 3px;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: .02em; transition: all .2s;
}
.lang-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.lang-flag { font-size: .85rem; line-height: 1; }
.lang-code { font-size: .68rem; font-weight: 500; letter-spacing: .06em; }

.lang-dropdown {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 160px; padding: .4rem; z-index: 1100;
  transition: background .3s, border-color .3s;
}
[data-theme="dark"] .lang-dropdown { box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.lang-switcher:hover .lang-dropdown { display: block; }

.lang-option {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .7rem; border-radius: 3px;
  cursor: pointer; transition: background .15s;
}
.lang-option:hover, .lang-option.active { background: var(--bg-secondary); }
.lang-option.active .lang-opt-code { color: var(--orange); }
.lang-opt-flag { font-size: .9rem; }
.lang-opt-name {
  font-size: .73rem; font-weight: 400;
  color: var(--text-primary); transition: color .3s;
}
.lang-opt-code {
  font-family: 'Inter', sans-serif;
  font-size: .6rem; font-weight: 500;
  letter-spacing: .1em; color: var(--text-muted);
  margin-left: auto; transition: color .3s;
}

/* Login Button */
.login-btn {
  display: flex; align-items: center; gap: .38rem;
  font-size: .72rem; font-weight: 400;
  color: var(--text-secondary);
  padding: .32rem .65rem; border-radius: 3px;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap; transition: all .2s;
}
.login-btn:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-secondary); }
.login-icon { font-size: .8rem; }

/* Divider */
.nav-divider { width: 1px; height: 20px; background: var(--border); transition: background .3s; }

/* Theme Switch */
.theme-switch { display: flex; align-items: center; gap: .45rem; cursor: pointer; position: relative; z-index: 300; }
.theme-switch * { pointer-events: none; }
.switch-track { width: 40px; height: 21px; background: var(--switch-bg); border-radius: 11px; position: relative; transition: background .3s; flex-shrink: 0; }
.switch-knob { position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: var(--switch-knob); transition: transform .25s, background .3s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
[data-theme="dark"] .switch-knob { transform: translateX(19px); }
.switch-icon { font-size: .7rem; color: var(--text-muted); transition: color .3s; }

/* CTA Button (nav) */
.btn-cta-nav { /* extends .btn-cta from tokens */ }


/* ══════════════════════════════════════════════════════
   WP CLASS ADAPTERS — maps pv-* classes from header.php
   to the concept design system
   ══════════════════════════════════════════════════════ */

/* ── Fix 1: Nav Inner — horizontal layout ── */
.pv-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 2rem;
  height: 64px; display: flex; align-items: center;
  justify-content: space-between; gap: 1.5rem;
}

/* ── Fix 2: Primary Nav — horizontal, flex ── */
.pv-nav {
  display: flex; gap: .25rem; align-items: center; flex: 1;
}
.pv-nav > .nav-item { position: relative; }

/* ── Logo ── */
.pv-logo { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.pv-logo-text { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; color: var(--logo-dark); transition: color .3s; }
.pv-logo-accent { color: var(--orange); }
.pv-logo-svg, .pv-logo-img { height: 28px; width: auto; }

/* ── Fix 3: Nav Right — horizontal layout ── */
.pv-nav-right {
  display: flex; align-items: center; gap: .6rem; flex-shrink: 0;
}

/* ── Fix 4: Language Switcher — dropdown hidden by default ── */
.pv-lang-switcher { position: relative; }
.pv-lang-btn {
  display: flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 400;
  color: var(--text-secondary);
  padding: .32rem .6rem; border-radius: 3px;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: .02em; transition: all .2s;
}
.pv-lang-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.pv-lang-flag { font-size: .85rem; line-height: 1; }
.pv-lang-code { font-size: .68rem; font-weight: 500; letter-spacing: .06em; }

.pv-lang-dropdown {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 160px; padding: .4rem; z-index: 1100;
  transition: opacity .15s ease, visibility .15s ease, background .3s, border-color .3s;
}
[data-theme="dark"] .pv-lang-dropdown { box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.pv-lang-switcher:hover .pv-lang-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.pv-lang-switcher:not(:hover) .pv-lang-dropdown {
  transition-delay: 0.15s;
}
/* Bridge for lang dropdown */
.pv-lang-dropdown::before {
  content: '';
  position: absolute;
  top: -8px; left: 0; right: 0;
  height: 8px;
}

.pv-lang-option {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .7rem; border-radius: 3px;
  cursor: pointer; transition: background .15s;
}
.pv-lang-option:hover, .pv-lang-option.active { background: var(--bg-secondary); }
.pv-lang-option.active .pv-lang-opt-code { color: var(--orange); }
.pv-lang-opt-flag { font-size: .9rem; }
.pv-lang-opt-name {
  font-size: .73rem; font-weight: 400;
  color: var(--text-primary); transition: color .3s;
}
.pv-lang-opt-code {
  font-family: 'Inter', sans-serif;
  font-size: .6rem; font-weight: 500;
  letter-spacing: .1em; color: var(--text-muted);
  margin-left: auto; transition: color .3s;
}

/* ── Login Button ── */
.pv-login-btn {
  display: flex; align-items: center; gap: .38rem;
  font-size: .72rem; font-weight: 400;
  color: var(--text-secondary);
  padding: .32rem .65rem; border-radius: 3px;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap; transition: all .2s;
}
.pv-login-btn:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-secondary); }

/* ── Theme Switch ── */
.pv-theme-switch {
  display: flex; align-items: center; gap: .45rem;
  cursor: pointer; position: relative; z-index: 300;
}
.pv-theme-switch * { pointer-events: none; }
.pv-switch-track {
  width: 40px; height: 21px; background: var(--switch-bg);
  border-radius: 11px; position: relative; transition: background .3s; flex-shrink: 0;
}
.pv-switch-knob {
  position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--switch-knob);
  transition: transform .25s, background .3s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
[data-theme="dark"] .pv-switch-knob { transform: translateX(19px); }
.pv-switch-icon { font-size: .7rem; color: var(--text-muted); transition: color .3s; }

/* ── CTA Button ── */
.pv-btn-cta {
  background: var(--orange); color: #fff; border: none;
  padding: .46rem 1.2rem; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .72rem; font-weight: 500; cursor: pointer;
  border-radius: 3px; transition: background .2s; white-space: nowrap;
}
.pv-btn-cta:hover { background: var(--orange-dark); }

/* ── Hamburger (mobile) ── */
.pv-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 310;
  flex-shrink: 0;
}
.pv-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform .3s, opacity .3s;
}
/* Animate to X when open */
body.pv-nav-open .pv-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.pv-nav-open .pv-hamburger span:nth-child(2) {
  opacity: 0;
}
body.pv-nav-open .pv-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Drawer ── */
@media (max-width: 1024px) {
  .pv-hamburger { display: flex; }

  .pv-nav {
    position: fixed;
    top: 0; right: 0;
    width: min(320px, 85vw);
    height: 100vh; height: 100dvh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(0,0,0,.12);
    z-index: 300;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
  }
  [data-theme="dark"] .pv-nav {
    box-shadow: -8px 0 24px rgba(0,0,0,.4);
  }

  .pv-nav.pv-nav--open {
    transform: translateX(0);
  }

  /* Nav items stack vertically in drawer */
  .pv-nav .nav-item {
    border-bottom: 1px solid var(--border);
  }
  .pv-nav .nav-link {
    padding: .85rem 0;
    font-size: .82rem;
    width: 100%;
    justify-content: space-between;
  }

  /* Dropdowns in drawer: accordion style */
  .pv-nav .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding: 0 0 .5rem .75rem;
    display: none;
  }
  .pv-nav .nav-item:hover .nav-dropdown {
    display: none; /* disable hover, use click via JS */
  }
  .pv-nav .nav-item.pv-dropdown-open .nav-dropdown {
    display: block;
  }

  /* Hide nav-right items in header bar, show in drawer bottom */
  .pv-nav-right .pv-lang-switcher,
  .pv-nav-right .pv-login-btn,
  .pv-nav-right .pv-btn-cta,
  .pv-nav-right .nav-divider {
    display: none;
  }
  /* Keep theme switch visible in header */
  .pv-nav-right {
    gap: .4rem;
  }

  /* Backdrop overlay */
  body.pv-nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 290;
  }

  /* Scroll lock */
  body.pv-nav-open {
    overflow: hidden;
  }
}

/* ═══ Z-INDEX OVERRIDE: prevent page content from overlapping dropdowns ═══
   .entry-header (Estatik/Bootstrap) sometimes has z-index:1000 + position:relative
   which causes it to appear above the sticky nav dropdown.
   We reset it to auto so our header always wins. ═══ */
.entry-header {
  z-index: auto !important;
  position: relative !important;
}

/* Also neutralise any high-z sections that might interfere */
.es-wrapper,
.es-search-wrap,
.es-property,
.es-property-wrap {
  z-index: auto !important;
}
