/* Keep the compact header focused on identity, appearance and navigation.
   The structural selectors support the retained production header markup. */
@media (max-width: 1359px) {
  .sf-storefront > header .sf-header-socials,
  .sf-storefront > header [class~='min-[1360px]:hidden']:has(> a[aria-label='Facebook']) {
    display: none;
  }

  .sf-storefront > header a:has(> img[alt='Sovereign Flame Phoenix']) {
    min-height: 44px;
  }
  .sf-storefront > header a:has(> img[alt='Sovereign Flame Phoenix']) > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
  }
  .sf-storefront > header a:has(> img[alt='Sovereign Flame Phoenix']) > div > span {
    margin-block: 0;
  }
  .sf-storefront > header a:has(> img[alt='Sovereign Flame Phoenix']) > div > span:first-child {
    font-size: 10px;
  }
  .sf-storefront > header a:has(> img[alt='Sovereign Flame Phoenix']) > div > span:nth-child(2) {
    font-size: 13px;
    white-space: nowrap;
  }
  .sf-storefront > header a:has(> img[alt='Sovereign Flame Phoenix']) > div > span:last-child {
    font-size: 9px;
    align-self: flex-end;
  }

  .sf-storefront > header .sf-mobile-socials,
  .sf-storefront > header > .fixed div:has(> span + div > a[aria-label='Facebook']) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-inline: 8px;
  }
  .sf-storefront > header .sf-mobile-socials > div,
  .sf-storefront > header > .fixed div:has(> span + div > a[aria-label='Facebook']) > div {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    gap: 8px;
  }
  .sf-storefront > header .sf-mobile-socials > div > a,
  .sf-storefront > header > .fixed div:has(> span + div > a[aria-label='Facebook']) > div > a {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
}

/* Denser menu rhythm without shrinking the 44px navigation/touch targets. */
@media (max-width: 1359px) {
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] {
    left: 12px;
    right: 12px;
    /* Frozen live markup sets these two properties inline. */
    top: calc(var(--sf-header-offset, 96px) - 8px) !important;
    max-height: calc(100dvh - var(--sf-header-offset, 96px)) !important;
    overscroll-behavior: contain;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div {
    padding: 8px;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div > * + * {
    margin-top: 2px;
    margin-bottom: 0;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div > a:not(.group),
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div > div > button,
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div > .border-t > :is(a, button) {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 20px;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div > a.group {
    min-height: 44px;
    margin-block: 4px;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] > div > div.border-t {
    margin-top: 6px;
    padding-top: 6px;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] :is(#sf-mobile-mastery-menu, #sf-mobile-more-menu) {
    margin: 2px 0 2px 8px;
  }
  .sf-storefront > header > .fixed[class~='min-[1360px]:hidden'] :is(#sf-mobile-mastery-menu, #sf-mobile-more-menu) a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: 6px 12px;
  }
  .sf-storefront > header .sf-mobile-socials,
  .sf-storefront > header > .fixed div:has(> span + div > a[aria-label='Facebook']) {
    width: 100%;
    gap: 6px;
    padding-inline: 0;
  }
  .sf-storefront > header .sf-mobile-socials > div,
  .sf-storefront > header > .fixed div:has(> span + div > a[aria-label='Facebook']) > div {
    width: 100%;
    grid-template-columns: repeat(auto-fit, 44px);
    gap: 4px;
  }
}
