:root {
  --storefront-ink: #2c272b;
  --storefront-muted: #69666a;
  --storefront-line: #e7e4e5;
  --storefront-padding: clamp(16px, 3.1vw, 42px);
}

.storefront-mast,
.storefront-tools,
.storefront-bottom {
  color: var(--storefront-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

.storefront-mast {
  position: relative;
  z-index: 31;
  background: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}

.storefront-mast-row,
.storefront-tools-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--storefront-padding);
}

.storefront-mast-row {
  position: relative;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.storefront-brand.logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  justify-content: center;
}

.storefront-brand.logo img {
  width: 145px;
  height: auto;
}

.storefront-menu { position: relative; }

.storefront-menu summary,
.storefront-install {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--storefront-ink);
  cursor: pointer;
}

.storefront-menu summary { list-style: none; }
.storefront-menu summary::-webkit-details-marker { display: none; }

.storefront-mast svg,
.storefront-tools svg,
.storefront-bottom svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.storefront-menu-links {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: max-content;
  min-width: 195px;
  max-width: calc(100vw - 32px);
  display: grid;
  background: #fff;
  border: 1px solid var(--storefront-line);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 9px 32px #24202424;
}

.storefront-menu-links a {
  color: var(--storefront-ink);
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  border-radius: 7px;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
}

.storefront-wide-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.storefront-wide-nav .navbtn {
  min-height: 44px;
  min-width: 44px;
  padding: 4px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--storefront-muted);
  font-size: .875rem;
}

.storefront-wide-nav .navbtn.active {
  background: transparent;
  color: var(--storefront-ink);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.storefront-wide-nav .navbtn i {
  margin-left: 4px;
  padding-inline: 5px;
  border-radius: 9px;
  background: #5c4053;
  color: #fff;
  font: 650 .75rem/18px system-ui, sans-serif;
}

.storefront-tools {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--storefront-line);
  background: #fff;
}

.storefront-tools-inner { padding-block: 6px; }

.storefront-search {
  display: flex;
  align-items: center;
  gap: 0;
  width: min(100%, 860px);
  min-height: 44px;
  margin: 0 auto;
  padding: 0 10px 0 2px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f2f1f2;
}

.storefront-search button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: #524b51;
  background: transparent;
}

.storefront-search svg { width: 21px; height: 21px; }

.storefront-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 4px 4px 4px 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: var(--storefront-ink);
  font: inherit;
  font-size: 16px;
}

.storefront-search input::placeholder { color: #716970; opacity: 1; }
.storefront-search:focus-within { border-color: #715866; }

.storefront-departments {
  display: none;
  width: min(100%, 860px);
  margin: 2px auto -6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

body[data-view="home"] .storefront-departments { display: flex; }
.storefront-departments::-webkit-scrollbar { display: none; }
.storefront-departments button {
  position: relative;
  flex: 1 0 auto;
  min-height: 44px;
  min-width: 50px;
  padding: 2px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--storefront-muted);
  font-size: .89rem;
  font-weight: 600;
  letter-spacing: .015em;
  white-space: nowrap;
}

.storefront-departments button[aria-pressed="true"] { color: var(--storefront-ink); font-weight: 750; }
.storefront-departments button[aria-pressed="true"]::after {
  position: absolute;
  inset: auto 8px 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--storefront-ink);
  content: "";
}

.storefront-menu summary:focus-visible,
.storefront-install:focus-visible,
.storefront-menu-links a:focus-visible,
.storefront-wide-nav button:focus-visible,
.storefront-search button:focus-visible,
.storefront-departments button:focus-visible,
.storefront-bottom button:focus-visible {
  outline: 2px solid #715866;
  outline-offset: -3px;
}

#results, #giftResults { scroll-margin-top: 70px; }

@media (hover: hover) {
  .storefront-menu summary:hover,
  .storefront-install:hover,
  .storefront-menu-links a:hover { background: #f2f1f2; }
  .storefront-departments button:hover,
  .storefront-wide-nav .navbtn:hover { color: #2b1625; }
}

@media (min-width: 701px) and (max-width: 870px) {
  .storefront-mast-row .storefront-brand {
    position: static;
    transform: none;
  }
}

@media (max-width: 700px) {
  .storefront-mast-row { min-height: 48px; padding-inline: 9px; }
  .storefront-brand.logo img { width: 118px; }
  .storefront-wide-nav { display: none; }
  .storefront-install { margin-left: auto; }
  .storefront-tools-inner { padding: 3px 14px 6px; }
  .storefront-search { min-height: 44px; }
  .storefront-departments {
    width: calc(100% + 28px);
    padding-inline: 9px;
    margin: 2px -14px -6px;
  }
  .storefront-departments button { padding-inline: 12px; }
  .bottom-nav.storefront-bottom {
    position: fixed;
    inset: auto 0 0;
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 3px 5px calc(3px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e3e1e2;
    background: #fff;
  }
  .bottom-nav.storefront-bottom .navbtn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    gap: 3px;
    padding: 1px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #706a70;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.3;
  }
  .bottom-nav.storefront-bottom .navbtn.active { background: transparent; color: #2c242a; }
  .storefront-bottom .active:is([data-page="home"], [data-page="favorites"], [data-page="compare"]) svg { fill: currentColor; }
  .storefront-bottom .active[data-page="search"] svg { stroke-width: 2.4; }
  .bottom-nav.storefront-bottom .navbtn i {
    position: absolute;
    top: 1px;
    left: calc(50% + 8px);
    min-width: 18px;
    margin: 0;
    padding-inline: 3px;
    border-radius: 8px;
    background: #674655;
    color: #fff;
    font: 700 .75rem/18px system-ui, sans-serif;
  }
  .compare-dock { display: none; }
  #toast { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
}

@media (display-mode: standalone) {
  .storefront-tools { top: env(safe-area-inset-top, 0px); }
  .storefront-tools::before {
    position: absolute;
    inset: calc(0px - env(safe-area-inset-top, 0px)) 0 100%;
    background: inherit;
    content: "";
  }
}
