/* =========================================================================
   BRITTLE FULL HEADER  —  [brittle_header]
   Logo · mega menu · My Account · Cart
   Colours come from WooCommerce → Brittle Mega Menu → Colours (Header bar).

   Layouts
     Computer  (901px +)  :  [logo]      [ menu items ]      [account][cart]
     Phone/tab (≤ 900px)  :  [☰ menu]      [ logo ]          [account][cart]
   900px is the same switch point the menu itself uses.
   ========================================================================= */

.bch {
  position: relative;
  z-index: 999;
  width: 100%;
  background: var(--bcm-header-bg);
  font-family: var(--bcm-font);
  color: var(--bcm-bar-text);
}

.bch *,
.bch *::before,
.bch *::after {
  box-sizing: border-box;
}

.bch--line {
  border-bottom: 1px solid rgba(var(--bcm-bar-text-rgb), 0.12);
}

.bch__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "logo menu icons";
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 24px;
}

/* ---------- logo ---------- */

.bch__logo {
  grid-area: logo;
  display: flex;
  align-items: center;
  line-height: 0;
}

.bch a.bch-logo,
.bch a.bch-logo:hover,
.bch a.bch-logo:visited {
  display: inline-flex;
  align-items: center;
  color: var(--bcm-bar-text) !important;
  text-decoration: none !important;
}

/* !important: Elementor sets every image inside its content to "height: auto",
   which would show the logo at its full upload size. */
.bch img.bch-logo__img {
  display: block !important;
  width: auto !important;
  height: var(--bch-logo-h, 48px) !important;
  max-height: none !important;
  max-width: var(--bch-logo-max-w, 220px) !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: contain;
  object-position: left center;
}

.bch__logo {
  min-width: 0;
  max-width: var(--bch-logo-max-w, 220px);
}

.bch-logo__text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ---------- menu ---------- */

.bch__menu {
  grid-area: menu;
  display: flex;
  justify-content: center;
  min-width: 0;
}

/* ---------- account + cart ---------- */

.bch__icons {
  grid-area: icons;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.bch a.bch-icon,
.bch a.bch-icon:visited {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--bcm-bar-text) !important;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.bch a.bch-icon:hover,
.bch a.bch-icon:focus-visible {
  background: var(--bcm-yellow-tint);
  color: var(--bcm-highlight-text) !important;
}

.bch a.bch-icon:focus-visible {
  outline: 2px solid var(--bcm-coral);
  outline-offset: 2px;
}

.bch .bch-icon svg {
  display: block;
  width: 24px !important;
  height: 24px !important;
}

/* the number on the cart */
.bch-count {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bcm-yellow-tint);
  color: var(--bcm-highlight-text);
  box-shadow: 0 0 0 2px var(--bcm-header-bg);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.bch a.bch-icon:hover .bch-count {
  background: var(--bcm-coral);
  color: var(--bcm-btn-hover-text);
}

.bch-count.is-empty {
  display: none;
}

/* ---------- small laptops / large tablets in landscape ---------- */

@media (min-width: 901px) and (max-width: 1180px) {
  .bch__inner {
    gap: 12px;
    padding: 8px 16px;
  }

  .bch {
    --bch-logo-max-w: 160px;
  }

  .bch .bcm-link {
    padding-left: 10px;
    padding-right: 10px;
  }

  .bch .bcm-item--panel .bcm-link {
    padding-right: 2px;
  }

  .bch .bcm-caret {
    width: 26px;
  }
}

/* ---------- phones + tablets ---------- */

@media (max-width: 900px) {
  .bch__inner {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "menu logo icons";
    gap: 8px;
    min-height: 62px;
    padding: 6px 12px;
  }

  .bch__menu {
    justify-content: flex-start;
  }

  .bch__logo {
    justify-content: center;
  }

  .bch {
    --bch-logo-max-w: 150px;
  }

  .bch img.bch-logo__img {
    height: var(--bch-logo-h-m, 36px) !important;
    object-position: center;
  }

  .bch-logo__text {
    font-size: 19px;
  }

  .bch__icons {
    gap: 0;
  }
}

/* ---------- small phones ---------- */

@media (max-width: 380px) {
  .bch__inner {
    gap: 4px;
    padding: 6px 8px;
  }

  .bch {
    --bch-logo-max-w: 118px;
  }

  .bch a.bch-icon,
  .bch .bcm-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bch a.bch-icon {
    transition: none;
  }
}
