/* ==========================================================================
   Signpro — header: sticky bar, search, utilities, product nav, mega menu, mobile menu
   ========================================================================== */
.sp-header { position: sticky; top: 0; z-index: 50; background: var(--sp-white); transition: box-shadow .2s; }
.admin-bar .sp-header { top: 32px; }
.sp-header.is-scrolled { box-shadow: 0 6px 24px rgba(20, 20, 40, .08); }

.sp-header__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px clamp(16px, 2.4vw, 36px);
  max-width: var(--sp-max); margin: 0 auto; padding: 16px var(--sp-gutter);
}
.sp-burger {
  display: none; width: 44px; height: 44px; border: 0; border-radius: var(--sp-radius);
  background: var(--sp-bg); color: var(--sp-ink); align-items: center; justify-content: center; cursor: pointer; font-size: 22px;
}
.sp-logo { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-decoration: none; }
.sp-logo img { height: 42px; width: auto; }
.sp-logo span { font: 700 10px/1 var(--sp-font); letter-spacing: .18em; text-transform: uppercase; color: var(--sp-blue); }

/* Search */
.sp-search { position: relative; flex: 1 1 280px; max-width: 520px; }
.sp-search form {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px;
  background: var(--sp-bg); border: 1.5px solid transparent; border-radius: 8px; transition: border-color .15s;
}
.sp-search form:focus-within { border-color: var(--sp-blue); }
.sp-search input[type="search"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px/1 var(--sp-font); color: var(--sp-ink); }
.sp-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.sp-search button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--sp-muted); font-size: 20px; display: flex; }
.sp-search__results {
  position: absolute; top: 56px; left: 0; right: 0; z-index: 60; display: none; flex-direction: column; padding: 6px;
  background: var(--sp-white); border: 1px solid var(--sp-line); border-radius: 8px; box-shadow: 0 18px 40px rgba(20, 20, 40, .12);
}
.sp-search__results.is-open { display: flex; }
.sp-search__results a {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--sp-radius);
  color: var(--sp-ink); text-decoration: none; font: 500 15px/1.2 var(--sp-font);
}
.sp-search__results a:hover, .sp-search__results a.is-active { background: var(--sp-bg); color: var(--sp-ink); }
.sp-search__results a span:last-child { font: 400 13px/1.2 var(--sp-font); color: var(--sp-muted); }
.sp-search__empty { padding: 12px 14px; font: 400 14px/1.3 var(--sp-font); color: var(--sp-muted); }

/* Utility links */
.sp-utils { display: flex; align-items: center; gap: clamp(12px, 1.8vw, 28px); margin-left: auto; }
.sp-util {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--sp-ink); text-decoration: none; font: 400 13px/1 var(--sp-font);
}
.sp-util:hover { color: var(--sp-blue); }
.sp-util i { font-size: 26px; }
.sp-util__live { position: absolute; top: -2px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--sp-green); }
.sp-util__sep { width: 1px; height: 44px; background: var(--sp-line); }
.sp-cart-count {
  position: absolute; top: -6px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--sp-blue); color: var(--sp-white); font: 600 11px/20px var(--sp-font); text-align: center;
}
.sp-cart-count:empty, .sp-cart-count[data-count="0"] { display: none; }

/* Product nav */
.sp-nav { position: relative; background: var(--sp-blue); }
.sp-nav__list {
  max-width: var(--sp-max); margin: 0 auto; padding: 0 var(--sp-gutter);
  display: flex; justify-content: space-between; gap: 6px; list-style: none;
}
.sp-nav__list > li { flex: 1 1 0; min-width: 0; display: flex; }
.sp-nav__list > li > a {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 64px; padding: 0 4px; border-bottom: 3px solid transparent;
  color: var(--sp-white); text-decoration: none; font: 400 14px/1.25 var(--sp-font); text-wrap: balance; hyphens: none;
}
.sp-nav__list > li > a:hover,
.sp-nav__list > li.is-open > a,
.sp-nav__list > li.current-menu-item > a,
.sp-nav__list > li.current-menu-ancestor > a { color: var(--sp-white); border-bottom-color: var(--sp-lime); }

/* Mega menu: a top-level item's children are columns, grandchildren are links */
.sp-mega { position: absolute; top: 100%; left: 0; right: 0; z-index: 60; padding: 0 var(--sp-gutter); display: none; }
.sp-nav__list > li.is-open > .sp-mega,
.sp-nav__list > li.has-mega:hover > .sp-mega,
.sp-nav__list > li.has-mega:focus-within > .sp-mega { display: block; }
.sp-mega__col > a:hover { color: var(--sp-blue); }
.sp-mega__panel {
  max-width: 1360px; margin: 0 auto; display: flex; min-height: 440px;
  background: var(--sp-white); border-top: 1px solid var(--sp-line); box-shadow: var(--sp-shadow-lg);
}
.sp-mega__cols { flex: 1 1 56%; min-width: 0; padding: 40px 48px 44px; columns: 3 190px; column-gap: 40px; list-style: none; margin: 0; }
.sp-mega__col { break-inside: avoid; display: flex; flex-direction: column; gap: 14px; margin-bottom: 36px; }
.sp-mega__col > a, .sp-mega__col > span { font: 700 18px/1.25 var(--sp-font); color: var(--sp-ink); text-decoration: none; margin-bottom: 6px; }
.sp-mega__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.sp-mega__col li a { font: 400 16px/1.35 var(--sp-font); color: var(--sp-ink); text-decoration: none; }
.sp-mega__col li a:hover { color: var(--sp-blue); }
.sp-mega__img { flex: 0 0 44%; position: relative; background: var(--sp-placeholder); }
.sp-mega__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Mobile drawer */
.sp-drawer { display: none; border-top: 1px solid #EFEFF3; max-height: calc(100vh - 130px); overflow-y: auto; background: var(--sp-white); }
.sp-header.menu-open .sp-drawer { display: block; }
.sp-drawer ul { list-style: none; margin: 0; padding: 0; }
.sp-drawer > ul > li > a {
  display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 18px;
  border-bottom: 1px solid #EFEFF3; color: var(--sp-ink); text-decoration: none; font: 500 16px/1.2 var(--sp-font);
}
.sp-drawer > ul > li > a::after { content: "\203A"; font-size: 22px; color: var(--sp-muted); }
.sp-drawer .sub-menu, .sp-drawer .sp-mega { display: none !important; }
.sp-drawer__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px; }
.sp-drawer__actions a {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: var(--sp-radius);
  background: var(--sp-bg); color: var(--sp-ink); text-decoration: none; font: 500 14px/1 var(--sp-font);
}
.sp-drawer__actions i { font-size: 20px; }

@media (max-width: 1180px) {
  .sp-util--hide-m, .sp-util__sep { display: none !important; }
  .sp-nav { display: none; }
  .sp-burger { display: flex; }
  .sp-search { order: 3; flex-basis: 100%; max-width: none; }
  .sp-header__bar { gap: 10px 12px; padding: 10px 14px; }
  .sp-logo img { height: 32px; }
}
@media (max-width: 782px) { .admin-bar .sp-header { top: 0; } }
