/* Header 3 — Storecraft-style e-commerce header */

.bsp-h3 {
  --bsp-container: 1600px;
  --bsp-h3-topbar-bg: #1a1a1a;
  --bsp-h3-topbar-text: #ffffff;
  --bsp-h3-bg: #ffffff;
  --bsp-h3-text: #111111;
  --bsp-h3-muted: #6b7280;
  --bsp-h3-border: #e5e7eb;
  --bsp-h3-primary: #1a1a2e;
  --bsp-h3-primary-text: #ffffff;
  --bsp-h3-badge-bg: #111111;
  --bsp-h3-badge-text: #ffffff;
  --bsp-h3-promo-icon: #e52727;
  --bsp-h3-help-bg: #f3f4f6;
  --bsp-h3-brand-icon-bg: #1a1a2e;
  --bsp-h3-brand-icon-text: #ffffff;

  background: var(--bsp-h3-bg);
  font-family: inherit;
}

/* ============ Topbar ============ */

.bsp-h3-topbar {
  background: var(--bsp-h3-topbar-bg);
  color: var(--bsp-h3-topbar-text);
}

.bsp-h3-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding: 6px 0;
}

.bsp-h3-topbar__announcement {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--bsp-h3-topbar-text);
}

.bsp-h3-topbar__meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.bsp-h3-topbar__socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bsp-h3-topbar__socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--bsp-h3-topbar-text);
  text-decoration: none;
  font-size: 13px;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.bsp-h3-topbar__socials a:hover {
  opacity: 1;
}

.bsp-h3-topbar__currency {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--bsp-h3-topbar-text);
}

.bsp-h3-topbar__currency select,
.bsp-h3-topbar__currency button,
.bsp-h3-topbar__currency a {
  color: inherit;
  font-size: inherit;
}

/* ============ Main row ============ */

.bsp-h3-main {
  background: var(--bsp-h3-bg);
  border-bottom: 1px solid var(--bsp-h3-border);
}

.bsp-h3-main__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 78px;
  padding: 12px 0;
}

.bsp-h3-mobile-toggle {
  display: none;
}

.bsp-h3-brand {
  flex-shrink: 0;
}

.bsp-h3-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.bsp-h3-logo__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bsp-h3-brand-icon-bg);
  color: var(--bsp-h3-brand-icon-text);
  border-radius: 6px;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.bsp-h3-logo__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bsp-h3-logo__title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bsp-h3-text);
  line-height: 1;
}

.bsp-h3-logo__image img {
  max-height: 44px;
  width: auto;
  display: block;
}

/* ---- Search ---- */

.bsp-h3-search {
  flex: 1;
  min-width: 280px;
  position: relative;
  z-index: 30;
}

.bsp-h3-search__form {
  display: flex;
  align-items: stretch;
  height: 46px;
  border: 1px solid var(--bsp-h3-border);
  border-radius: 8px;
  overflow: visible;
  background: #ffffff;
}

.bsp-h3-search .bsp-live-search {
  top: calc(100% + 10px);
  z-index: 80;
}

.bsp-h3-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 16px;
  font-size: 14px;
  color: var(--bsp-h3-text);
}

.bsp-h3-search__input::placeholder {
  color: var(--bsp-h3-muted);
}

.bsp-h3-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0 22px;
  border: 0;
  background: var(--bsp-h3-primary);
  color: var(--bsp-h3-primary-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.bsp-h3-search__submit:hover {
  opacity: 0.92;
}

.bsp-h3-search__submit i {
  font-size: 14px;
}

/* ---- Promo box ---- */

.bsp-h3-promo-wrap {
  position: relative;
  flex-shrink: 0;
}

.bsp-h3-promo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  padding: 10px 14px;
  border: 1px solid var(--bsp-h3-border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

.bsp-h3-promo__icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bsp-h3-promo-icon) 14%, #ffffff);
  color: var(--bsp-h3-promo-icon);
  font-size: 14px;
  flex-shrink: 0;
}

.bsp-h3-promo__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

.bsp-h3-promo__text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--bsp-h3-text);
}

.bsp-h3-promo__text small {
  font-size: 12px;
  color: var(--bsp-h3-muted);
}

.bsp-h3-promo__caret {
  font-size: 10px;
  color: var(--bsp-h3-muted);
  transition: transform 0.2s ease;
}

.bsp-h3-promo-wrap.is-open .bsp-h3-promo__caret {
  transform: rotate(180deg);
}

.bsp-h3-promo__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid var(--bsp-h3-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
  padding: 6px 0;
  z-index: 70;
}

.bsp-h3-promo__dropdown a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--bsp-h3-text);
  text-decoration: none;
}

.bsp-h3-promo__dropdown a:hover {
  background: #f8f9fb;
}

/* ============ Navbar ============ */

.bsp-h3-navbar {
  background: var(--bsp-h3-bg);
  border-bottom: 1px solid var(--bsp-h3-border);
}

.bsp-h3-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
}

.bsp-h3-nav {
  flex: 1;
  min-width: 0;
}

.bsp-h3-nav__menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bsp-h3-nav__menu > li > a,
.bsp-h3-nav .bsp-mega-menu-parent > .bsp-mega-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--bsp-h3-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.bsp-h3-nav__menu > li > a:hover {
  color: var(--bsp-h3-primary);
}

.bsp-h3-nav__menu > li,
.bsp-h3-nav .bsp-nav-menu > li {
  position: relative;
  display: flex;
  align-items: stretch;
}

.bsp-h3-nav .bsp-has-dropdown > a::after,
.bsp-h3-nav .bsp-mega-menu-parent > .bsp-mega-menu-trigger::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 9px;
  color: var(--bsp-h3-muted);
  margin-left: 4px;
  line-height: 1;
}

.bsp-h3-nav .bsp-submenu-toggle {
  display: none;
}

/* WordPress menu in header 3 */
.bsp-h3-nav .bsp-nav-menu > li {
  position: relative;
}

.bsp-h3-nav .bsp-nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: #ffffff;
  border: 1px solid var(--bsp-h3-border);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.1);
  z-index: 80;
}

@media (min-width: 993px) {
  .bsp-h3-nav .bsp-nav-menu > .menu-item-has-children:not(.bsp-mega-menu-parent):hover > .sub-menu,
  .bsp-h3-nav .bsp-nav-menu > .menu-item-has-children:not(.bsp-mega-menu-parent):focus-within > .sub-menu {
    display: block;
  }
}

.bsp-h3-nav .bsp-nav-menu .sub-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--bsp-h3-text);
  text-decoration: none;
}

.bsp-h3-nav .bsp-nav-menu .sub-menu a:hover {
  background: #f8f9fb;
  color: var(--bsp-h3-primary);
}

/* ---- Utilities ---- */

.bsp-h3-utilities {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.bsp-h3-utilities--mobile {
  display: none;
}

.bsp-h3-help {
  position: relative;
}

.bsp-h3-help__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--bsp-h3-help-bg);
  color: var(--bsp-h3-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.bsp-h3-help__caret {
  font-size: 9px;
  color: var(--bsp-h3-muted);
  transition: transform 0.2s ease;
}

.bsp-h3-help.is-open .bsp-h3-help__caret {
  transform: rotate(180deg);
}

.bsp-h3-help__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid var(--bsp-h3-border);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
  padding: 6px 0;
  z-index: 70;
}

.bsp-h3-help__dropdown a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--bsp-h3-text);
  text-decoration: none;
}

.bsp-h3-help__dropdown a:hover {
  background: #f8f9fb;
}

.bsp-h3-utility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--bsp-h3-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.bsp-h3-utility i {
  font-size: 16px;
}

.bsp-h3-utility__count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bsp-h3-badge-bg);
  color: var(--bsp-h3-badge-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.bsp-h3-utility--wishlist,
.bsp-h3-utility--cart {
  padding-right: 6px;
}

/* ============ Mobile / tablet ============ */

@media (max-width: 992px) {
  .bsp-h3-topbar {
    display: none;
  }

  body.bsp-show-topbar-mobile .bsp-h3-topbar {
    display: block;
  }

  body.bsp-show-topbar-mobile .bsp-h3-topbar__inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .bsp-h3-mobile-toggle {
    display: flex;
    order: 1;
  }

  .bsp-h3-brand {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
  }

  .bsp-h3-utilities--mobile {
    display: flex;
    order: 3;
    margin-left: auto;
    gap: 12px;
  }

  .bsp-h3-utilities--desktop {
    display: none;
  }

  .bsp-h3-promo-wrap {
    order: 4;
  }

  .bsp-h3-search {
    order: 5;
    flex: 0 0 100%;
    min-width: 0;
  }

  .bsp-h3-main__inner {
    flex-wrap: wrap;
    gap: 14px;
    min-height: 0;
    padding: 12px 0 10px;
  }

  .bsp-h3-promo {
    min-width: 0;
    padding: 8px 10px;
  }

  .bsp-h3-promo__text strong {
    font-size: 12px;
  }

  .bsp-h3-promo__text small {
    display: none;
  }

  .bsp-h3-navbar__inner {
    flex-wrap: wrap;
    min-height: 0;
  }

  .bsp-h3-navbar:not(:has(.bsp-h3-nav.is-open)) {
    border-bottom: 0;
  }

  .bsp-h3-navbar:not(:has(.bsp-h3-nav.is-open)) .bsp-h3-navbar__inner {
    min-height: 0;
    padding: 0;
  }

  .bsp-h3-utilities {
    gap: 12px;
  }

  .bsp-h3-help__toggle span,
  .bsp-h3-utility span:not(.screen-reader-text):not(.bsp-h3-utility__count) {
    display: none;
  }

  .bsp-h3-help__caret {
    display: none;
  }

  .bsp-h3-nav {
    order: 2;
    flex: 0 0 100%;
  }

  .bsp-h3-nav:not(.is-open) {
    display: none;
  }

  .bsp-h3-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-h3-border);
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.1);
    z-index: 499;
    padding: 8px 16px 16px;
  }

  .bsp-h3-nav__menu {
    display: block;
  }

  .bsp-h3-nav__menu > li > a {
    display: flex;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .bsp-h3-nav .bsp-has-dropdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .bsp-h3-nav .bsp-has-dropdown > a {
    flex: 1;
    min-width: 0;
  }

  .bsp-h3-nav .bsp-has-dropdown > a::after,
  .bsp-h3-nav .bsp-mega-menu-parent > .bsp-mega-menu-trigger::after {
    display: none;
  }

  .bsp-h3-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-h3-text);
    appearance: none;
    -webkit-appearance: none;
  }

  .bsp-h3-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-h3-nav .bsp-submenu-toggle[aria-expanded="true"] .bsp-submenu-toggle__icon {
    transform: rotate(180deg);
  }

  .bsp-h3-nav .bsp-nav-menu .sub-menu {
    position: static;
    display: none;
    border: 0;
    box-shadow: none;
    padding-left: 14px;
  }

  .bsp-h3-nav .bsp-has-dropdown.is-submenu-open > .sub-menu,
  .bsp-h3-nav .bsp-mega-menu-parent.is-open > .bsp-mega-menu {
    display: block;
    flex: 0 0 100%;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .bsp-h3-logo__title {
    font-size: 20px;
  }

  .bsp-h3-search__submit-text {
    display: none;
  }

  .bsp-h3-search__submit {
    padding: 0 16px;
  }

  .bsp-h3-promo-wrap {
    display: none;
  }
}
