/* =============================================================
   HEADER  — css/header.css
   Top bar is 36px. Sticky header is 70px. Mega menu uses
   fixed position so it must account for both (106px total).
   ============================================================= */

/* ── Sticky header shell ────────────────────────────────────── */
.pq-header {
  position:        sticky;
  top:             0;
  z-index:         200;
  background:      rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  border-bottom:   1px solid var(--pq-border);
}
.pq-header__inner {
  height:          70px;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             28px;
}

/* ── Logo ───────────────────────────────────────────────────── */
.pq-logo {
  display:        inline-flex;
  align-items:    center;
  gap:            10px;
  font-weight:    900;
  font-size:      1.35rem;
  letter-spacing: -.04em;
  flex-shrink:    0;
  text-decoration: none;
  color:          var(--pq-ink);
}
/* the_custom_logo() wraps the image in an <a> — handle both */
.pq-logo img,
.pq-logo .custom-logo-link img { height: 38px; width: auto; max-width: 180px; object-fit: contain; }
.pq-logo .custom-logo-link     { display: inline-flex; line-height: 0; }
.pq-logo span span { color: var(--pq-orange); }
.pq-logo__mark {
  width:         36px; height: 36px;
  border-radius: 9px;
  background:    var(--pq-sage);
  display:       grid; place-items: center;
  font-size:     1rem;
}

/* ── Nav wrapper centres the ul ─────────────────────────────── */
.pq-nav-wrap {
  flex:            1;
  display:         flex;
  justify-content: center;
  overflow:        visible;
}

/* ── ul.pq-nav ──────────────────────────────────────────────── */
ul.pq-nav {
  display:     flex;
  align-items: center;
  gap:         4px;
  list-style:  none;
  margin: 0; padding: 0;
}

ul.pq-nav > .menu-item { position: relative; }

ul.pq-nav > .menu-item > a {
  display:        flex;
  align-items:    center;
  gap:            4px;
  padding:        8px 14px;
  font-size:      .875rem;
  font-weight:    600;
  border-radius:  999px;
  color:          var(--pq-ink);
  transition:     background var(--pq-ease), color var(--pq-ease);
  white-space:    nowrap;
  text-decoration: none;
}
ul.pq-nav > .menu-item > a:hover,
ul.pq-nav > .menu-item.current-menu-item  > a,
ul.pq-nav > .menu-item.current-menu-parent > a {
  background: var(--pq-sand);
  color:      var(--pq-green);
}

ul.pq-nav > .menu-item-has-children > a::after {
  content:     '';
  display:     inline-block;
  width: 5px; height: 5px;
  border:      1.5px solid currentColor;
  border-top:  none; border-left: none;
  transform:   rotate(45deg) translateY(-2px);
  transition:  transform var(--pq-ease);
  margin-left: 2px;
}
ul.pq-nav > .menu-item-has-children:hover > a::after {
  transform: rotate(225deg) translateY(0);
}

/* ── Standard dropdown ──────────────────────────────────────── */
ul.pq-nav .sub-menu {
  display:       none;
  position:      absolute;
  top:           calc(100% + 8px);
  left:          0;
  min-width:     200px;
  background:    var(--pq-white);
  border:        1px solid var(--pq-border);
  border-radius: var(--pq-radius-lg);
  box-shadow:    var(--pq-shadow-lg);
  padding:       8px;
  z-index:       300;
  list-style:    none;
  margin: 0;
}
ul.pq-nav .menu-item:hover > .sub-menu { display: block; }

ul.pq-nav .sub-menu .menu-item > a {
  display:       block;
  padding:       9px 14px;
  font-size:     .85rem;
  font-weight:   600;
  border-radius: var(--pq-radius);
  color:         var(--pq-ink);
  transition:    background var(--pq-ease);
  text-decoration: none;
}
ul.pq-nav .sub-menu .menu-item > a:hover { background: var(--pq-sand); }

/* ═══════════════════════════════════════════════════════════════
   MEGA MENU
   Add CSS class  pq-mega  to a top-level menu item via
   Appearance → Menus → CSS Classes to activate.
   ═══════════════════════════════════════════════════════════ */
ul.pq-nav > .menu-item.pq-mega { position: static; }

ul.pq-nav > .menu-item.pq-mega > .sub-menu {
  position:      fixed;
  /* topbar (36px) + header (70px) = 106px */
  top:           106px;
  left:          0;
  width:         100vw;
  min-width:     unset;
  border-radius: 0 0 var(--pq-radius-xl) var(--pq-radius-xl);
  padding:       28px max(var(--pq-gutter), calc((100vw - var(--pq-max)) / 2 + 20px));
  display:       none;
  z-index:       300;
}
ul.pq-nav > .menu-item.pq-mega:hover > .sub-menu {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap:                   0;
}

ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item {
  padding:      0 20px 8px;
  border-right: 1px solid var(--pq-border);
}
ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item:last-child { border-right: none; }

ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item > a {
  display:        block;
  padding:        4px 0 12px;
  font-size:      .75rem;
  font-weight:    800;
  color:          var(--pq-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius:  0;
  background:     none !important;
}
ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item > a:hover { color: var(--pq-green); }

ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item > .sub-menu {
  display: block; position: static;
  border: none; box-shadow: none;
  padding: 0; min-width: unset; background: none;
}
ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item > .sub-menu > .menu-item > a {
  padding: 6px 0; font-size: .875rem;
  color: var(--pq-ink); border-radius: 0; background: none !important;
}
ul.pq-nav > .menu-item.pq-mega > .sub-menu > .menu-item > .sub-menu > .menu-item > a:hover {
  color: var(--pq-green); text-decoration: underline;
}

/* ── Right-side actions ─────────────────────────────────────── */
.pq-actions {
  display:     flex;
  align-items: center;
  gap:         10px;
  flex-shrink: 0;
}
.pq-actions > a {
  display:       grid;
  place-items:   center;
  width:         34px;
  height:        34px;
  border-radius: 50%;
  color:         var(--pq-muted);
  transition:    color var(--pq-ease), background var(--pq-ease);
}
.pq-actions > a:hover { color: var(--pq-green); background: var(--pq-sand); }

.pq-cart-toggle {
  display:       flex;
  align-items:   center;
  gap:           6px;
  border:        1.5px solid var(--pq-border);
  background:    var(--pq-white);
  border-radius: 999px;
  padding:       7px 14px;
  font-family:   var(--pq-font);
  font-weight:   700;
  font-size:     .85rem;
  cursor:        pointer;
  transition:    border-color var(--pq-ease);
}
.pq-cart-toggle:hover { border-color: var(--pq-green); }

.pq-cart-count {
  display:       inline-grid;
  place-items:   center;
  min-width:     18px; height: 18px;
  padding:       0 4px;
  border-radius: 999px;
  background:    var(--pq-orange);
  color:         #fff;
  font-size:     .7rem; font-weight: 700;
}

/* ── Hamburger ──────────────────────────────────────────────── */
.pq-menu {
  display:        none;
  background:     none;
  border:         none;
  gap:            5px;
  flex-direction: column;
  cursor:         pointer;
  padding:        4px;
}
.pq-menu span {
  width:         22px; height: 2px;
  background:    var(--pq-ink);
  display:       block;
  border-radius: 2px;
  transition:    var(--pq-ease);
}

/* ── Mobile drawer ──────────────────────────────────────────── */
.pq-mobile {
  display:    none;
  padding:    12px var(--pq-gutter) 20px;
  background: var(--pq-white);
  border-top: 1px solid var(--pq-border);
}
.pq-mobile.is-open { display: block; }

.pq-mobile .pq-mobile-list,
ul.pq-mobile-list  { list-style: none; margin: 0; padding: 0; }

.pq-mobile .menu-item > a,
ul.pq-mobile-list .menu-item > a {
  display:       block;
  padding:       10px 0;
  font-weight:   700;
  font-size:     .95rem;
  border-bottom: 1px solid var(--pq-border);
  text-decoration: none;
  color:         var(--pq-ink);
}
.pq-mobile .menu-item:last-child > a,
ul.pq-mobile-list .menu-item:last-child > a { border-bottom: none; }

.pq-mobile .sub-menu,
ul.pq-mobile-list .sub-menu { padding-left: 16px; list-style: none; }
.pq-mobile .sub-menu .menu-item > a,
ul.pq-mobile-list .sub-menu .menu-item > a { font-size: .875rem; font-weight: 600; }

/* ── Cart drawer ────────────────────────────────────────────── */
.pq-cart-overlay {
  position: fixed; inset: 0;
  background: rgba(16,37,41,.38);
  z-index: 400;
  opacity: 0; pointer-events: none;
  transition: opacity var(--pq-ease);
}
.pq-cart-drawer {
  position:  fixed; top: 0; right: 0;
  height:    100dvh;
  width:     min(400px, 92vw);
  background: var(--pq-white);
  z-index:   401;
  transform: translateX(104%);
  transition: transform .22s ease;
  box-shadow: -12px 0 50px rgba(16,37,41,.14);
  display:   flex; flex-direction: column;
}
.pq-cart-open .pq-cart-overlay { opacity: 1; pointer-events: auto; }
.pq-cart-open .pq-cart-drawer  { transform: translateX(0); }

.pq-cart-drawer__head {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         18px 20px;
  border-bottom:   1px solid var(--pq-border);
  font-size:       1rem; font-weight: 800;
}
.pq-cart-drawer__head button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--pq-border);
  background: var(--pq-white);
  font-size: 1.3rem; cursor: pointer;
}
.pq-mini-cart { padding: 18px 20px; overflow-y: auto; flex: 1; }
.pq-mini-cart .woocommerce-mini-cart__buttons a { display: block; text-align: center; margin: 7px 0; }

/* Admin bar compatibility: prevents sticky header from sliding under WP toolbar. */
body.admin-bar .pq-header { top: 32px; }
body.admin-bar ul.pq-nav > .menu-item.pq-mega > .sub-menu { top: 138px; }
@media (max-width: 782px) {
  body.admin-bar .pq-header { top: 46px; }
}
