/* Shelf header + footer chrome (index.html look) on non-home pages */

:root {
  --shelf-chrome-bg: #f5f4f1;
  --shelf-chrome-ink: #0a0a0a;
  --shelf-chrome-ink2: #555550;
  --shelf-chrome-ink3: #999992;
  --shelf-chrome-border: rgba(10, 10, 10, 0.09);
  --shelf-chrome-border2: rgba(10, 10, 10, 0.17);
  --shelf-chrome-font-disp: "Space Grotesk", "DM Sans", sans-serif;
  --shelf-chrome-font-mono: "Space Mono", "DM Mono", monospace;
}

body.site-shelf-chrome .skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10060;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--shelf-chrome-ink);
  border: 1px solid var(--shelf-chrome-border2);
  font-family: var(--shelf-chrome-font-mono);
  font-size: 11px;
  text-decoration: none;
}

body.site-shelf-chrome .skip-link:focus {
  left: 1rem;
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  width: auto;
  height: auto;
  overflow: visible;
  outline: 2px solid var(--shelf-chrome-ink);
  outline-offset: 2px;
}

body.site-shelf-chrome #site-header.site-header-bar,
body.site-shelf-chrome .site-header-bar {
  background: rgba(245, 244, 241, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: none !important;
  box-shadow: none !important;
  font-family: var(--shelf-chrome-font-mono) !important;
  font-weight: 500 !important;
}

body.site-shelf-chrome .shelf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

body.site-shelf-chrome .shelf-header-meta #disco-ball,
body.site-shelf-chrome .shelf-header-meta #settings-btn,
body.site-shelf-chrome .shelf-header-meta #header-tempo-toggle,
body.site-shelf-chrome
  .shelf-header-meta
  .mobile-header-meta-icon-wrap:has(#disco-ball),
body.site-shelf-chrome
  .shelf-header-meta
  .mobile-header-meta-icon-wrap:has(#header-tempo-toggle) {
  display: none !important;
}

body.site-shelf-chrome .mobile-header-brand {
  font-family: var(--shelf-chrome-font-mono) !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  color: var(--shelf-chrome-ink) !important;
  text-transform: lowercase;
}

body.site-shelf-chrome .mobile-header-brand:hover {
  color: var(--shelf-chrome-ink2) !important;
}

body.site-shelf-chrome .header-btn {
  font-family: var(--shelf-chrome-font-mono) !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--shelf-chrome-ink2) !important;
  border: none !important;
  background: transparent !important;
  padding: 0.35rem 0.5rem !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.site-shelf-chrome .header-btn:hover {
  color: var(--shelf-chrome-ink) !important;
  background: transparent !important;
  transform: none !important;
}

body.site-shelf-chrome #auth-btn.header-btn {
  border: 1px solid var(--shelf-chrome-border2) !important;
  border-radius: 999px !important;
  padding: 0.4rem 0.9rem !important;
  color: var(--shelf-chrome-ink) !important;
  background: #faf8f4 !important;
}

body.site-shelf-chrome #auth-btn.header-btn:hover {
  background: #eeecea !important;
}

body.site-shelf-chrome .mobile-header-actions-track {
  gap: 0.15rem 0.75rem;
}

body.site-shelf-chrome .tools-dropdown-panel {
  background: #fff !important;
  border: 1px solid var(--shelf-chrome-border2) !important;
  border-radius: 4px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07) !important;
}

body.site-shelf-chrome .tools-dropdown-panel a {
  font-family: var(--shelf-chrome-font-mono) !important;
  font-size: 11px !important;
  color: var(--shelf-chrome-ink2) !important;
  letter-spacing: 0.04em !important;
}

body.site-shelf-chrome .tools-dropdown-panel a:hover {
  color: var(--shelf-chrome-ink) !important;
}

body.site-shelf-chrome #site-header.site-header--has-warning .mobile-header-shell,
body.site-shelf-chrome #site-header.site-header--has-warning .shelf-header-inner {
  border-bottom: 1px solid var(--shelf-chrome-border) !important;
}

body.site-shelf-chrome .shelf-site-footer {
  background: var(--shelf-chrome-bg) !important;
  border-top: 1px solid var(--shelf-chrome-border) !important;
  font-family: var(--shelf-chrome-font-mono) !important;
  font-size: 11px !important;
  color: var(--shelf-chrome-ink3) !important;
}

body.site-shelf-chrome .shelf-site-footer a {
  color: var(--shelf-chrome-ink2) !important;
  text-decoration: none !important;
}

body.site-shelf-chrome .shelf-site-footer a:hover {
  color: var(--shelf-chrome-ink) !important;
}

body.site-shelf-chrome .shelf-page-wrap {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

body.site-shelf-chrome.site-shell {
  padding-top: calc(
    var(--studio-header-stack, 9.75rem) + env(safe-area-inset-top, 0px)
  ) !important;
}

body.site-shelf-chrome #main-content {
  padding-top: calc(
    var(--studio-header-stack, 9.75rem) + env(safe-area-inset-top, 0px)
  ) !important;
}

body.site-shelf-chrome.about-page {
  padding-top: calc(
    var(--studio-header-stack, 9.75rem) + env(safe-area-inset-top, 0px)
  ) !important;
}

body.site-shelf-chrome.about-page .v2-topbar {
  display: none !important;
}

@media (min-width: 561px) {
  body.site-shelf-chrome .shelf-header-extra {
    display: inline-flex;
  }
}

/* ── Mobile header + layout (all shelf chrome pages) ── */
@media (max-width: 1180px) {
  body.site-shelf-chrome,
  body.index-shelf,
  body.product-shelf,
  body.catalog-shelf,
  body.producer-network-shelf {
    --studio-header-stack: calc(11.25rem + env(safe-area-inset-top, 0px));
  }
}

@media (max-width: 768px) {
  body.site-shelf-chrome,
  body.index-shelf,
  body.product-shelf,
  body.catalog-shelf,
  body.producer-network-shelf {
    --studio-header-stack: calc(13.5rem + env(safe-area-inset-top, 0px));
  }

  html.site-shell:has(body.site-shelf-chrome),
  html:has(body.index-shelf),
  html:has(body.product-shelf),
  html:has(body.catalog-shelf),
  html:has(body.producer-network-shelf) {
    scroll-padding-top: calc(
      var(--studio-header-stack, 13.5rem) + env(safe-area-inset-top, 0px)
    );
  }

  body.site-shelf-chrome #site-header.site-header-bar,
  body.index-shelf #site-header.site-header-bar,
  body.product-shelf #site-header.site-header-bar,
  body.catalog-shelf #site-header.site-header-bar,
  body.producer-network-shelf #site-header.site-header-bar {
    z-index: 100 !important;
  }

  body.site-shelf-chrome #site-header.site-header-scroll-hidden,
  body.index-shelf #site-header.site-header-scroll-hidden,
  body.product-shelf #site-header.site-header-scroll-hidden,
  body.catalog-shelf #site-header.site-header-scroll-hidden,
  body.producer-network-shelf #site-header.site-header-scroll-hidden {
    transform: none !important;
  }

  body.site-shelf-chrome .shelf-header-inner.mobile-header-shell,
  body.index-shelf .shelf-header-inner.mobile-header-shell,
  body.product-shelf .shelf-header-inner.mobile-header-shell,
  body.catalog-shelf .shelf-header-inner.mobile-header-shell,
  body.producer-network-shelf .shelf-header-inner.mobile-header-shell,
  #site-header .shelf-header-inner.mobile-header-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "brand meta"
      "nav nav" !important;
    align-items: center !important;
    gap: 8px 10px !important;
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 10px !important;
  }

  body.site-shelf-chrome .mobile-header-brand,
  body.index-shelf .mobile-header-brand,
  body.product-shelf .mobile-header-brand,
  body.catalog-shelf .mobile-header-brand,
  body.producer-network-shelf .mobile-header-brand,
  #site-header .mobile-header-brand {
    grid-area: brand !important;
    justify-self: start !important;
    align-self: center !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.site-shelf-chrome .mobile-header-actions,
  body.index-shelf .mobile-header-actions,
  body.product-shelf .mobile-header-actions,
  body.catalog-shelf .mobile-header-actions,
  body.producer-network-shelf .mobile-header-actions,
  #site-header .mobile-header-actions {
    grid-area: nav !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    overflow: visible !important;
    padding: 2px 0 4px !important;
  }

  body.site-shelf-chrome .mobile-header-meta,
  body.index-shelf .mobile-header-meta,
  body.product-shelf .mobile-header-meta,
  body.catalog-shelf .mobile-header-meta,
  body.producer-network-shelf .mobile-header-meta,
  #site-header .mobile-header-meta {
    grid-area: meta !important;
    justify-self: end !important;
    align-self: center !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
    row-gap: 4px !important;
  }

  body.site-shelf-chrome .mobile-header-actions-track,
  body.index-shelf .mobile-header-actions-track,
  body.product-shelf .mobile-header-actions-track,
  body.catalog-shelf .mobile-header-actions-track,
  body.producer-network-shelf .mobile-header-actions-track,
  #site-header .mobile-header-actions-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scroll-snap-type: x proximity !important;
    padding-block: 4px !important;
    padding-inline-end: 12px !important;
    scrollbar-width: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  body.site-shelf-chrome .mobile-header-actions-track::-webkit-scrollbar,
  body.index-shelf .mobile-header-actions-track::-webkit-scrollbar,
  body.product-shelf .mobile-header-actions-track::-webkit-scrollbar,
  body.catalog-shelf .mobile-header-actions-track::-webkit-scrollbar,
  body.producer-network-shelf .mobile-header-actions-track::-webkit-scrollbar,
  #site-header .mobile-header-actions-track::-webkit-scrollbar {
    display: none !important;
  }

  body.site-shelf-chrome .shelf-header-extra,
  body.index-shelf .shelf-header-extra,
  body.product-shelf .shelf-header-extra,
  body.catalog-shelf .shelf-header-extra,
  body.producer-network-shelf .shelf-header-extra {
    display: inline-flex !important;
  }

  body.site-shelf-chrome .mobile-header-actions-track > .header-btn,
  body.index-shelf .mobile-header-actions-track > .header-btn,
  body.product-shelf .mobile-header-actions-track > .header-btn,
  body.catalog-shelf .mobile-header-actions-track > .header-btn,
  body.producer-network-shelf .mobile-header-actions-track > .header-btn,
  #site-header .mobile-header-actions-track > .header-btn,
  body.site-shelf-chrome #auth-btn.header-btn,
  body.index-shelf #auth-btn.header-btn,
  body.product-shelf #auth-btn.header-btn,
  body.catalog-shelf #auth-btn.header-btn,
  body.producer-network-shelf #auth-btn.header-btn,
  body.site-shelf-chrome #cart-header-btn.header-btn,
  body.index-shelf #cart-header-btn.header-btn,
  body.product-shelf #cart-header-btn.header-btn,
  body.catalog-shelf #cart-header-btn.header-btn,
  body.producer-network-shelf #cart-header-btn.header-btn,
  body.site-shelf-chrome .mobile-header-meta .mobile-header-auth-btn,
  body.index-shelf .mobile-header-meta .mobile-header-auth-btn,
  body.product-shelf .mobile-header-meta .mobile-header-auth-btn,
  body.catalog-shelf .mobile-header-meta .mobile-header-auth-btn,
  body.producer-network-shelf .mobile-header-meta .mobile-header-auth-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 10px 14px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border-radius: 3px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--shelf-chrome-ink2, #555550) !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    transform: none !important;
  }

  body.site-shelf-chrome #auth-btn.header-btn,
  body.index-shelf #auth-btn.header-btn,
  body.product-shelf #auth-btn.header-btn,
  body.catalog-shelf #auth-btn.header-btn,
  body.producer-network-shelf #auth-btn.header-btn {
    border-color: var(--shelf-chrome-border2, rgba(10, 10, 10, 0.17)) !important;
    background: #fff !important;
    color: var(--shelf-chrome-ink, #0a0a0a) !important;
  }

  body.site-shelf-chrome .mobile-header-actions-track > .header-btn:hover,
  body.index-shelf .mobile-header-actions-track > .header-btn:hover,
  body.product-shelf .mobile-header-actions-track > .header-btn:hover,
  body.catalog-shelf .mobile-header-actions-track > .header-btn:hover,
  body.producer-network-shelf .mobile-header-actions-track > .header-btn:hover,
  #site-header .mobile-header-actions-track > .header-btn:hover {
    color: var(--shelf-chrome-ink, #0a0a0a) !important;
    background: rgba(10, 10, 10, 0.04) !important;
    border-color: var(--shelf-chrome-border2, rgba(10, 10, 10, 0.17)) !important;
    transform: none !important;
  }

  body.site-shelf-chrome.site-shell,
  body.site-shelf-chrome #main-content,
  body.index-shelf #main-content,
  body.product-shelf #main-content,
  body.product-shelf .product-page-main,
  body.catalog-shelf #main-content,
  body.producer-network-shelf #main-content {
    padding-top: calc(
      var(--studio-header-stack, 13.5rem) + env(safe-area-inset-top, 0px)
    ) !important;
  }
}

@media (max-width: 480px) {
  body.site-shelf-chrome .mobile-header-actions-track > .header-btn,
  body.index-shelf .mobile-header-actions-track > .header-btn,
  body.product-shelf .mobile-header-actions-track > .header-btn,
  body.catalog-shelf .mobile-header-actions-track > .header-btn,
  body.producer-network-shelf .mobile-header-actions-track > .header-btn,
  body.site-shelf-chrome #auth-btn.header-btn,
  body.index-shelf #auth-btn.header-btn,
  body.product-shelf #auth-btn.header-btn,
  body.catalog-shelf #auth-btn.header-btn,
  body.producer-network-shelf #auth-btn.header-btn,
  body.site-shelf-chrome #cart-header-btn.header-btn,
  body.index-shelf #cart-header-btn.header-btn,
  body.product-shelf #cart-header-btn.header-btn,
  body.catalog-shelf #cart-header-btn.header-btn,
  body.producer-network-shelf #cart-header-btn.header-btn {
    min-width: 0 !important;
    padding: 8px 10px !important;
    font-size: 10px !important;
  }
}
