/* 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:is([alt='Sovereign Flame Phoenix'], [alt='Sovereign Flame Shop'])) {
    min-height: 44px;
  }
  .sf-storefront > header a:has(> img:is([alt='Sovereign Flame Phoenix'], [alt='Sovereign Flame Shop'])) > div:not(.sf-shop-desktop-wordmark) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
  }
  .sf-storefront > header a:has(> img:is([alt='Sovereign Flame Phoenix'], [alt='Sovereign Flame Shop'])) > div > span {
    margin-block: 0;
    line-height: 1.05;
  }
  .sf-storefront > header a:has(> img:is([alt='Sovereign Flame Phoenix'], [alt='Sovereign Flame Shop'])) > div > span:first-child {
    font-size: 11px;
    margin-bottom: -4px;
  }
  .sf-storefront > header a:has(> img:is([alt='Sovereign Flame Phoenix'], [alt='Sovereign Flame Shop'])) > div > span:nth-child(2) {
    font-size: clamp(18px, 4.8vw, 22px);
    white-space: nowrap;
  }
  .sf-storefront > header a:has(> img:is([alt='Sovereign Flame Phoenix'], [alt='Sovereign Flame Shop'])) > div > span:last-child {
    font-size: 10px;
    margin-top: -4px;
    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;
  }
}

/* Shared compact identity and controls, retaining shop destinations and cart. */
@media (max-width: 1359px) {
  .sf-shop {
    --sf-header-offset: calc(78px + env(safe-area-inset-top)) !important;
  }
  .sf-shop > header {
    inset: 0 0 auto;
    padding: env(safe-area-inset-top) 0 0;
    border: 0;
    background: transparent !important;
    backdrop-filter: none;
    z-index: 350;
  }
  .sf-shop > header > div:first-child {
    display: none;
  }
  .sf-shop > header > div:nth-child(2) {
    height: 62px;
    max-width: 1560px;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgb(var(--sf-border));
    background: rgb(var(--sf-chrome) / 0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  }
  .sf-shop > header > div:nth-child(2) > a {
    gap: 12px;
    flex-shrink: 0;
  }
  .sf-shop > header > div:nth-child(2) > a > img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  .sf-shop > header .sf-shop-desktop-wordmark,
  .sf-shop > header nav {
    display: none;
  }
  .sf-shop > header > div:nth-child(2) > div:last-child {
    gap: 8px;
  }
  .sf-shop > header > div:nth-child(2) > div:last-child > :not(.sf-theme-toggle):not([data-shop-menu-toggle]) {
    display: none;
  }
  .sf-shop > header [data-shop-menu-toggle] {
    display: inline-flex;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
  }
  .sf-shop > header [data-shop-mobile-menu] {
    display: block;
    position: fixed;
    top: calc(var(--sf-header-offset) - 8px);
    left: 12px;
    right: 12px;
    max-height: calc(100dvh - var(--sf-header-offset));
    overflow-y: auto;
    overscroll-behavior: contain;
    font-family: Inter, sans-serif;
    border: 1px solid rgb(var(--sf-border));
    border-radius: 16px;
    background: rgb(var(--sf-surface)) !important;
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.2);
  }
  .sf-shop > header [data-shop-mobile-menu] > div {
    padding: 8px;
    gap: 2px;
  }
  .sf-shop > header [data-shop-mobile-menu] :is(a, button) {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 20px;
    border-radius: 12px;
  }
  .sf-shop > header [data-shop-menu-cart] {
    width: 100%;
    border: 1px solid rgb(var(--sf-accent) / 0.5);
    background: rgb(var(--sf-surface));
    color: rgb(var(--sf-foreground));
    text-align: left;
  }
}
@media (min-width: 768px) and (max-width: 1359px) {
  .sf-shop {
    --sf-header-offset: calc(90px + env(safe-area-inset-top)) !important;
  }
  .sf-shop > header {
    padding: calc(env(safe-area-inset-top) + 12px) 32px 0;
  }
  .sf-shop > header > div:nth-child(2) {
    border-radius: 999px;
    padding-inline: 16px;
  }
}
@media (min-width: 1024px) and (max-width: 1359px) {
  .sf-shop > header {
    padding-inline: 48px;
  }
}
@media (min-width: 1360px) {
  .sf-shop > header .sf-shop-mobile-wordmark,
  .sf-shop > header [data-shop-menu-cart] {
    display: none;
  }
}
