:root { --shop-header-height: 125px; }
html { scroll-padding-top: var(--shop-header-height); }

#shop-header {
  position: sticky;
  top: 0;
  z-index: 6;
  color: #f5edda;
  background: #171615;
  border-bottom: 1px solid #5c4c3c;
  box-shadow: 0 5px 16px #100d0c35;
}
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "brand phone age";
  align-items: center;
  gap: 0 clamp(14px, 2.4vw, 36px);
  padding-block: 8px;
}
#shop-header .brand { grid-area: brand; justify-self: start; }
#shop-header .age-chip { grid-area: age; margin: 0; justify-self: end; }
#shop-header .header-phone {
  grid-area: phone;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: 44px;
  color: #efdebf;
  font: 600 15px/1.2 var(--sans);
  letter-spacing: .012em;
  white-space: nowrap;
}
#shop-header a:focus-visible, #types-toggle:focus-visible {
  outline: 2px solid #e5c99e;
  outline-offset: -2px;
}
#types-toggle { display: none; }
.types-drawer {
  border-top: 1px solid #403931;
  background: #1b1917;
}
.types-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
}
#shop-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(14px, 1.9vw, 30px);
  margin: 0;
  border: 0;
}
#shop-header nav a {
  display: inline-flex;
  position: relative;
  align-items: center;
  min-height: 44px;
  padding: 2px 0;
  color: #e6ddcf;
  font: 500 14px/1.25 var(--sans);
  text-decoration: none;
}
#shop-header nav a:hover, #shop-header .header-phone:hover { color: #ffe0a8; }
#header-types a[aria-current="page"] { color: #efcd92; }
#header-types a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: #cda878;
}
#shop-header .header-sections { flex-wrap: nowrap; gap: 18px; }
#shop-header .header-sections a { color: #cbbfae; }

@media (min-width: 801px) and (max-width: 1000px) and (min-height: 501px) {
  .types-inner { column-gap: 14px; }
  #shop-header #header-types { column-gap: 9px; }
  #shop-header .header-sections { column-gap: 12px; }
}

@media (max-width: 800px), (max-height: 500px) {
  :root { --shop-header-height: 62px; }
  .masthead {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas: "brand types phone age";
    column-gap: clamp(8px, 2vw, 20px);
    padding-block: 6px;
  }
  #shop-header .brand { --mark-height: 48px; --name-size: clamp(23px, 3.2vw, 29px); gap: 9px; }
  #types-toggle {
    grid-area: types;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    gap: 10px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #e7cd9f;
    font: 600 14px/1.2 var(--sans);
    white-space: nowrap;
  }
  #types-toggle span {
    width: 7px;
    height: 7px;
    margin: -3px 2px 0 0;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }
  #types-toggle[aria-expanded="true"] span { transform: translateY(3px) rotate(225deg); }
  #shop-header .header-phone { font-size: 14px; }
  .types-drawer {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100vh - var(--shop-header-height));
    max-height: calc(100dvh - var(--shop-header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid #78634c;
    box-shadow: 0 15px 28px #0b090955;
  }
  .types-open .types-drawer { display: block; }
  .types-inner { display: block; padding-block: 8px; }
  #shop-header #header-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  #shop-header #header-types a {
    justify-content: flex-start;
    min-width: 0;
    padding: 4px 10px;
    border-bottom: 1px solid #3f3830;
    overflow-wrap: anywhere;
  }
  #shop-header #header-types a[aria-current="page"] { background: #332c24; color: #f5d3a1; }
  #header-types a[aria-current="page"]::after { inset: 8px auto 8px 0; width: 2px; height: auto; }
  #shop-header .header-sections { justify-content: flex-end; padding-inline: 10px; }
}

@media (max-width: 560px) {
  :root { --shop-header-height: 108px; }
  .masthead {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "brand age" "types phone";
    column-gap: 6px;
    padding-block: 7px 0;
  }
  #shop-header .brand { --mark-height: 52px; --name-size: clamp(25px, 6.8vw, 32px); }
  #shop-header .header-phone, #types-toggle { margin-top: 2px; }
}

@media (prefers-reduced-motion: no-preference) {
  #types-toggle span { transition: transform .16s ease; }
  .types-open .types-drawer { animation: reveal-header-types .16s ease-out; }
  @keyframes reveal-header-types { from { opacity: .25; transform: translateY(-3px); } }
}
