/* Global language control shared by desktop and mobile headers. */
.global-language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.global-language-switcher summary {
  height: 36px;
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line, #deded8);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #171717);
  font: 800 11px var(--body, Inter, sans-serif);
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.global-language-switcher summary::-webkit-details-marker { display: none; }
.global-language-switcher summary:hover,
.global-language-switcher summary:focus-visible,
.global-language-switcher[open] summary {
  border-color: var(--accent, #ef233c);
  outline: none;
}
.global-language-switcher summary svg {
  width: 10px;
  height: 7px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform .18s ease;
}
.global-language-switcher[open] summary svg { transform: rotate(180deg); }
.global-language-switcher__menu {
  position: absolute;
  z-index: 130;
  top: calc(100% + 9px);
  right: 0;
  min-width: 76px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line, #deded8);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 20, 20, .16);
}
.global-language-switcher__option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink, #171717);
  font: 800 11px var(--body, Inter, sans-serif);
  text-decoration: none;
}
.global-language-switcher__option:hover,
.global-language-switcher__option.is-active {
  background: var(--accent, #ef233c);
  color: #fff;
}
.mobile-menu-language {
  display: grid;
  gap: 10px;
  padding: 2px 0 18px;
  border-bottom: 1px solid var(--line, #deded8);
}
.mobile-menu-language > span {
  color: var(--muted, #727272);
  font: 800 10px var(--mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.mobile-menu-language__links {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  padding: 0 !important;
  border: 0 !important;
}
.mobile-menu .mobile-menu-language__links a,
.mobile-menu-language__option {
  min-width: 0 !important;
  min-height: 38px;
  display: grid !important;
  place-items: center;
  padding: 0 8px !important;
  border: 1px solid var(--line, #deded8) !important;
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #171717);
  font: 800 11px var(--body, Inter, sans-serif) !important;
  text-align: center !important;
  text-decoration: none;
}
.mobile-menu .mobile-menu-language__links a.is-active,
.mobile-menu .mobile-menu-language__links a[aria-current="page"],
.mobile-menu-language__option.is-active {
  border-color: var(--accent, #ef233c) !important;
  background: var(--accent, #ef233c);
  color: #fff;
}
@media (min-width: 901px) {
  body.has-existing-language-switcher .global-language-switcher { display: none; }
}

/* Keep every homepage band paintable when users scroll quickly. */
.home-page .category-shortcuts,
.home-page .seo-intro,
.home-page .buy-guide,
.home-page .catalog-editorial,
.home-page .latest-guides,
.home-page .home-faq,
.home-page .site-footer {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

/* Fresh mobile navigation and homepage mobile overrides. */
.mobile-bottom-nav { display: none; }
.hero-catalog-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  width: 100%;
}
.hero-catalog-meta .hero-updated { margin-top: 0; }
.hero-spreadsheet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink, #171717);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.hero-spreadsheet-link span,
.hero-spreadsheet-link:hover { color: var(--accent, #ef233c); }

@media (max-width: 760px) {
  body.has-mobile-bottom-nav {
    padding-bottom: calc(74px + env(safe-area-inset-bottom)) !important;
  }
  .home-page .home-popular-products { display: none !important; }
  .hero-catalog-meta {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    padding: 2px 2px 0;
    text-align: center;
  }
  .hero-catalog-meta .hero-updated { margin: 0 auto; }
  .hero-spreadsheet-link { font-size: 11px; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 66px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px 6px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(24, 24, 24, .13);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 24px rgba(24, 24, 24, .07);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .mobile-bottom-nav__link {
    min-width: 0;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border-radius: 10px;
    color: #777773;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bottom-nav__link:active { background: #f5f5f2; }
  .mobile-bottom-nav__icon {
    position: relative;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
  }
  .mobile-bottom-nav__icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-family: var(--body, Inter, sans-serif);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-bottom-nav__link.is-active { color: var(--accent, #ef233c); }
  .mobile-bottom-nav__link.is-active .mobile-bottom-nav__label { font-weight: 850; }
  .mobile-bottom-nav__count {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--accent, #ef233c);
    color: #fff;
    font: 800 8px/1 var(--body, Inter, sans-serif);
  }
  .mobile-bottom-nav__count[hidden] { display: none; }
}

/* Tablet and compact-desktop navigation opens as a contained dropdown, not a full-screen sheet. */
@media (min-width: 761px) {
  .mobile-menu {
    top: 74px !important;
    right: clamp(18px, 4vw, 48px) !important;
    bottom: auto !important;
    left: auto !important;
    width: min(390px, calc(100vw - 36px));
    max-height: min(680px, calc(100vh - 94px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 22px 22px !important;
    border: 1px solid var(--line, #deded8) !important;
    border-radius: 14px;
    background: #fff !important;
    box-shadow: 0 22px 60px rgba(20, 20, 20, .17);
    transform: translateY(-12px) scale(.985) !important;
    transform-origin: top right;
  }
  .mobile-menu.open {
    transform: translateY(0) scale(1) !important;
  }
  .mobile-menu > a,
  .mobile-menu > button {
    padding: 11px 0 !important;
    font-size: 20px !important;
    line-height: 1.15;
  }
  .mobile-menu-language { padding-top: 4px; }
}

/* Language visibility and mobile scrollbar cleanup v0.25.0. */
.catalog-language-switcher a[aria-current="page"],
.language-switcher a[aria-current="page"],
.account-language-switcher a[aria-current="page"] {
  display: inline-grid !important;
  place-items: center;
  background: var(--accent, #f12b3d) !important;
  color: #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 760px) {
  .mobile-menu-language__links {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .mobile-menu .mobile-menu-language__links a,
  .mobile-menu-language__option {
    padding-inline: 4px !important;
  }
  html,
  body,
  .mobile-menu {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  .mobile-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

/* v0.25.0 — paused membership, four-item mobile nav and category browser. */
.membership-paused [data-account-link],
.membership-paused .account-header-link,
.membership-paused .sign-in-btn { display: none !important; }

@media (max-width: 760px) {
  .mobile-bottom-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.mobile-categories-open { overflow: hidden !important; }
  .mobile-category-browser {
    position: fixed;
    z-index: 75;
    inset: 0 0 calc(66px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    color: var(--ink, #171717);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
  }
  .mobile-category-browser.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .mobile-category-browser__header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    border-bottom: 1px solid var(--line, #deded8);
    background: #f7f7f3;
  }
  .mobile-category-browser__back {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111;
    font: 500 29px/1 var(--body, Inter, sans-serif);
  }
  .mobile-category-browser__search {
    min-height: 47px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 0 15px;
    border: 1.5px solid #aeb8ba;
    border-radius: 999px;
    background: #fff;
  }
  .mobile-category-browser__search svg { width: 23px; height: 23px; fill: none; stroke: #111; stroke-width: 2; stroke-linecap: round; }
  .mobile-category-browser__search input { min-width: 0; border: 0; outline: 0; background: transparent; color: #111; font: 600 14px var(--body, Inter, sans-serif); }
  .mobile-category-browser__content { overflow-y: auto; padding: 17px 12px 26px; overscroll-behavior: contain; }
  .mobile-category-browser__eyebrow { display: block; margin-bottom: 4px; color: var(--accent, #ef233c); font: 800 9px var(--mono, monospace); letter-spacing: .09em; text-transform: uppercase; }
  .mobile-category-browser h2 { margin: 0 0 14px; font: 850 clamp(24px, 7vw, 31px)/1.05 var(--body, Inter, sans-serif); letter-spacing: -.035em; }
  .mobile-category-browser__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .mobile-category-browser__grid a {
    position: relative;
    min-width: 0;
    aspect-ratio: .72;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 7px;
    overflow: hidden;
    padding: 10px 8px 0;
    border: 1px solid #aab7b9;
    border-radius: 10px;
    background: linear-gradient(180deg,#fff 0 55%,#edfafa 55% 100%);
    color: #141414;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(20,20,20,.06);
  }
  .mobile-category-browser__grid strong { position: relative; z-index: 1; min-height: 32px; font: 750 12px/1.16 var(--body, Inter, sans-serif); overflow-wrap: anywhere; }
  .mobile-category-browser__grid img { width: 100%; height: 68%; object-fit: contain; object-position: center bottom; mix-blend-mode: multiply; }
  .mobile-menu-history-link,
  .mobile-menu-blog-link { font-weight: 800 !important; }
}

/* Keep the mobile category browser on the same visual system as the public site. */
@media (max-width: 760px) {
  .mobile-category-browser {
    background: var(--bg, #0D0D12);
    color: var(--text, #ECEAE3);
  }
  .mobile-category-browser__header {
    border-color: var(--line, rgba(236, 234, 227, .12));
    background: rgba(13, 13, 18, .97);
  }
  .mobile-category-browser__back { color: var(--text, #ECEAE3); }
  .mobile-category-browser__search {
    border-color: rgba(236, 234, 227, .28);
    background: var(--surface, #131318);
  }
  .mobile-category-browser__search svg { stroke: var(--muted, #9A97A1); }
  .mobile-category-browser__search input { color: var(--text, #ECEAE3); }
  .mobile-category-browser__search input::placeholder { color: var(--muted, #9A97A1); }
  .mobile-category-browser__eyebrow { color: var(--accent, #FF5A1F); }
  .mobile-category-browser h2 { color: var(--text, #ECEAE3); }
  .mobile-category-browser__grid a {
    border-color: rgba(236, 234, 227, .14);
    background: linear-gradient(180deg, var(--surface, #131318) 0 55%, var(--surface-2, #17171E) 55% 100%);
    color: var(--text, #ECEAE3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
  }
  .mobile-category-browser__grid a:focus-visible,
  .mobile-category-browser__grid a:hover { border-color: var(--accent, #FF5A1F); }
  .mobile-category-browser__grid img { mix-blend-mode: normal; }
}

.site-header .sign-in-btn,
.site-header [data-account-link],
.site-header .account-header-link,
.mobile-menu a[href$="/account"] { display: none !important; }
