/* Header 2 — Machic-style e-commerce header */

.bsp-h2 {
  --bsp-h2-topbar-bg: #ffffff;
  --bsp-h2-topbar-text: #6b7280;
  --bsp-h2-bg: #ffffff;
  --bsp-h2-text: #1a1a1a;
  --bsp-h2-muted: #6b7280;
  --bsp-h2-border: #e5e7eb;
  --bsp-h2-primary: #233a95;
  --bsp-h2-primary-text: #ffffff;
  --bsp-h2-badge-bg: #ffb400;
  --bsp-h2-badge-text: #1a1a1a;
  --bsp-h2-nav-active: #2563eb;
  --bsp-h2-promo-icon: #e52727;

  background: var(--bsp-h2-bg);
  font-family: inherit;
}

/* ============ Topbar ============ */

.bsp-h2-topbar {
  background: var(--bsp-h2-topbar-bg);
  border-bottom: 1px solid var(--bsp-h2-border);
  color: var(--bsp-h2-topbar-text);
}

.bsp-h2-topbar__inner {
  min-height: 40px;
}

.bsp-h2-topbar__links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.bsp-h2-topbar__links a {
  color: var(--bsp-h2-topbar-text);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.bsp-h2-topbar__links a:hover {
  color: var(--bsp-h2-text);
}

.bsp-h2-topbar__meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bsp-h2-topbar__tracking {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--bsp-h2-topbar-text);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.bsp-h2-topbar__tracking:hover {
  color: var(--bsp-h2-text);
}

.bsp-h2-topbar__currency {
  display: flex;
  align-items: center;
}

/* ============ Main row ============ */

.bsp-h2-main {
  background: var(--bsp-h2-bg);
}

.bsp-h2-main__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 84px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.bsp-h2-brand {
  flex-shrink: 0;
}

.bsp-h2-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.bsp-h2-logo__image img {
  max-height: 48px;
  width: auto;
  display: block;
}

.bsp-h2-logo__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bsp-h2-text);
}

.bsp-h2-logo__title::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bsp-h2-badge-bg);
  margin-left: 4px;
  vertical-align: super;
}

/* ---- Search pill ---- */

.bsp-h2-search {
  flex: 1;
  min-width: 260px;
}

.bsp-h2-search__form {
  border: 2px solid var(--bsp-h2-primary);
  border-radius: 24px;
  background: #ffffff;
  height: 46px;
  align-items: center;
  overflow: visible;
}

.bsp-h2-search__cats {
  position: relative;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.bsp-h2-search__cats-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 14px 0 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--bsp-h2-text);
  border-right: 1px solid var(--bsp-h2-border);
  white-space: nowrap;
}

.bsp-h2-search__cats-trigger i {
  font-size: 10px;
  color: var(--bsp-h2-muted);
  transition: transform 0.2s ease;
}

.bsp-search-categories-dropdown.is-open .bsp-h2-search__cats-trigger i {
  transform: rotate(180deg);
}

.bsp-h2-search__cats-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 210px;
  max-height: 320px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--bsp-h2-border);
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.14);
  padding: 6px 0;
  z-index: 60;
}

.bsp-search-categories-dropdown.is-open .bsp-h2-search__cats-menu {
  display: block;
}

.bsp-h2-search__cats-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--bsp-h2-text);
}

.bsp-h2-search__cats-menu button:hover {
  background: #f3f4f6;
  color: var(--bsp-h2-primary);
}

.bsp-h2-search__input {
  height: 100%;
  background: transparent;
}

.bsp-h2-search__submit {
  height: calc(100% + 4px);
  margin: -2px -2px -2px 0;
  padding: 0 30px;
  background: var(--bsp-h2-primary);
  color: var(--bsp-h2-primary-text);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 24px 24px 0;
  transition: filter 0.2s ease;
}

.bsp-h2-search__submit:hover {
  filter: brightness(1.15);
}

.bsp-h2-search .bsp-live-search {
  top: calc(100% + 12px);
}

/* ---- Actions ---- */

.bsp-h2-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
  margin-left: auto;
}

.bsp-h2-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: var(--bsp-h2-text);
  transition: color 0.2s ease;
}

.bsp-h2-action:hover {
  color: var(--bsp-h2-primary);
}

.bsp-h2-action > i,
.bsp-h2-action__icon > i {
  font-size: 22px;
}

.bsp-h2-action__icon {
  position: relative;
  display: inline-flex;
}

.bsp-h2-action__count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bsp-h2-badge-bg);
  color: var(--bsp-h2-badge-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
}

.bsp-h2-action__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}

.bsp-h2-action__text small {
  font-size: 12px;
  color: var(--bsp-h2-muted);
}

.bsp-h2-action__text strong {
  font-size: 14px;
  font-weight: 700;
  color: inherit;
}

/* ============ Navbar row ============ */

.bsp-h2-navbar {
  background: var(--bsp-h2-bg);
  border-top: 1px solid var(--bsp-h2-border);
  border-bottom: 1px solid var(--bsp-h2-border);
}

.bsp-h2-navbar__inner {
  display: flex;
  align-items: stretch;
  gap: 28px;
  min-height: 54px;
}

/* ---- Departments dropdown ---- */

.bsp-h2-departments {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

.bsp-h2-departments__toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  min-width: 250px;
  border: 0;
  border-left: 1px solid var(--bsp-h2-border);
  border-right: 1px solid var(--bsp-h2-border);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--bsp-h2-text);
  transition: color 0.2s ease;
}

.bsp-h2-departments__toggle:hover {
  color: var(--bsp-h2-primary);
}

.bsp-h2-departments__toggle > span {
  flex: 1;
  text-align: left;
}

.bsp-h2-departments__caret {
  font-size: 10px;
  color: var(--bsp-h2-muted);
  transition: transform 0.2s ease;
}

.bsp-h2-departments.is-open .bsp-h2-departments__caret {
  transform: rotate(180deg);
}

.bsp-h2-departments__panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: max(100%, 280px);
  background: #ffffff;
  border: 1px solid var(--bsp-h2-border);
  border-top: 0;
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.14);
  z-index: 90;
}

.bsp-h2-departments__panel[hidden] {
  display: none;
}

.bsp-h2-departments__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.bsp-h2-departments__item {
  position: relative;
}

.bsp-h2-departments__item > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  text-decoration: none;
  font-size: 14px;
  color: var(--bsp-h2-text);
  border-bottom: 1px solid #f3f4f6;
  transition: color 0.2s ease, background 0.2s ease;
}

.bsp-h2-departments__item:last-child > a {
  border-bottom: 0;
}

.bsp-h2-departments__item > a:hover {
  background: #f8f9fb;
  color: var(--bsp-h2-primary);
}

.bsp-h2-departments__item > a > span {
  flex: 1;
}

.bsp-h2-departments__thumb {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.bsp-h2-departments__icon {
  width: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--bsp-h2-muted);
  flex-shrink: 0;
}

.bsp-h2-departments__chevron {
  font-size: 10px;
  color: var(--bsp-h2-muted);
}

.bsp-h2-departments__sub {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #ffffff;
  border: 1px solid var(--bsp-h2-border);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.14);
  z-index: 95;
}

.bsp-h2-departments__item:hover > .bsp-h2-departments__sub,
.bsp-h2-departments__item:focus-within > .bsp-h2-departments__sub {
  display: block;
}

.bsp-h2-departments__sub a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--bsp-h2-text);
  text-decoration: none;
}

.bsp-h2-departments__sub a:hover {
  background: #f8f9fb;
  color: var(--bsp-h2-primary);
}

/* ---- Primary nav ---- */

.bsp-h2-nav {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.bsp-h2-nav__inner {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.bsp-h2-nav__menu {
  display: flex;
  align-items: stretch;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.bsp-h2-nav__menu > li {
  position: relative;
  display: flex;
  align-items: stretch;
}

.bsp-h2-nav__menu > li > a,
.bsp-h2-nav .bsp-mega-menu-parent > .bsp-mega-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bsp-h2-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bsp-h2-nav__menu > li > a:hover,
.bsp-h2-nav__menu > li.current-menu-item > a,
.bsp-h2-nav__menu > li.current_page_item > a,
.bsp-h2-nav .bsp-mega-menu-parent:hover > .bsp-mega-menu-trigger {
  color: var(--bsp-h2-nav-active);
}

.bsp-h2-nav .bsp-has-dropdown > a::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
}

/* Mobile-only submenu toggles (hidden on desktop) */
.bsp-h2-nav .bsp-submenu-toggle {
  display: none;
}

/* Desktop dropdowns */
.bsp-h2-nav .bsp-nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: #ffffff;
  border: 1px solid var(--bsp-h2-border);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.14);
  z-index: 80;
}

@media (min-width: 993px) {
  .bsp-h2-nav .bsp-nav-menu > .menu-item-has-children:not(.bsp-mega-menu-parent):hover > .sub-menu,
  .bsp-h2-nav .bsp-nav-menu > .menu-item-has-children:not(.bsp-mega-menu-parent):focus-within > .sub-menu {
    display: block;
  }
}

.bsp-h2-nav .bsp-nav-menu .sub-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--bsp-h2-text);
  text-decoration: none;
  white-space: nowrap;
}

.bsp-h2-nav .bsp-nav-menu .sub-menu a:hover {
  background: #f8f9fb;
  color: var(--bsp-h2-primary);
}

/* ---- Promo ---- */

.bsp-h2-promo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
  text-decoration: none;
  align-self: center;
}

.bsp-h2-promo__icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bsp-h2-promo-icon) 12%, #ffffff);
  color: var(--bsp-h2-promo-icon);
  font-size: 15px;
}

.bsp-h2-promo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.bsp-h2-promo__text small {
  font-size: 12px;
  color: var(--bsp-h2-muted);
}

.bsp-h2-promo__text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--bsp-h2-text);
}

/* ============ Mobile / tablet ============ */

@media (max-width: 992px) {
  .bsp-h2-topbar {
    display: none;
  }

  body.bsp-show-topbar-mobile .bsp-h2-topbar {
    display: block;
  }

  body.bsp-show-topbar-mobile .bsp-h2-topbar__inner {
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .bsp-h2-mobile-toggle {
    display: flex;
    order: 1;
  }

  .bsp-h2-brand {
    order: 2;
  }

  .bsp-h2-actions {
    order: 3;
    gap: 18px;
  }

  .bsp-h2-search {
    order: 4;
    flex: 0 0 100%;
    min-width: 0;
    padding-bottom: 4px;
  }

  .bsp-h2-main__inner {
    gap: 16px;
    min-height: 0;
    padding: 12px 0 8px;
  }

  .bsp-h2-action--account .bsp-h2-action__text,
  .bsp-h2-action--cart .bsp-h2-action__text {
    display: none;
  }

  .bsp-h2-search__cats {
    display: none;
  }

  .bsp-h2-search__submit {
    padding: 0 20px;
  }

  /* Navbar collapses: departments & promo hide, menu becomes overlay */
  .bsp-h2-navbar {
    border: 0;
    min-height: 0;
  }

  .bsp-h2-navbar__inner {
    min-height: 0;
  }

  .bsp-h2-departments,
  .bsp-h2-promo {
    display: none;
  }

  .bsp-h2-nav {
    display: block;
  }

  .bsp-h2-nav:not(.is-open) {
    display: none;
  }

  .bsp-h2-nav.is-open {
    display: block;
    position: fixed;
    top: var(--bsp-mobile-nav-top, 60px);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--bsp-mobile-nav-top, 60px));
    overflow-y: auto;
    background: #ffffff;
    border-bottom: 1px solid var(--bsp-h2-border);
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.1);
    z-index: 499;
    padding: 8px 16px 16px;
  }

  .bsp-h2-nav__inner {
    display: block;
  }

  .bsp-h2-nav__menu {
    display: block;
  }

  .bsp-h2-nav__menu > li {
    display: block;
  }

  .bsp-h2-nav__menu > li > a,
  .bsp-h2-nav .bsp-mega-menu-parent > .bsp-mega-menu-trigger {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .bsp-h2-nav .bsp-has-dropdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .bsp-h2-nav .bsp-has-dropdown > a {
    flex: 1;
    min-width: 0;
  }

  .bsp-h2-nav .bsp-has-dropdown > a::after {
    display: none;
  }

  .bsp-h2-nav .bsp-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--bsp-h2-text);
    appearance: none;
    -webkit-appearance: none;
  }

  .bsp-h2-nav .bsp-submenu-toggle__icon {
    display: block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
  }

  .bsp-h2-nav .bsp-submenu-toggle[aria-expanded="true"] .bsp-submenu-toggle__icon {
    transform: rotate(180deg);
  }

  .bsp-h2-nav .bsp-nav-menu .sub-menu {
    position: static;
    display: none;
    min-width: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 14px;
  }

  .bsp-h2-nav .bsp-has-dropdown.is-submenu-open > .sub-menu,
  .bsp-h2-nav .bsp-mega-menu-parent.is-open > .bsp-mega-menu {
    display: block;
    flex: 0 0 100%;
    width: 100%;
  }

  .bsp-h2-nav .bsp-nav-menu .sub-menu a {
    white-space: normal;
    padding: 9px 0;
  }
}

@media (max-width: 480px) {
  .bsp-h2-logo__title {
    font-size: 21px;
  }

  .bsp-h2-actions {
    gap: 14px;
  }

  .bsp-h2-search__submit {
    padding: 0 16px;
    font-size: 13px;
  }
}
