/* ---------------------------------------------------------------------------
   Header. Two states, both measured off the reference:

   over the hero  absolute, transparent, white type, 176px tall (126 on mobile)
   scrolled       fixed, solid white, dark type, the announcement bar gone
   --------------------------------------------------------------------------- */

.bs-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 300;
  color: var(--bs-black);
}

.bs-header--fixed {
  position: fixed;
  background: var(--bs-white);
  box-shadow: 0 1px 0 var(--bs-gray-light);
  transition: transform .25s var(--bs-ease);
}

/* Slid up by its own height while the page scrolls down; the script takes the
   class off again the moment the page scrolls up. */
.bs-header--fixed.bs-header--hidden { transform: translateY(-100%); }

/* The menu row sits on a pale ground once the bar is solid — the reference's
   own #f5f5f5, which is what reads as a tint over the page. */
.bs-header--fixed .bs-header__menu { background: var(--bs-gray-ultra-light); }

/* A page with no hero starts solid, so the content needs the room back. */
body.bs-chrome:not(.bs-has-hero) .bs-main { padding-top: var(--bs-header-h); }

/* ---------- Announcement ---------- */

/* One line, always: at 375px the message plus the pill is wider than the
   screen, and letting it wrap pushed the header from 126px to 138px. */
.bs-announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding-inline: var(--bs-pad);
  overflow-x: auto;
  background: var(--bs-red-announcement);
  color: var(--bs-white);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  scrollbar-width: none;
}

.bs-announcement::-webkit-scrollbar { display: none; }

.bs-announcement__cta {
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--bs-white);
  color: var(--bs-red-announcement);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}


@media only screen and (min-width: 990px) {
  .bs-announcement { height: 32px; gap: 16px; }
}

/* ---------- Main bar ---------- */

.bs-header__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding-inline: var(--bs-pad);
}

/* The search pill has to sit at exactly (1440-600)/2 = 420, as the reference
   does. `margin: auto` centres a flex item in the space the others leave over —
   345px here, not 420 — so instead the two side groups are given equal flex and
   a zero basis. Equal side columns, fixed middle: the same bargain 1fr auto 1fr
   struck, without a grid. */
@media only screen and (min-width: 990px) {
  .bs-header__bar { height: 80px; gap: 24px; }

  .bs-header__bar .bs-logo,
  .bs-header__bar .bs-header__icons { flex: 1 1 0; min-width: 0; }

  .bs-header__bar .bs-search { flex: 0 0 600px; }
}

.bs-logo { flex: none; display: flex; align-items: center; min-width: 0; }
.bs-logo img { display: block; width: auto; max-height: 34px; }

.bs-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.bs-wordmark__mark { display: block; width: 20px; height: auto; }
.bs-wordmark__text { display: block; }

@media only screen and (min-width: 990px) {
  .bs-wordmark { gap: 12px; font-size: 24px; }
  .bs-wordmark__mark { width: 24px; }
}

/* White over the photo, ink once the bar turns solid. */
.bs-header .bs-logo { color: var(--bs-white); }
.bs-header--fixed .bs-logo { color: var(--bs-black); }

.bs-burger { flex: none; display: flex; padding: 4px; cursor: pointer; }

/* Same pair as the icon row. `color: inherit` took the header's ink and left
   the burger black over the photograph while every icon beside it was white. */
.bs-header .bs-burger { color: var(--bs-white); }
.bs-header--fixed .bs-burger { color: var(--bs-black); }

@media only screen and (min-width: 990px) {
  .bs-burger { display: none; }
}

/* ---------- Search ---------- */

.bs-search {
  position: relative;
  display: none;
  width: 600px;
  max-width: 100%;
}

@media only screen and (min-width: 990px) {
  .bs-search { display: block; }
}

/* The mobile bar puts the field on its own row under the icons. */
/* 44px of row: a 32px pill and 12px under it. That is the reference's own
   mobile measurement, and it is what makes the header exactly 126px. */
.bs-header__searchrow {
  height: 44px;
  padding: 0 var(--bs-pad) 12px;
}

.bs-header__searchrow .bs-search { display: block; width: 100%; }


@media only screen and (min-width: 990px) {
  .bs-header__searchrow { display: none; }
}

/* Three classes and two elements: enough to outrank a plugin's grouped
   form-control rule, which is what flattens this pill back into a box. */
body.bs-chrome .bs-search input.bs-search__input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 44px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 20px;
  background: rgba(255, 255, 255, .15);
  color: var(--bs-white);
  font-family: var(--bs-font);
  font-size: 16px;
  box-shadow: none;
  transition: background var(--bs-dur) var(--bs-ease), border-color var(--bs-dur) var(--bs-ease);
}

body.bs-chrome .bs-search input.bs-search__input::placeholder { color: rgba(255, 255, 255, .8); opacity: 1; }
body.bs-chrome .bs-search input.bs-search__input:focus { outline: none; background: rgba(255, 255, 255, .28); }

body.bs-chrome .bs-header--fixed .bs-search input.bs-search__input,
body.bs-chrome .bs-header__searchrow .bs-search input.bs-search__input {
  border-color: var(--bs-gray-light);
  background: var(--bs-gray-ultra-light);
  color: var(--bs-black);
}

body.bs-chrome .bs-header--fixed .bs-search input.bs-search__input::placeholder,
body.bs-chrome .bs-header__searchrow .bs-search input.bs-search__input::placeholder { color: var(--bs-gray); }

body.bs-chrome .bs-header--fixed .bs-search input.bs-search__input:focus,
body.bs-chrome .bs-header__searchrow .bs-search input.bs-search__input:focus {
  background: var(--bs-white);
  border-color: var(--bs-gray-medium);
}

/* Must come after the generic field rule, not before it: same specificity, so
   whichever is written last wins and this one has to. */
body.bs-chrome .bs-header__searchrow input.bs-search__input {
  height: 32px;
  padding-left: 40px;
  border-radius: 16px;
}

.bs-header__searchrow .bs-search__submit { width: 40px; height: 32px; }

.bs-search__submit {
  position: absolute;
  top: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 40px;
  color: inherit;
  cursor: pointer;
}

.bs-header .bs-search__submit { color: var(--bs-white); }
.bs-header--fixed .bs-search__submit,
.bs-header__searchrow .bs-search__submit { color: var(--bs-gray); }

/* ---------- Icons ---------- */

.bs-header__icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

@media only screen and (min-width: 990px) {
  .bs-header__icons { gap: 16px; }
}

.bs-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  color: inherit;
  cursor: pointer;
}

.bs-header .bs-icon-btn { color: var(--bs-white); }
.bs-header--fixed .bs-icon-btn { color: var(--bs-black); }

.bs-icon-btn--pin, .bs-icon-btn--phone { display: none; }

@media only screen and (min-width: 990px) {
  .bs-icon-btn--pin, .bs-icon-btn--phone { display: flex; }
}

.bs-icon-btn__count {
  position: absolute;
  top: -2px; right: -4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bs-red-announcement);
  color: var(--bs-white);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ---------- Menu row ---------- */

.bs-header__menu {
  position: relative;
  display: none;
  align-items: center;
  gap: 32px;
  height: 64px;
  padding-inline: var(--bs-pad);
}

/* The hairline between the search row and the menu row. It belongs to the
   transparent state only: once the bar turns solid white it would be a white
   line on white. */
.bs-header__menu::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--bs-white);
}

.bs-header--fixed .bs-header__menu::before { background: var(--bs-gray-light); }

@media only screen and (min-width: 990px) {
  .bs-header__menu { display: flex; }
}

.bs-menu { display: flex; align-items: center; gap: 32px; }
.bs-menu__list { display: flex; align-items: center; gap: 32px; margin: 0; padding: 0; list-style: none; }
.bs-menu__list li { margin: 0; padding: 0; list-style: none; }

/* wp_nav_menu prints plain <a> tags with no class of ours, so the colour has
   to be keyed off the nav, not off a class the links never carry. That is why
   the phone link — which does carry the class — was white while the menu items
   next to it stayed black over the hero. */
.bs-menu a,
.bs-menu__link {
  color: var(--bs-white);
  font-size: 16px;
  font-weight: 500;
  transition: opacity var(--bs-dur) var(--bs-ease);
}

.bs-header--fixed .bs-menu a,
.bs-header--fixed .bs-menu__link { color: var(--bs-black); }

.bs-menu a:hover,
.bs-menu__link:hover { opacity: .7; }

/* The white pill that opens the mega menu. */
.bs-products-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--bs-white);
  color: var(--bs-black);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.bs-header--fixed .bs-products-btn { background: var(--bs-black); color: var(--bs-white); }

.bs-header__service { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.bs-header__phones { display: flex; align-items: center; gap: 16px; }
.bs-header__phones .bs-menu__link + .bs-menu__link::before { content: ""; display: inline-block; width: 1px; height: 14px; margin-right: 16px; background: currentColor; opacity: .4; vertical-align: -2px; }

/* ---------- Language switcher ---------- */

.bs-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid currentColor;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.bs-lang__item {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  color: inherit;
  transition: background var(--bs-dur) var(--bs-ease), color var(--bs-dur) var(--bs-ease);
}

.bs-lang__item:hover { opacity: .75; }

/* The active language is filled with the text colour the header is using at
   the time — white over the hero, ink on the solid bar — so it reads in both. */
.bs-header .bs-lang { color: var(--bs-white); }
.bs-header .bs-lang__item.is-active { background: var(--bs-white); color: var(--bs-black); }
.bs-header--fixed .bs-lang { color: var(--bs-black); }
.bs-header--fixed .bs-lang__item.is-active { background: var(--bs-black); color: var(--bs-white); }

.bs-drawer .bs-lang { margin-left: auto; margin-right: 16px; color: var(--bs-black); }
.bs-drawer .bs-lang__item.is-active { background: var(--bs-black); color: var(--bs-white); }

/* ---------------------------------------------------------------------------
   Products drawer. 580px from the left, above everything, on every width.
   --------------------------------------------------------------------------- */

.bs-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity var(--bs-dur) var(--bs-ease);
}

.bs-drawer-scrim.is-open { opacity: 1; }

.bs-drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  /* Above the header, which is 300. At anything lower the header paints over
     the panel and takes its close button with it. */
  z-index: 400;
  display: flex;
  flex-direction: column;
  width: min(580px, 92vw);
  background: var(--bs-white);
  transform: translateX(-100%);
  transition: transform var(--bs-dur) var(--bs-ease);
}

.bs-drawer.is-open { transform: translateX(0); }

.bs-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--bs-pad);
}

@media only screen and (min-width: 990px) {
  .bs-drawer__head { padding: 24px 32px; }
}

/* Ink on white: the drawer is not the transparent header. */
.bs-drawer .bs-logo { color: var(--bs-black); }
.bs-drawer__close { display: flex; padding: 0; color: var(--bs-black); cursor: pointer; }

.bs-drawer__body {
  flex: 1 1 auto;
  padding: 0 var(--bs-pad) 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media only screen and (min-width: 990px) {
  .bs-drawer__body { padding: 0 32px 32px; }
}

.bs-drawer__pills { display: flex; flex-wrap: wrap; gap: 18px; padding-bottom: 18px; }

.bs-pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 20px;
  border: 1px solid var(--bs-black);
  border-radius: 24px;
  color: var(--bs-black);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--bs-dur) var(--bs-ease), color var(--bs-dur) var(--bs-ease);
}

.bs-pill:hover { background: var(--bs-black); color: var(--bs-white); }
.bs-pill--sale { border-color: var(--bs-red); color: var(--bs-red); }
.bs-pill--sale:hover { background: var(--bs-red); border-color: var(--bs-red); color: var(--bs-white); }

.bs-drawer__row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 66px;
  padding: 0 12px;
  border-radius: 24px;
  color: var(--bs-black);
  font-size: 18px;
  font-weight: 500;
  transition: background var(--bs-dur) var(--bs-ease);
}

@media only screen and (min-width: 990px) {
  .bs-drawer__row { font-size: 21px; }
}

.bs-drawer__row:hover { background: var(--bs-gray-ultra-light); }

.bs-drawer__thumb {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bs-gray-ultra-light);
}

.bs-drawer__thumb img { width: 100%; height: 100%; object-fit: contain; }
.bs-drawer__name { flex: 1 1 auto; min-width: 0; }
.bs-drawer__chevron { flex: none; color: var(--bs-gray); }

.bs-drawer__extra { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--bs-gray-light); }
.bs-drawer__extra li { margin-bottom: 4px; }
.bs-drawer__extra a { display: block; padding: 12px; border-radius: 24px; font-size: 16px; font-weight: 500; }
.bs-drawer__extra a:hover { background: var(--bs-gray-ultra-light); }

/* On a desktop the header bar already carries the pages and the sale/new
   pills have their own place, so the drawer is the category list alone.
   On a phone the drawer is the whole menu and keeps both. */
@media only screen and (min-width: 990px) {
  .bs-drawer__pills, .bs-drawer__extra { display: none; }
}

/* ---------- Live search ----------
   A list under the field, fed as the visitor types. The form is the
   positioning parent; the list is one flex column of rows. */
.bs-search { position: relative; }
.bs-suggest {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--bs-gray-light);
  border-radius: 16px;
  background: var(--bs-white);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
  color: var(--bs-black);
  text-align: left;
}
.bs-suggest[hidden] { display: none; }
.bs-suggest__item { display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.bs-suggest__item:hover, .bs-suggest__item.is-active { background: var(--bs-gray-ultra-light); }
.bs-suggest__img { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bs-gray-ultra-light); }
.bs-suggest__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.bs-suggest__title { font-size: 15px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-suggest__cat { font-size: 12px; color: var(--bs-gray); }
.bs-suggest__price { flex: 0 0 auto; font-size: 15px; font-weight: 600; white-space: nowrap; }
.bs-suggest__all { display: flex; justify-content: center; margin-top: 4px; padding: 12px; border-top: 1px solid var(--bs-gray-light); font-size: 14px; text-decoration: underline; color: inherit; }
.bs-suggest__none { padding: 14px 10px; font-size: 14px; color: var(--bs-gray); }
