/* ==========================================================================
   10-header: topbar, brandbar, pinned nav, mega menus (header.php only)
   Spec Sheet direction: hairline rules, mono labels, one blue accent.
   ========================================================================== */

/* ---------- topbar: the 5-second line ---------- */
.topbar { font-size: .78rem; letter-spacing: .005em; border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar-inner { min-height: 34px; gap: 12px 24px; flex-wrap: nowrap; }
.tb-facts { display: flex; align-items: center; min-width: 0; gap: 0; white-space: nowrap; overflow: hidden; }
.tb-tag {
  flex: none; margin-right: 12px; padding: 3px 7px 2px;
  font: 600 .64rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--accent); border-radius: 3px;
}
.tb-fact { color: #dfe6f1; }
.tb-fact + .tb-fact::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 10px 2px; border-radius: 50%; background: #7d8ba0; vertical-align: middle; }
.topbar-links { flex: none; gap: 0; }
.topbar-links a { padding: 0 10px; color: #c9d3e3; font-size: .76rem; line-height: 34px; }
.topbar-links a + a { border-left: 1px solid rgba(255,255,255,.14); }
.topbar-links a:last-child { padding-right: 0; }
.topbar-links a:hover { color: #fff; text-decoration: none; }
@media (max-width: 760px) {
  .topbar-inner { justify-content: center; }
  .tb-facts { justify-content: center; }
}
/* Phones: one fact at a time (20-header.js), never below 12.8px. The size sits
   on the line itself so later size steps on .topbar cannot shrink it. */
@media (max-width: 760px) { .topbar .tb-facts { font-size: .8rem; } }
@media (max-width: 560px) {
  .tb-facts:not(.tb-rot) .tb-moq { display: none; }
  .tb-tag { margin-right: 8px; }
}
/* Under 400px the location reads "Teamwear factory in Sialkot" so it fits whole. */
@media (max-width: 400px) { .tb-cty { display: none; } }

/* ---------- brandbar: compact, logo centered ---------- */
.brandbar-inner { padding-block: 10px; gap: 16px; }
.brandbar .mark-logo { height: 52px; }
.brand-contact { gap: 2px; }
.brand-line { font-size: .82rem; color: var(--ink-2); gap: 7px; }
.brand-line span { font-variant-numeric: tabular-nums; }
.brand-line:hover span { text-decoration: underline; text-underline-offset: 3px; }
.brand-social .social { gap: 4px; }
.brand-social .social a { width: 30px; height: 30px; }
@media (max-width: 760px) {
  .brandbar-inner { padding-block: 8px; }
  .brandbar .mark-logo { height: 40px; }
  .brand-line { width: 32px; height: 32px; }
}
@media (max-width: 420px) { .brandbar .mark-logo { height: 34px; } }

/* ---------- pinned nav ---------- */
.site-head { background: rgba(255,255,255,.96); }
.site-head-inner { gap: 20px; min-height: 56px; }
.site-head.is-scrolled { box-shadow: 0 1px 0 var(--rule), 0 8px 20px rgba(14,27,44,.06); }
.nav { gap: 0; }
.nav > a, .nav-item > a {
  gap: 6px; padding: 0 11px; min-height: 56px; border-radius: 0;
  font-size: .92rem; font-weight: 500; color: var(--ink);
}
.nav > a:hover, .nav-item > a:hover, .has-mega.is-open > a { color: var(--accent-ink); }
.nav a.is-current::after { left: 11px; right: 11px; bottom: 0; border-top-width: 2px; }
.nav-count {
  font: 600 .64rem/1 var(--f-mono); letter-spacing: .04em; color: var(--accent-ink);
  background: var(--accent-soft); padding: 3px 5px 2px; border-radius: 3px;
}
.nav-caret { width: 6px; height: 6px; margin: -3px 0 0 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); opacity: .55; transition: transform .2s var(--ease), opacity .2s; }
.has-mega:hover > a .nav-caret, .has-mega:focus-within > a .nav-caret, .has-mega.is-open > a .nav-caret { transform: translateY(2px) rotate(225deg); opacity: 1; }
.head-actions .btn-sm { min-height: 38px; }
.head-reorder { border-color: var(--rule-strong); }
/* Reorder stays in the pinned bar at every width (main.css hides it under
   1080px). Under 481px it goes compact and the MOQ stamp steps aside (20-header.css). */
@media (max-width: 1080px) { .head-reorder { display: inline-flex; } }
@media (min-width: 961px) and (max-width: 1100px) { .head-actions .head-reorder { padding-inline: 10px; } }
@media (max-width: 480px) { .head-actions .head-reorder { display: inline-flex; padding-inline: 10px; } }

/* ---------- mega menus ---------- */
.mega { top: calc(100% + 1px); left: 0; border-radius: 0 0 var(--radius) var(--radius); border-top: 2px solid var(--accent); box-shadow: 0 18px 40px rgba(14,27,44,.12); transform: translateY(4px); }
.has-mega.is-open .mega { opacity: 1; visibility: visible; transform: none; }
.has-mega.is-closed .mega { opacity: 0; visibility: hidden; }
.mega-catalog { width: min(800px, 92vw); padding: 0; }
.mega-head { display: flex; align-items: baseline; gap: 16px; padding: 14px 18px 12px; border-bottom: 1px solid var(--rule); }
.mega-kicker { margin: 0; flex: none; font: 600 .7rem/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.mega-note { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--ink-2); }
.mega-catalog .mega-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 8px; }
.mega-sport { padding: 7px 8px; gap: 9px; border-radius: 6px; }
.mega-sport img { width: 38px; height: 38px; border-radius: 4px; background: var(--surface-2); }
.mega-sport b { font-size: .88rem; line-height: 1.25; }
.mega-sport small { font: 500 .68rem/1.3 var(--f-mono); letter-spacing: .02em; }
.mega-sport:hover b { color: var(--accent-ink); }
.mega-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); background: var(--bg); }
.mega-steps li { padding: 10px 14px; font-size: .76rem; line-height: 1.35; color: var(--ink); }
.mega-steps li + li { border-left: 1px solid var(--rule); }
.mega-steps span { display: block; margin-bottom: 3px; font: 600 .64rem/1 var(--f-mono); letter-spacing: .08em; color: var(--accent-ink); }
.mega-catalog .mega-all { margin: 0; padding: 11px 18px; font-size: .88rem; border-top: 1px solid var(--rule); }
.mega-links { padding: 8px; gap: 0; }
.mega-link { padding: 9px 12px; border-radius: 6px; }
.mega-link b { font-size: .9rem; }
.mega-link small { font-size: .76rem; }
.mega-link:hover b { color: var(--accent-ink); }
.nav-sub-toggle { display: none; }
.nav-terms { margin: 0; }

/* Desktop with a narrower bar: fewer labels compete */
@media (max-width: 1180px) and (min-width: 961px) {
  .nav > a, .nav-item > a { padding: 0 8px; font-size: .88rem; }
  .nav-count { display: none; }
}

/* ---------- mobile drawer ---------- */
@media (max-width: 960px) {
  .site-head-inner { min-height: 56px; }
  .nav { padding-top: 0; max-height: calc(100dvh - 56px); overscroll-behavior: contain; }
  .nav > a, .nav-item > a { min-height: 52px; padding: 0 4px; font-size: 1rem; font-weight: 600; }
  .nav-caret { display: none; }
  .nav-count { display: inline-block; }
  .mega { border-top: 0; border-radius: 0; box-shadow: none; transform: none; }
  .mega-head { padding: 10px 4px 8px; border-bottom: 0; flex-direction: column; gap: 4px; }
  .mega-catalog { width: auto; }
  .mega-catalog .mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 0 8px; }
  .mega-steps { display: none; }
  .mega-links { padding: 0 0 8px; }

  /* Accordion only once JS has added the toggles */
  .ef-hdr-js .nav-item.has-mega { display: grid; grid-template-columns: 1fr 52px; }
  .ef-hdr-js .nav-item.has-mega > a { grid-column: 1; }
  .ef-hdr-js .nav-sub-toggle { display: grid; place-items: center; grid-column: 2; grid-row: 1; width: 52px; min-height: 52px; padding: 0; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--ink); }
  .ef-hdr-js .nav-sub-toggle::before { content: ""; width: 8px; height: 8px; margin-top: -4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease); }
  .ef-hdr-js .nav-item.is-sub-open .nav-sub-toggle::before { transform: translateY(4px) rotate(225deg); }
  .ef-hdr-js .nav-item.has-mega .mega { grid-column: 1 / -1; display: none; }
  .ef-hdr-js .nav-item.is-sub-open .mega { display: block; }

  /* Drawer top: Reorder and Contact as two tiles, reachable at every width */
  .nav .nav-quick.nav-mobile-only { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav-quick a { display: grid; align-content: center; gap: 3px; min-height: 54px; padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); color: var(--ink); text-decoration: none; }
  .nav-quick b { font-size: .98rem; font-weight: 600; line-height: 1.2; }
  .nav-quick small { font: 500 .7rem/1.3 var(--f-mono); letter-spacing: .03em; color: var(--ink-2); }
  .nav-quick a.nav-quick-reorder { border-color: var(--accent); background: var(--accent-soft); }
  .nav-quick-reorder b { color: var(--accent-ink); }
  .nav-quick a:active { background: var(--surface-2); }

  .nav .nav-terms.nav-mobile-only { display: grid !important; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 14px; background: var(--rule); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
  .nav-terms div { background: var(--bg); padding: 9px 12px; }
  .nav-terms dt { font: 600 .62rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
  .nav-terms dd { margin: 2px 0 0; font-size: .86rem; font-weight: 600; color: var(--ink); }
}
@media (max-width: 330px) { .mega-catalog .mega-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .mega, .nav-caret, .ef-hdr-js .nav-sub-toggle::before { transition: none; }
}
