/* ============================================================
   ParkingBox — Header CUSTOM global (înlocuiește headerul Astra)
   Injectat via wp_body_open (functions.php). #masthead e ascuns.
   ============================================================ */

/* Ascunde complet header-ul Astra pe toate paginile */
#masthead { display: none !important; }

:root { --pbx-h: 84px; --pbx-bg: #0d0d0d; --pbx-orange: #ee6c1a; --pbx-gold: #c8a25b; }

.pbx-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--pbx-bg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pbx-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--pbx-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo */
.pbx-header__logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.pbx-header__logo img { height: 46px; width: auto; display: block; }

/* Nav */
.pbx-header__nav { flex: 1 1 auto; display: flex; justify-content: center; }
.pbx-menu {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0;
}
.pbx-menu li { position: relative; }
.pbx-menu a {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 14px;
  color: #fff; font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .02em;
  text-decoration: none; white-space: nowrap;
  transition: color .2s;
}
.pbx-menu a:hover,
.pbx-menu .current-menu-item > a,
.pbx-menu .current-menu-ancestor > a { color: var(--pbx-gold); }

/* Săgeată pentru itemii cu submeniu */
.pbx-menu .menu-item-has-children > a::after {
  content: ""; display: inline-block; width: 7px; height: 7px;
  margin-left: 7px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px);
}

/* Submeniu dropdown (desktop) */
.pbx-menu .sub-menu {
  position: absolute; top: 100%; left: 0;
  min-width: 220px; margin: 0; padding: 8px 0;
  list-style: none; background: #161616;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s, transform .18s, visibility .18s; z-index: 10;
}
.pbx-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.pbx-menu .sub-menu a {
  height: auto; width: 100%; padding: 10px 18px;
  font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400;
}
.pbx-menu .sub-menu .menu-item-has-children > a::after { transform: rotate(-45deg); }

/* Acțiuni dreapta */
.pbx-header__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }

.pbx-cart {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; color: #fff; border-radius: 8px;
  transition: background .2s;
}
.pbx-cart:hover { background: rgba(255,255,255,0.08); }
.pbx-cart svg { width: 22px; height: 22px; }
.pbx-cart__count {
  position: absolute; top: 2px; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--pbx-orange); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  border-radius: 9px;
}
.pbx-cart__count[data-count="0"] { display: none; }

.pbx-cta {
  display: inline-flex; align-items: center; height: 42px; padding: 0 22px;
  background: var(--pbx-orange); color: #fff;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  border-radius: 999px; text-decoration: none; white-space: nowrap;
  transition: background .2s, transform .2s;
}
.pbx-cta:hover { background: #d65f12; transform: translateY(-1px); color: #fff; }

/* Burger (mobil) */
.pbx-burger {
  display: none; width: 44px; height: 44px; padding: 0;
  background: rgba(255,255,255,0.06); border: 0; border-radius: 10px;
  cursor: pointer; flex-direction: column; gap: 4px; align-items: center; justify-content: center;
}
.pbx-burger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.pbx-header.pbx-open .pbx-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.pbx-header.pbx-open .pbx-burger span:nth-child(2) { opacity: 0; }
.pbx-header.pbx-open .pbx-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ===================== MOBIL ===================== */
@media (max-width: 921px) {
  /* distribuie logo | coș | CTA | burger uniform pe lățime */
  .pbx-header__inner { justify-content: space-between; gap: 8px; }
  .pbx-header__actions { display: contents; }
  .pbx-header__logo img { height: 40px; }
  .pbx-burger { display: flex; }
  .pbx-header__nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--pbx-bg); border-top: 1px solid rgba(255,255,255,0.08);
    display: none; max-height: calc(100vh - var(--pbx-h)); overflow-y: auto;
  }
  .pbx-header.pbx-open .pbx-header__nav { display: block; }
  .pbx-menu { flex-direction: column; align-items: stretch; gap: 0; }
  .pbx-menu li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .pbx-menu a { height: auto; width: 100%; padding: 15px 24px; font-size: 15px; }
  .pbx-menu .menu-item-has-children > a::after { float: right; margin-top: 6px; }
  /* submeniu inline, deschis la tap (clasa .pbx-sub-open pe li) */
  .pbx-menu .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-radius: 0; padding: 0;
    background: rgba(255,255,255,0.04); display: none; min-width: 0;
  }
  .pbx-menu li.pbx-sub-open > .sub-menu { display: block; }
  .pbx-menu .sub-menu a { padding-left: 40px; }
  /* CTA rămâne vizibil, coșul lângă burger */
  .pbx-cta { height: 38px; padding: 0 16px; font-size: 12px; }
  .pbx-header__actions { gap: 8px; }
}
@media (max-width: 480px) {
  /* compactăm bara, dar păstrăm CTA-ul vizibil */
  .pbx-header__inner { padding: 0 14px; gap: 8px; }
  .pbx-header__logo img { height: 34px; }
  .pbx-cart { width: 34px; }
  .pbx-cta { height: 36px; padding: 0 12px; font-size: 11px; }
  .pbx-burger { width: 40px; height: 40px; }
}
