/* Public storefront header; keep its original space in the document flow. */
.header[data-sticky-header] {
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 5px 18px rgba(25, 33, 40, .07);
}
html:has(body.has-sticky-header) {
  scroll-padding-top: calc(var(--shop-header-height, 142px) + 16px);
}
.header[data-sticky-header] .suggestions {
  max-height: min(360px, calc(100vh - var(--shop-header-bottom, 142px) - 16px));
  max-height: min(360px, calc(100dvh - var(--shop-header-bottom, 142px) - 16px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 801px) {
  body.has-sticky-header .checkout-layout > .summary {
    top: calc(var(--shop-header-height, 142px) + 20px);
  }
}
@media (max-width: 860px) {
  body.has-service-float .header[data-sticky-header] .suggestions {
    max-height: max(0px, min(360px, calc(100vh - var(--shop-header-bottom, 142px) - var(--service-float-height, 78px) - 16px)));
    max-height: max(0px, min(360px, calc(100dvh - var(--shop-header-bottom, 142px) - var(--service-float-height, 78px) - 16px)));
  }
}
@media (max-width: 800px) {
  /* Compact rows keep the hero more visible while preserving 44 px tap targets. */
  .header[data-sticky-header] .header-main {
    padding-top: 8px;
    padding-bottom: 8px;
    row-gap: 8px;
    column-gap: 12px;
  }
  .header[data-sticky-header] .header-main > .logo small { margin-top: 6px; }
  .header[data-sticky-header] .search { min-height: 44px; }
  .header[data-sticky-header] .search input {
    min-height: 44px;
    margin-top: 0;
    padding: 10px 12px;
  }
  .header[data-sticky-header] .search button,
  .header[data-sticky-header] .mobile-menu {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }
  .header[data-sticky-header] .cart-link {
    flex-shrink: 0;
    justify-content: center;
    width: 44px;
    min-height: 44px;
  }
  .header[data-sticky-header] .cart-link b { top: 0; left: 24px; }
  /* The menu overlays content instead of making the sticky header taller. */
  .header[data-sticky-header] .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: none;
    margin: 0;
    max-height: max(0px, calc(100vh - var(--shop-header-bottom, 142px) - 16px));
    max-height: max(0px, calc(100dvh - var(--shop-header-bottom, 142px) - 16px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(25, 33, 40, .1);
  }
  body.has-service-float .header[data-sticky-header] .nav {
    max-height: max(0px, calc(100vh - var(--shop-header-bottom, 142px) - var(--service-float-height, 78px) - 16px));
    max-height: max(0px, calc(100dvh - var(--shop-header-bottom, 142px) - var(--service-float-height, 78px) - 16px));
  }
}
@media print {
  .header[data-sticky-header] {
    position: static;
    box-shadow: none;
  }
  html:has(body.has-sticky-header) { scroll-padding-top: 0; }
  .header[data-sticky-header] .nav { position: static; }
}
