/**
 * Site chrome — SAIWEI SPORTS header + footer
 *
 * UI tokens replicate 护腿板/html/saiwei-p003-homepage-softened-video-hero.html
 * (soft-UI patch included: pill buttons, 14/18px control radii).
 * Menu structure follows 足球护腿板B2C独立站_最终SEO_GEO网站架构策划_2026-08-25.xlsx
 * sheets 05_网站树形架构 / 06_导航与页脚.
 *
 * All selectors are scoped under the sw- prefix so they cannot collide with
 * avy-design-system.css, which still styles the interior page content.
 * Exception: .avy-header__cart-count is intentionally reused (nested inside
 * .sw-icon-cart) so the WooCommerce add-to-cart AJAX fragment in functions.php
 * keeps updating the badge without a page reload.
 */

.sw-header,
.sw-footer {
  /* Design tokens (values copied from saiwei-p003) */
  --sw-blue-950: #0b2249;
  --sw-blue-900: #102a56;
  --sw-blue-800: #15386f;
  --sw-blue-700: #1f5dcc;
  --sw-blue-100: #eaf0fc;
  --sw-cream: #fff9ef;
  --sw-silver-100: #eceff2;
  --sw-silver-200: #d8dde3;
  --sw-silver-300: #c2c9d1;
  --sw-silver-400: #a6afba;
  --sw-silver-500: #87919d;
  --sw-silver-600: #697482;
  --sw-ink: #101a2a;
  --sw-content: min(calc(100% - 36px), 1350px);

  box-sizing: border-box;
  font-family:
    "Outfit",
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.6;
}

.sw-header *,
.sw-footer * {
  box-sizing: border-box;
}

.sw-header a,
.sw-footer a {
  color: inherit;
  text-decoration: none;
}

.sw-header a:focus-visible,
.sw-footer a:focus-visible,
.sw-header button:focus-visible,
.sw-footer button:focus-visible {
  outline: 3px solid var(--sw-blue-700);
  outline-offset: 4px;
}

/* Skip link */
.sw-skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 10px;
  transform: translateY(-180%);
  padding: 11px 15px;
  background: var(--sw-cream);
  border: 1px solid var(--sw-silver-300);
  border-radius: 12px;
  font-weight: 850;
  font-size: 0.85rem;
  color: var(--sw-ink);
}

.sw-skip-link:focus {
  transform: none;
}

/* ============================================================
   HEADER — brand | nav | actions grid (saiwei-p003 .site-header)
   ============================================================ */
.sw-header {
  position: relative;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--sw-silver-200);
  backdrop-filter: blur(16px);
}

.sw-header__inner {
  width: var(--sw-content);
  min-height: 76px;
  margin: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}

/* Brand */
.sw-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--sw-blue-900);
  font-size: 0.94rem;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sw-brand-mark {
  display: grid;
  place-items: center;
}

.sw-brand-mark svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
}

/* Desktop nav with dropdown panels */
.sw-nav {
  display: flex;
  justify-content: center;
  gap: 23px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sw-nav__item {
  position: relative;
}

.sw-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  font-size: 1rem;
  font-weight: 760;
  color: #33415c;
  white-space: nowrap;
}

.sw-nav__link:hover {
  color: var(--sw-blue-700);
}

.sw-nav__link.is-current {
  color: var(--sw-blue-700);
}

/* Non-link nav label (chrome v2 "Shop by Player"): caret comes from the
   has-children rule above; no pointer, no hover color shift. */
.sw-nav__label {
  opacity: 0.92;
  cursor: default;
}

.sw-nav__label:hover {
  color: #33415c;
}

.sw-nav__label.is-current {
  font-weight: 700;
  opacity: 1;
}

.sw-nav__item--has-children > .sw-nav__link::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentcolor;
  opacity: 0.55;
}

/* Dropdown panel (chrome v2: white card, graphite border, soft shadow) */
.sw-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: -14px;
  min-width: 252px;
  background: #fff;
  border: 1px solid rgba(11, 13, 16, 0.08);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(11, 13, 16, 0.16);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s;
  z-index: 50;
  text-align: left;
}

.sw-nav__item:hover > .sw-dropdown,
.sw-nav__item:focus-within > .sw-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sw-dropdown a {
  display: block;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.95rem;
  color: #0b0d10;
  white-space: nowrap;
}

.sw-dropdown a:hover {
  background: #f4f6f8;
}

.sw-dropdown a.is-current,
.sw-dropdown a[aria-current="page"] {
  font-weight: 700;
  background: #f4f6f8;
}

/* Divider before an auxiliary entry (e.g. Clearance inside the shop dropdown) */
.sw-dropdown__sep {
  margin: 8px 6px 4px;
  border-top: 1px solid var(--sw-silver-200);
  padding-top: 6px;
}

.sw-dropdown__sep a {
  font-weight: 760;
}

/* Mega dropdown for Guides (Materials / Size & Fit / Care / Mini) */
.sw-dropdown--mega {
  left: 50%;
  transform: translate(-50%, 8px);
  min-width: 0;
  width: max-content;
  max-width: min(92vw, 760px);
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 4px 24px;
  padding: 18px 20px;
}

.sw-nav__item:hover > .sw-dropdown--mega,
.sw-nav__item:focus-within > .sw-dropdown--mega {
  transform: translate(-50%, 0);
}

.sw-mega__group {
  min-width: 0;
}

.sw-mega__group b {
  display: block;
  color: var(--sw-blue-900);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 4px 12px 6px;
}

.sw-mega__group a {
  padding: 8px 12px;
}

/* Header actions: icon buttons + CTA */
.sw-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sw-icon-btn {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sw-silver-300);
  border-radius: 14px;
  background: #fff;
  color: var(--sw-blue-900);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.sw-icon-btn:hover {
  background: var(--sw-silver-100);
  color: var(--sw-blue-700);
}

.sw-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Currency switcher (Avy Currency Switcher plugin) — trigger harmonized
   with the neighboring .sw-icon-btn chrome. */
.sw-actions .avy-currency__trigger {
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--sw-silver-300);
  border-radius: 14px;
  background: #fff;
  color: var(--sw-blue-900);
  font-size: 0.8rem;
}

.sw-actions .avy-currency__trigger:hover,
.sw-actions .avy-currency__trigger:focus-visible,
.sw-actions .avy-currency__trigger[aria-expanded="true"] {
  background: var(--sw-silver-100);
  color: var(--sw-blue-700);
  outline: none;
}

/* Mobile: the header action row is tight; the mobile menu carries the
   switcher instance instead (mirrors the plugin's own two-instance pattern). */
@media (max-width: 900px) {
  .sw-actions .avy-currency {
    display: none;
  }
}

/* Switcher inside the mobile menu: full-width trigger, inline dropdown
   (static, so the scrollable menu panel never clips it). Plugin default
   container is inline-flex (row) — children must stack or the static
   dropdown would sit beside the trigger instead of below it. */
.sw-mobile-menu .avy-currency {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 2px 10px;
  border-bottom: 1px solid var(--sw-silver-200);
}

.sw-mobile-menu .avy-currency__trigger {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--sw-blue-900);
  font-size: 0.85rem;
}

.sw-mobile-menu .avy-currency__trigger:hover,
.sw-mobile-menu .avy-currency__trigger:focus-visible,
.sw-mobile-menu .avy-currency__trigger[aria-expanded="true"] {
  background: var(--sw-silver-100);
  color: var(--sw-blue-700);
  outline: none;
}

.sw-mobile-menu .avy-currency__menu {
  position: static;
  margin-top: 6px;
  border: 1px solid var(--sw-silver-200);
  box-shadow: none;
}

/* Cart badge — reuses .avy-header__cart-count for the AJAX fragment,
   restyled here with higher specificity to match the saiwei palette. */
.sw-icon-btn .avy-header__cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--sw-blue-700);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sw-icon-btn .avy-header__cart-count:empty {
  display: none;
}

/* Hamburger */
.sw-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--sw-silver-300);
  border-radius: 14px;
  background: var(--sw-cream);
  color: var(--sw-blue-900);
  cursor: pointer;
  place-items: center;
}

.sw-menu-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
}

/* CTA — saiwei .btn.btn-primary with soft-UI pill radius */
.sw-cta {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--sw-blue-700);
  color: #fff;
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(31, 93, 204, 0.22);
  transition: 0.2s ease;
  white-space: nowrap;
}

.sw-cta:hover {
  background: var(--sw-blue-800);
  color: #fff;
  transform: translateY(-2px);
}

/* Mobile menu panel (saiwei .mobile-menu) */
.sw-mobile-menu {
  position: absolute;
  top: 76px;
  left: 18px;
  right: 18px;
  background: var(--sw-cream);
  border: 1px solid var(--sw-silver-300);
  border-radius: 18px;
  box-shadow: 0 24px 55px rgba(16, 42, 86, 0.14);
  padding: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 96px);
  z-index: 60;
}

.sw-mobile-menu a {
  display: block;
  padding: 13px 12px;
  border-bottom: 1px solid var(--sw-silver-200);
  font-weight: 760;
  font-size: 0.85rem;
  color: #33415c;
}

.sw-mobile-menu a:hover {
  color: var(--sw-blue-700);
}

.sw-mobile-menu a:last-child {
  border-bottom: 0;
}

.sw-mobile-menu a.sw-mobile-menu__sub {
  padding-left: 28px;
  font-weight: 600;
  color: var(--sw-silver-600);
}

/* Non-link group header — mobile mirror of the desktop sw-nav__label /
   mega-dropdown <b> group titles, so both ends show the same catalogue. */
.sw-mobile-menu .sw-mobile-menu__group {
  display: block;
  padding: 15px 12px 7px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-silver-500);
  border-bottom: 1px solid var(--sw-silver-200);
  cursor: default;
}

.sw-mobile-menu .sw-mobile-menu__group--sub {
  padding-left: 28px;
}

.sw-mobile-menu a[aria-current="page"] {
  font-weight: 800;
}

/* ============================================================
   FOOTER — graphite #0B0D10, lime group headings (chrome v2 sw-foot)
   ============================================================ */
.sw-footer {
  background: #0b0d10;
  color: #fff;
}

/* Brand wrapper + five link groups share a 6-track grid; the nav wrapper
   is display:contents so its groups participate directly. */
.sw-footer__inner {
  width: min(calc(100% - 36px), 1180px);
  margin: auto;
  padding: 46px 0 22px;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr 1fr 1fr;
  gap: 26px;
}

.sw-footer__links {
  display: contents;
}

.sw-footer__brand {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sw-footer__desc {
  max-width: 300px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.85rem;
  line-height: 1.6;
}

.sw-footer__group b {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c7ff2e;
  margin-bottom: 10px;
  font-weight: 700;
}

/* Second inline heading inside a column (LEGAL within Company) */
.sw-footer__group b.sw-footer__gap {
  margin-top: 16px;
}

.sw-footer__group a {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  padding: 3px 0;
}

.sw-footer__group a:hover {
  color: #fff;
}

.sw-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 24px 18px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.74rem;
  text-align: center;
}

/* ============================================================
   Responsive breakpoints (mirror saiwei-p003)
   ============================================================ */
@media (max-width: 1080px) {
  .sw-nav {
    gap: 14px;
  }

  .sw-nav__link {
    font-size: 0.9rem;
  }
}

@media (max-width: 980px) {
  .sw-footer__inner {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .sw-footer__branding {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  /* Hide the whole nav wrapper (not just .sw-nav): as a grid child it would
     otherwise occupy a cell and wrap .sw-actions onto a second row. */
  .sw-header__inner > nav,
  .sw-cta {
    display: none;
  }

  .sw-header__inner {
    grid-template-columns: 1fr auto;
  }

  .sw-menu-btn {
    display: grid;
  }
}

@media (max-width: 620px) {
  .sw-header,
  .sw-footer {
    --sw-content: min(calc(100% - 26px), 1350px);
  }

  .sw-header__inner {
    min-height: 70px;
  }

  .sw-mobile-menu {
    top: 70px;
    left: 13px;
    right: 13px;
  }

  .sw-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-header *,
  .sw-footer * {
    transition: none !important;
  }
}

/* ============================================================
   BACK TO TOP (#avyBackToTop)
   Base look (size/colors/transition) lives in avy-design-system.css;
   these overrides only re-anchor the button into the same right-edge
   column as the avy-ai-chat launcher so the two stack vertically:
   chat root is fixed bottom 85px / right 33px with a 48px bubble.
   Loads after avy-design-system.css (enqueue dependency), so equal
   specificity wins here, including against its 768px media rule.
   ============================================================ */
.avy-back-to-top {
  right: 33px; /* same column as the chat launcher */
  bottom: 25px; /* chat bottom 85px − 48px bubble − 12px gap */
}

@media (max-width: 600px) {
  /* Mirrors the chat widget's own 600px breakpoint: root moves to
     bottom 70px / right 15px with a 54px bubble. Center-align the
     (44px, from avy-design) button with the launcher's center at 42px. */
  .avy-back-to-top {
    right: 20px;
    bottom: 16px; /* 70 − 44 − 10 gap */
  }
}
