/* =============================================================================
   TRAFFIC PLAN — Header CSS
   Sticky alb, logo stânga, nav centru, lang switch + CTA dreapta
   ============================================================================= */

/* ─── Header wrapper ─────────────────────────────────────────────────────── */
.tp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background-color: var(--tp-white);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease-normal), box-shadow var(--ease-normal);
}

.tp-header--scrolled {
  border-bottom-color: var(--tp-gray-100);
  box-shadow: 0 2px 20px rgba(26,35,50,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(255,255,255,0.96);
}

.tp-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: var(--sp-6);
}

/* ─── Logo ───────────────────────────────────────────────────────────────── */
.tp-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

.tp-logo__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--tp-green-500);
  border-radius: var(--radius-md);
  color: var(--tp-white);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.tp-logo__mark::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 8px;
  width: 3px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.8) 0px,
    rgba(255,255,255,0.8) 4px,
    transparent 4px,
    transparent 8px
  );
}

.tp-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.tp-logo__name {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--tp-navy-900);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.tp-logo__name span {
  color: var(--tp-green-500);
}

.tp-logo__tagline {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--tp-gray-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.tp-logo img {
  height: 50px;
  width: auto;
  max-height: 50px;
  display: block;
}

@media (max-width: 767px) {
  .tp-logo img {
    height: 40px;
    max-height: 40px;
  }
}

/* ─── Nav principal ──────────────────────────────────────────────────────── */
.tp-nav {
  display: none;
  flex: 1;
  justify-content: center;
}

@media (min-width: 1024px) {
  .tp-nav {
    display: flex;
  }
}

.tp-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Linkuri generate de wp_nav_menu — selectate direct pe <a> */
.tp-nav__list li a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--tp-gray-700);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--ease-fast);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tp-nav__list li a:hover,
.tp-nav__list li a:focus {
  color: var(--tp-green-500);
  background-color: var(--tp-green-100);
}

.tp-nav__list li.current-menu-item > a,
.tp-nav__list li.current_page_item > a {
  color: var(--tp-green-500);
}

/* Dropdown */
.tp-nav__list li ul {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background-color: var(--tp-white);
  border: 1px solid var(--tp-gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: var(--z-dropdown);
  list-style: none;
  margin: 0;
}

.tp-nav__list li:hover > ul,
.tp-nav__list li:focus-within > ul {
  display: block;
}

.tp-nav__list li ul a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--tp-gray-700);
  border-radius: var(--radius-md);
  transition: all var(--ease-fast);
}

.tp-nav__list li ul a:hover {
  background-color: var(--tp-green-100);
  color: var(--tp-green-500);
}

/* Fiecare <li> relativ pentru dropdown */
.tp-nav__list > li {
  position: relative;
}

/* ─── Header dreapta ─────────────────────────────────────────────────────── */
.tp-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* Lang switch */
.tp-lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--tp-gray-50);
  border: 1px solid var(--tp-gray-100);
  border-radius: var(--radius-full);
  padding: 3px;
}

.tp-lang-switch__btn {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tp-gray-500);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ease-fast);
  line-height: 1;
  display: inline-block;
}

.tp-lang-switch__btn:hover,
.tp-lang-switch__btn--active {
  background-color: var(--tp-green-500);
  color: var(--tp-white);
}

/* CTA buton header — vizibil doar la 1024px+ (la fel ca nav-ul) */
.tp-header__cta {
  display: none;
}

@media (min-width: 1024px) {
  .tp-header__cta {
    display: inline-flex;
    padding: 0.5rem 1.25rem;
    font-size: var(--fs-sm);
  }
}

/* ─── Mobile menu (hamburger + overlay fullscreen) ──────────────────────── */

/* Hamburger — ascuns pe desktop */
.tp-hamburger {
  display: none;
}

/* Overlay — ascuns implicit, indiferent de breakpoint */
.tp-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  z-index: 99999;
  flex-direction: column;
  padding: 80px 32px 40px;
  overflow-y: auto;
}

.tp-mobile-overlay.is-open {
  display: flex;
}

/* Buton X */
.tp-mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid #E9ECF0;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1A2332;
  line-height: 1;
}

.tp-mobile-close:hover {
  background: #F7F8FA;
}

/* Lista linkuri */
.tp-mobile-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.tp-mobile-nav__list li a {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #1A2332;
  padding: 18px 0;
  border-bottom: 1px solid #E9ECF0;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}

.tp-mobile-nav__list li:last-child a {
  border-bottom: none;
}

.tp-mobile-nav__list li a:hover {
  color: #5B9A3C;
  padding-left: 8px;
}

/* CTA contact în overlay */
.tp-mobile-cta {
  margin-top: 32px;
  background: #5B9A3C;
  color: #FFFFFF;
  padding: 16px 24px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background 0.2s;
}

.tp-mobile-cta:hover {
  background: #4A8B3F;
}

/* Lock scroll când overlay e deschis */
body.menu-open {
  overflow: hidden;
}

@media (max-width: 1023px) {

  /* Hamburger vizibil pe mobile */
  .tp-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
  }

  .tp-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--tp-navy-900);
    transition: all 0.3s ease;
    border-radius: 2px;
  }

  .tp-hamburger.is-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .tp-hamburger.is-active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
  }
  .tp-hamburger.is-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

}

/* ─── Body offset pentru header fix ─────────────────────────────────────── */
body {
  padding-top: 80px;
}
