html,
body,
#root {
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html,
  body,
  #root {
    overflow-x: clip;
  }
}

header.fixed {
  width: 100%;
  max-width: 100vw;
  transform: translateZ(0);
  backface-visibility: hidden;
}

header.fixed > div {
  width: 100%;
  max-width: 1400px;
}

/* Keep routed page titles clear of the fixed top bar. The home hero stays full-bleed. */
:root {
  --am-page-top-clearance: 104px;
  --am-nested-page-top-clearance: 56px;
}

@media (min-width: 768px) {
  :root {
    --am-page-top-clearance: 124px;
    --am-nested-page-top-clearance: 76px;
  }
}

header.fixed ~ main > div:not(.h-screen) {
  scroll-margin-top: var(--am-page-top-clearance);
}

header.fixed ~ main > div[class*="py-8"]:not(.h-screen),
header.fixed ~ main > div[class*="py-12"]:not(.h-screen),
header.fixed ~ main > div[class*="py-20"]:not(.h-screen) {
  padding-top: var(--am-page-top-clearance) !important;
}

header.fixed ~ main > div[class*="bg-[#0a0a0a]"][class*="text-white"]:not(.h-screen):not([class*="py-"]) {
  padding-top: var(--am-nested-page-top-clearance) !important;
}

[class~="translate-x-full"] {
  pointer-events: none;
}

@media (max-width: 480px) {
  header.fixed > div {
    padding-left: 16px;
    padding-right: 16px;
  }

  header.fixed > div > div {
    gap: 10px;
    min-width: 0;
  }

  header.fixed a[href="/"] {
    min-width: 0;
    flex: 1 1 auto;
  }

  header.fixed a[href="/"] span:first-child {
    max-width: calc(100vw - 140px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.1em;
  }

  header.fixed button[aria-label="Cart"],
  header.fixed button[aria-label="Open menu"],
  header.fixed button[aria-label="Close menu"] {
    min-width: 36px;
    min-height: 36px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 36px;
  }
}
