/**
 * Custom header styling (replaces Elementor header).
 */

.bs-header {
  /* Desktop icon size (account/cart in top-right utilities). */
  --bs-header-icon-size-desktop: 35px;
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
  will-change: transform;
}

.bs-header__mobile,
.bs-header__desktop {
  padding: 12px 16px;
}

.bs-header__mobile-top,
.bs-header__desktop-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bs-header__desktop-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(420px, 640px) 260px auto;
  column-gap: 40px;
  align-items: center;
}

.bs-header__mobile-top {
  gap: 8px;
}

.bs-header__logo {
  display: flex;
  justify-content: center;
}

.bs-header__logo img {
  max-height: 80px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.bs-header__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 0px;
  border: 1px solid #000;
  font-size: 15px;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.bs-header__button:not(.bs-header__button--categories):hover {
  background: #000;
  color: #fff;
}

/* -------------------------------------- */
/* 🔥 FIXED SEARCHBAR + CATEGORIES HEIGHT */
/* -------------------------------------- */

.bs-header__search-group {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 640px;
}

/* Search form container */
.bs-header__search-group .bs-header__search-form {
  margin: 0;
  border-radius: 12px 0 0 12px;
  overflow: hidden;
  border: 1px solid #d5d5d5;
  border-right: none; /* keep clean seam */
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

/* Search input */
.bs-header__search-group .bs-header__search-form input {
  height: 44px;
  line-height: 44px;
  border: none;
  padding: 0 40px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Categories button */
.bs-header__button--categories {
  height: 46px; /* 44 + 2px border */
  line-height: 46px;
  border-radius: 0 12px 12px 0;
  padding: 0 20px;
  font-size: 15px;
  border: 1px solid #d5d5d5;
  border-left: none; /* 🔥 matches seam */
  background: #fff;
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.2px;
  box-sizing: border-box;
  position: relative;
}

/* Remove hover distortions */
.bs-header__button--categories:hover,
.bs-header__button--categories:focus {
  background: #fff;
  color: #000;
  border-color: #d5d5d5;
}

.bs-header__button--categories::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: #d5d5d5;
}

.bs-header__search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  width: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.bs-header__search-form button {
  right: 0;
}

/* -------------------------------------- */
/* End of fix */
/* -------------------------------------- */

.bs-header__search-form {
  position: relative;
  margin: 0;
  background: #fff;
  border-radius: 12px;
}

.bs-header__mobile .bs-header__search-form {
  margin-top: 12px;
}

.bs-header__search-form.is-desktop {
  max-width: none;
  width: 100%;
}

.bs-header__search-icon:hover,
.bs-header__search-icon:focus {
  color: inherit;
  background: transparent;
}

.bs-header__contacts {
  display: none;
}

.bs-header__mobile {
  /* Mobile icon size (hamburger, account, cart). */
  --bs-header-icon-size-mobile: 28px;
}


.bs-header__mobile-trigger,
.bs-header__mobile-account,
.bs-header__mobile-cart {
  width: var(--bs-header-icon-size-mobile);
  height: var(--bs-header-icon-size-mobile);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0; /* icons are SVG, not text */
  text-decoration: none;
  color: #444444; /* dark grey icons on mobile */
}

.bs-header__mobile-trigger:hover,
.bs-header__mobile-trigger:focus,
.bs-header__mobile-trigger:active {
  background: transparent !important;
  border: none;
}

.bs-header__mobile-account,
.bs-header__mobile-cart {
  border-radius: 50%;
  background: #fff;
}

.bs-header__mobile-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bs-header__mobile-cart {
  position: relative;
}

.bs-header__mobile-cart-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.bs-header__mobile-cart .bs-header__cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  font-size: 11px;
  margin-top: 0;
}

.bs-header__utilities {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bs-header__utility {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #000;
  font-size: 13px;
}

.bs-header__utility span:first-child {
  font-size: 18px;
  color: #444444; /* dark grey desktop utility icons */
}

/* Native SVG icons */
/* Desktop utilities account/cart icons */
.bs-header__desktop .bs-icon--account,
.bs-header__desktop .bs-icon--cart,
.bs-header__desktop .bs-icon--menu {
  width: var(--bs-header-icon-size-desktop);
  height: var(--bs-header-icon-size-desktop);
  display: block;
}

/* Mobile header icons */
.bs-header__mobile .bs-icon--account,
.bs-header__mobile .bs-icon--cart,
.bs-header__mobile .bs-icon--menu {
  width: var(--bs-header-icon-size-mobile);
  height: var(--bs-header-icon-size-mobile);
  display: block;
  flex-shrink: 0;
}

.bs-header__mobile .bs-icon--menu {
  color: #444444;
}

.bs-icon--cart {
  fill: #444444;
}

.bs-header__utility--cart {
  min-width: 90px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  text-align: center;
}

.bs-header__cart-total {
  display: block;
  font-weight: 600;
}

.bs-header__cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 13px;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .bs-header__contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
  }

  .bs-header__contact {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #000;
    text-decoration: none;
  }
}

@media (max-width: 1024px) {
  .bs-header {
    position: relative;
    top: auto;
  }

  .bs-header--fixed {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
  }
}

@media (max-width: 1024px) and (min-width: 783px) {
  body.admin-bar .bs-header--fixed {
    top: 32px;
  }
}

@media (max-width: 782px) {
  body.admin-bar .bs-header--fixed {
    top: 46px;
  }
}

@media (min-width: 1025px) {
  body.admin-bar .bs-header {
    top: 32px;
  }

  .bs-header__mobile {
    display: none;
  }

  .bs-header__desktop {
    display: block;
  }
}

@media (max-width: 1024px) {
  .bs-header__desktop {
    display: none;
  }

  .bs-header__logo img {
    max-height: 55px;
  }
}
