/* ================================================================
   SUPRBAD NAVIGATION — MOBILE FULLSCREEN PANEL SYSTEM
   Light/editorial — same visual language as desktop.
   Fullscreen overlay (needed for mobile usability) but warm palette.

   depth-1: section list
   depth-2: L2 list (for collaboration/theme sections)
   depth-3: illustration + label panel
   ================================================================ */

/* ── Mobile Menu Overlay ───────────────────────────────────────── */

.sb-nav-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--sb-z-mobile);
  background: var(--sb-color-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--sb-color-text);
  pointer-events: none;
  visibility: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.sb-nav-mobile-menu[data-panel-depth='0'] {
  visibility: hidden;
  pointer-events: none;
}

.sb-nav-mobile-menu[data-panel-depth='1'],
.sb-nav-mobile-menu[data-panel-depth='2'],
.sb-nav-mobile-menu[data-panel-depth='3'] {
  visibility: visible;
  pointer-events: auto;
}

/* ── Mobile Header ─────────────────────────────────────────────── */

.sb-nav-mobile-header {
  flex-shrink: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 var(--sb-header-px-mobile);
  border-bottom: 1px solid var(--sb-color-border);
}

.sb-nav-mobile-wordmark {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.sb-nav-mobile-wordmark svg {
  height: 18px;
  width: auto;
  display: block;
}

.sb-nav-mobile-utility {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.sb-nav-mobile-utility__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--sb-color-text);
  text-decoration: none;
  position: relative;
  opacity: 0.7;
  transition: opacity 120ms ease;
}

.sb-nav-mobile-utility__icon:hover {
  opacity: 1;
}

.sb-nav-mobile-utility__icon svg {
  width: 20px;
  height: 20px;
}

/* Cart badge: overlays top-right of the cart icon */
.sb-nav-mobile-cart-icon .sb-nav-cart-count {
  position: absolute;
  top: 4px;
  right: 0;
  min-width: 16px;
  height: 16px;
  border-radius: var(--sb-radius-md); /* F2: shared radius scale */
  background: var(--sb-color-text);
  color: var(--sb-color-bg);
  font-family: var(--sb-font-utility);
  font-size: 9px;
  font-weight: var(--sb-weight-regular);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Hide badge when cart is empty */
.sb-nav-mobile-cart-icon .sb-nav-cart-count[data-count='0'] {
  display: none;
}

.sb-nav-mobile-close {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  color: var(--sb-color-text);
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 120ms ease;
}

.sb-nav-mobile-close:hover {
  opacity: 1;
}
.sb-nav-mobile-close:focus-visible {
  outline: 2px solid var(--sb-color-text);
  outline-offset: 2px;
  opacity: 1;
}
.sb-nav-mobile-close svg {
  width: 20px;
  height: 20px;
}

/* ── Mobile Search ─────────────────────────────────────────────── */

.sb-nav-mobile-search {
  flex-shrink: 0;
  padding: 12px var(--sb-header-px-mobile);
  border-bottom: 1px solid var(--sb-color-border);
}

.sb-nav-mobile-search form {
  display: flex;
  align-items: center;
  border: 1px solid var(--sb-color-border);
  border-radius: var(--sb-radius-sm); /* F2: shared radius scale */
}

.sb-nav-mobile-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--sb-font-utility);
  font-weight: var(--sb-weight-light);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--sb-color-text);
  padding: 0 12px;
  height: 40px;
  outline: none;
}

.sb-nav-mobile-search__input::placeholder {
  color: var(--sb-color-text-muted);
  opacity: 1;
}

.sb-nav-mobile-search__submit {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  border-left: 1px solid var(--sb-color-border);
  cursor: pointer;
  color: var(--sb-color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: opacity 120ms ease;
}

.sb-nav-mobile-search__submit:hover {
  opacity: 0.6;
}
.sb-nav-mobile-search__submit svg {
  width: 16px;
  height: 16px;
}

/* ── Mobile Section Tab Row ────────────────────────────────────── */

.sb-nav-mobile-tabs {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--sb-header-px-mobile);
  gap: 24px;
  border-bottom: 1px solid var(--sb-color-border);
  height: 44px;
}

.sb-nav-mobile-tab {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sb-color-text-muted);
  padding: 0;
  position: relative;
  transition: color 120ms ease;
  flex-shrink: 0;
}

.sb-nav-mobile-tab[data-active='true'] {
  color: var(--sb-color-text);
}

.sb-nav-mobile-tab[data-active='true']::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--sb-color-text);
}

.sb-nav-mobile-tab[data-disabled='true'] {
  opacity: 0.25;
  pointer-events: none;
}

/* ── Panel Layer Container ─────────────────────────────────────── */

.sb-nav-mobile-panels {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ── Depth 1: Section list ─────────────────────────────────────── */

.sb-nav-mobile-depth1 {
  position: absolute;
  inset: 0;
  overflow: hidden auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition:
    transform var(--sb-dur-mobile) var(--sb-ease-std),
    opacity var(--sb-dur-mobile) ease;
}

.sb-nav-mobile-menu[data-panel-depth='1'] .sb-nav-mobile-depth1 {
  transform: translateX(0);
  opacity: 1;
}

.sb-nav-mobile-menu[data-panel-depth='2'] .sb-nav-mobile-depth1,
.sb-nav-mobile-menu[data-panel-depth='3'] .sb-nav-mobile-depth1 {
  transform: translateX(-28%);
  opacity: 0;
  pointer-events: none;
}

.sb-nav-mobile-menu[data-panel-depth='0'] .sb-nav-mobile-depth1 {
  transform: translateX(0);
  opacity: 0;
}

.sb-nav-mobile-section-item {
  border-bottom: 1px solid var(--sb-color-border);
}

.sb-nav-mobile-section-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px var(--sb-header-px-mobile);
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

.sb-nav-mobile-section-btn:focus-visible {
  outline: 2px solid var(--sb-color-text);
  outline-offset: -2px;
}

.sb-nav-mobile-section-btn__label {
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--sb-color-text);
  line-height: 1;
}

.sb-nav-mobile-section-btn__desc {
  font-family: var(--sb-font-utility);
  font-size: 12px;
  font-weight: var(--sb-weight-light);
  color: var(--sb-color-text-muted);
  margin-top: 4px;
  display: block;
}

.sb-nav-mobile-section-btn__arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--sb-color-text-muted);
  margin-left: 16px;
}

.sb-nav-mobile-section-item[data-disabled='true'] .sb-nav-mobile-section-btn {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Depth 2: L2 list ──────────────────────────────────────────── */

.sb-nav-mobile-depth2 {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform var(--sb-dur-mobile) var(--sb-ease-std),
    opacity var(--sb-dur-mobile) ease;
}

.sb-nav-mobile-menu[data-panel-depth='1'] .sb-nav-mobile-depth2 {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.sb-nav-mobile-menu[data-panel-depth='2'] .sb-nav-mobile-depth2 {
  transform: translateX(0);
  opacity: 1;
}

.sb-nav-mobile-menu[data-panel-depth='3'] .sb-nav-mobile-depth2 {
  transform: translateX(-28%);
  opacity: 0;
  pointer-events: none;
}

.sb-nav-mobile-menu[data-panel-depth='0'] .sb-nav-mobile-depth2 {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.sb-nav-mobile-depth2__header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding: 14px var(--sb-header-px-mobile) 12px;
  border-bottom: 1px solid var(--sb-color-border);
  gap: 12px;
}

.sb-nav-mobile-back {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  color: var(--sb-color-text-muted);
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-nav-mobile-back:focus-visible {
  outline: 2px solid var(--sb-color-text);
  outline-offset: 2px;
  border-radius: 2px;
}
.sb-nav-mobile-back svg {
  width: 18px;
  height: 18px;
}

.sb-nav-mobile-depth2__title-block {
  flex: 1;
}

.sb-nav-mobile-depth2__title {
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--sb-color-text);
  line-height: 1;
  display: block;
}

.sb-nav-mobile-depth2__section-desc {
  font-family: var(--sb-font-utility);
  font-size: 12px;
  font-weight: var(--sb-weight-light);
  color: var(--sb-color-text-muted);
  margin-top: 5px;
  display: block;
  line-height: 1.4;
}

.sb-nav-mobile-l2-list {
  flex: 1;
  overflow: hidden auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sb-nav-mobile-l2-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--sb-header-px-mobile);
  border-bottom: 1px solid var(--sb-color-border);
  cursor: pointer;
  touch-action: manipulation;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.sb-nav-mobile-l2-item:focus-visible {
  outline: 2px solid var(--sb-color-text);
  outline-offset: -2px;
}

.sb-nav-mobile-l2-item__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sb-nav-mobile-l2-item__name {
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--sb-color-text);
  display: block;
}

.sb-nav-mobile-l2-item__desc {
  font-family: var(--sb-font-utility);
  font-size: 11px;
  font-weight: var(--sb-weight-light);
  color: var(--sb-color-text-muted);
  display: block;
  line-height: 1.4;
}

.sb-nav-mobile-l2-item__arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--sb-color-text-muted);
  align-self: center;
}

/* ── Depth 3: Illustration panel ───────────────────────────────── */

.sb-nav-mobile-depth3 {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    transform var(--sb-dur-mobile) var(--sb-ease-std),
    opacity var(--sb-dur-mobile) ease;
}

.sb-nav-mobile-menu[data-panel-depth='1'] .sb-nav-mobile-depth3,
.sb-nav-mobile-menu[data-panel-depth='2'] .sb-nav-mobile-depth3 {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.sb-nav-mobile-menu[data-panel-depth='3'] .sb-nav-mobile-depth3 {
  transform: translateX(0);
  opacity: 1;
}

.sb-nav-mobile-menu[data-panel-depth='0'] .sb-nav-mobile-depth3 {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.sb-nav-mobile-depth3__header {
  flex-shrink: 0;
  padding: 16px var(--sb-header-px-mobile) 12px;
  border-bottom: 1px solid var(--sb-color-border);
  display: flex;
  align-items: flex-start;
}

.sb-nav-mobile-depth3__back {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  color: var(--sb-color-text-muted);
  padding: 4px 8px 4px 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sb-nav-mobile-depth3__back:focus-visible {
  outline: 2px solid var(--sb-color-text);
  outline-offset: 2px;
  border-radius: 2px;
}
.sb-nav-mobile-depth3__back svg {
  width: 18px;
  height: 18px;
}

.sb-nav-mobile-depth3__title-block {
  flex: 1;
}

.sb-nav-mobile-depth3__title {
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--sb-color-text);
  line-height: 1;
  display: block;
}

.sb-nav-mobile-depth3__subtitle {
  font-family: var(--sb-font-utility);
  font-size: 12px;
  font-weight: var(--sb-weight-light);
  color: var(--sb-color-text-muted);
  margin-top: 5px;
  display: block;
}

/* ── Mobile Illustration List ──────────────────────────────────── */

.sb-nav-mobile-illus-list {
  flex: 1;
  overflow: hidden auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 0 20px;
}

.sb-nav-mobile-illus-item {
  display: flex;
  align-items: center;
  padding: 10px var(--sb-header-px-mobile);
  cursor: pointer;
  text-decoration: none;
  gap: 0;
  position: relative;
  min-height: 110px;
}

.sb-nav-mobile-illus-item__garment {
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

.sb-nav-mobile-illus-item__garment svg.sb-garment {
  width: auto;
  max-width: 100%;
  max-height: 120px;
  color: var(--sb-color-text);
}

/* Image mode (M4, additive): raster garment mirrors the SVG constraints.
   Raster images cannot follow currentColor tinting — SVG mode only (spec §8.5). */
.sb-nav-mobile-illus-item__garment img.sb-garment--img {
  width: auto;
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.sb-nav-mobile-illus-item__connector {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.sb-nav-mobile-illus-item__connector svg.sb-mobile-connector {
  width: 100%;
  height: 100%;
  display: block;
  color: var(--sb-color-text);
  overflow: visible;
}

.sb-nav-mobile-illus-item__label {
  flex: 1;
  padding-left: 12px;
  display: flex;
  flex-direction: column;
}

.sb-nav-mobile-illus-item__name {
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 16px;
  letter-spacing: 0.03em;
  color: var(--sb-color-text);
  text-transform: uppercase;
  display: block;
}

.sb-nav-mobile-illus-item__product-desc {
  font-family: var(--sb-font-utility);
  font-size: 10px;
  font-weight: var(--sb-weight-light);
  color: var(--sb-color-text-muted);
  margin-top: 3px;
  display: block;
  line-height: 1.4;
}

/* ── Mobile Description Strip ──────────────────────────────────── */

/* Hidden: section + item descriptions are shown in panel headers. */

.sb-nav-mobile-strip {
  display: none;
}

.sb-nav-mobile-strip__asterisk {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  color: var(--sb-color-text-muted);
  margin-top: 2px;
}

.sb-nav-mobile-strip__content {
  flex: 1;
  transition: opacity var(--sb-dur-strip) ease;
}

.sb-nav-mobile-strip__content.is-transitioning {
  opacity: 0;
}

.sb-nav-mobile-strip__name {
  font-family: var(--sb-font-primary);
  font-weight: var(--sb-weight-black);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--sb-color-text);
  display: block;
  text-transform: uppercase;
}

.sb-nav-mobile-strip__desc {
  font-family: var(--sb-font-utility);
  font-size: 11px;
  font-weight: var(--sb-weight-light);
  color: var(--sb-color-text-muted);
  margin-top: 3px;
  display: block;
  line-height: 1.5;
}

/* ── Desktop: hide mobile menu ─────────────────────────────────── */

@media (min-width: 768px) {
  .sb-nav-mobile-menu {
    display: none !important;
  }
}

/* ── WP Admin Bar: mobile overlay padding ──────────────────────── */

/* The overlay uses position:fixed; inset:0 — full viewport coverage.
   The admin bar (z-index:99999) renders on top via z-index; no top
   shift is needed. padding-top pushes the first flex child (the mobile
   header row with wordmark and close button) below the admin bar.
   calc() combines admin-bar height with env(safe-area-inset-top) so
   both clearances are expressed in one declaration. This overrides the
   base rule's padding-top:env() for logged-in sessions only; logged-out
   sessions retain the base rule unchanged. */

body.admin-bar .sb-nav-mobile-menu {
  padding-top: calc(46px + env(safe-area-inset-top));
}

@media (min-width: 783px) {
  body.admin-bar .sb-nav-mobile-menu {
    padding-top: calc(32px + env(safe-area-inset-top));
  }
}

/* ── Hide native scrollbars ────────────────────────────────────── */

/* Scroll remains functional; arrows are the only overflow cue.    */

.sb-nav-mobile-depth1,
.sb-nav-mobile-l2-list,
.sb-nav-mobile-illus-list {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sb-nav-mobile-depth1::-webkit-scrollbar,
.sb-nav-mobile-l2-list::-webkit-scrollbar,
.sb-nav-mobile-illus-list::-webkit-scrollbar {
  display: none;
}

/* Larger tap target for mobile scroll indicators (44px vs 36px desktop) */
.sb-nav-mobile-menu .sb-nav-scroll-indicator[data-visible='true'] {
  height: 44px;
}

/* ── Navigation Feedback System (M7.6) ─────────────────────────── */

/* Mobile counterpart of the desktop rules in menu.css — same state
   channel (data-nav-committed), same tokens. See menu.css for the
   composition notes. */

.sb-nav-mobile-illus-item[data-nav-committed='true']
  .sb-nav-mobile-illus-item__garment
  svg.sb-garment,
.sb-nav-mobile-illus-item[data-nav-committed='true']
  .sb-nav-mobile-illus-item__connector
  svg.sb-mobile-connector,
.sb-nav-mobile-illus-item[data-nav-committed='true'] .sb-nav-mobile-illus-item__name {
  color: var(--sb-color-nav-commit);
}

/* No underline in ANY interaction state — same rationale as the
   desktop rule in menu.css (global a:focus/a:active rules re-underline
   the anchor at the moment of commit). */
a.sb-nav-mobile-illus-item,
a.sb-nav-mobile-illus-item:hover,
a.sb-nav-mobile-illus-item:focus,
a.sb-nav-mobile-illus-item:focus-visible,
a.sb-nav-mobile-illus-item:active,
a.sb-nav-mobile-illus-item:visited {
  text-decoration: none;
}

/* Sliding-window sweep — same technique and shape tokens as menu.css
   (see the composition notes there). Keyframes are redeclared here so
   mobile.css stays self-sufficient if menu.css is dequeued. */
.sb-nav-mobile-illus-item[data-nav-committed='true'] {
  background-image: linear-gradient(
    90deg,
    transparent var(--sb-nav-commit-sweep-from),
    var(--sb-color-nav-commit-soft) var(--sb-nav-commit-sweep-peak),
    transparent var(--sb-nav-commit-sweep-end)
  );
  background-repeat: no-repeat;
  background-size: 300% 100%;
  animation: sb-nav-commit-sweep var(--sb-dur-commit) var(--sb-ease-std) 1 forwards;
}

.sb-nav-mobile-menu[data-nav-committed='true']
  .sb-nav-mobile-illus-item:not([data-nav-committed='true']),
.sb-nav-mobile-menu[data-nav-committed='true'] .sb-nav-mobile-l2-item,
.sb-nav-mobile-menu[data-nav-committed='true'] .sb-nav-mobile-depth3__header,
.sb-nav-mobile-menu[data-nav-committed='true'] .sb-nav-mobile-depth2__header {
  opacity: var(--sb-opacity-nav-recede);
  transition: opacity var(--sb-dur-commit) var(--sb-ease-std);
}

.sb-nav-mobile-menu[data-nav-committed='true']
  .sb-nav-mobile-illus-item[data-nav-committed='true'] {
  opacity: 1;
}

@keyframes sb-nav-commit-sweep {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0% 0;
  }
}
