/* new: namespaced CSS for header, badges and mobile panel */

:root {
  --shm-bg: #ffffff;
  --shm-fg: #111111;
  --shm-muted: #6b7280;
  --shm-topbar-bg: #000000;
  --shm-topbar-fg: #ffffff;
  --shm-accent: #111111;
  --shm-badge-color: #ffd34d; /* default, can be overridden inline */
  --shm-action-icon: #111111; /* admin can override in Customizer/Additional CSS */
}

.shm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.shm-header {
  position: relative;
  width: 100%;
  color: var(--shm-fg);
  background: var(--shm-bg);
  z-index: 999;
}
.shm-header.is-sticky {
  position: sticky;
  top: 0;
}

/* Topbar */
.shm-topbar {
  background: var(--shm-topbar-bg); /* was #000 */
  color: var(--shm-topbar-fg); /* was #fff */
  font-size: 13px;
  line-height: 34px;
  text-align: center;
  max-height: 40px;
  overflow: hidden;
  transition: max-height .25s ease, padding .25s ease, border .25s ease;
  will-change: transform;
  transition: transform 200ms ease, opacity 200ms ease;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.shm-topbar.is-hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border: 0;
  transform: translateY(-100%);
  opacity: 0.98;
}

/* Middle row */
.shm-middle {
  background: var(--shm-bg);
  
}
.shm-middle__row {
  display: flex;
  align-items: center;
  gap: 12px;
  
  flex-wrap: wrap; /* allows search to move to bottom row */
  align-items: center;
}
.shm-hamburger {
  display: none; /* override earlier inline-flex on desktop */
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  order: 0;
  z-index: 3;
}
.shm-hamburger span {
  display: block;
  height: 3px !important;
  width: 24px !important;   /* ⬅️ was 100%, now fixed width */
  margin: 4px 0 !important;
  background: var(--shm-fg) !important;
  border-radius: 2px;
  transition: all 0.25s ease-in-out;
}

.shm-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  order: 1; /* logo next to hamburger on the left */
  flex: 0 0 auto;
  margin-left: 6px;
}
.shm-logo__text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
}
.shm-logo--mobile {
  display: none;
}

/* Pill search styling (beige rounded, icon-only button) */
.shm-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 380px; /* was 440px */
  margin: 0 auto;
  position: relative; /* ensure absolute icon positioning */
  background: #efebe4; /* beige */
  border: 1px solid #ede7df;
  border-radius: 9999px;
  padding: 4px 12px; /* was 6px 12px */
  min-height: 34px; /* was 38px */
}
.shm-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #111;
  padding: 0;
  cursor: pointer;
}
.shm-search-btn .fa-solid {
  font-size: 15px;
  line-height: 1;
}
.shm-search-input {
  flex: 1;
  border: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  outline: none !important;
  font-size: 13px; /* was 14px */
  color: #222;
  padding-left: 12px; /* was 34px */
  padding-right: 34px; /* room for icon on right */
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}
.shm-search-input::placeholder {
  color: #7a746b;
}
.shm-search-btn:hover {
  color: #000;
}
.shm-search-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Suggestions dropdown */
.shm-search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 340px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 6px 0;
  display: none;
  z-index: 1000;
}
.shm-suggest__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.shm-suggest__item:hover {
  background: #faf9f7;
}
.shm-suggest__img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f3f3;
}
.shm-suggest__content {
  display: flex;
  flex-direction: column;
}
.shm-suggest__title {
  font-size: 14px;
  color: #111;
}
.shm-suggest__price {
  font-size: 13px;
  color: #666;
}

/* Loader inside pill */
.shm-search-loader {
  position: absolute;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}
.shm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  animation: shmspin .8s linear infinite;
}
@keyframes shmspin {
  to {
    transform: rotate(360deg);
  }
}

.shm-adv-search {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  order: 3; /* move search to its own bottom row */
  flex: 1 1 100%;
  width: 100%;
  margin-top: 8px;
}

.shm-middle.is-compact .shm-middle__row {
  padding: 6px 0;
}

/* Bottom nav */
.shm-bottom {
  background: var(--shm-bg);
}
.shm-nav {
  display: flex;
  justify-content: center;
}
.shm-menu {
  display: flex;
  gap: 20px;
  align-items: center;
  list-style: none;
  padding: 10px 0;
  margin: 0;
}
.shm-menu li {
  position: relative; /* anchor for absolutely positioned submenus */
}
.shm-menu__item {
  position: relative;
}
.shm-menu__link {
  text-decoration: none;
  color: #111;
  font-size: 14px;
  line-height: 1.6; /* updated */
  display: inline-flex; /* was inline/block */
  align-items: center;
  min-height: 28px; /* consistent height across items */
  vertical-align: middle;
}
.shm-menu__link:hover {
  color: #000;
}

/* Badges */
.shm-badge {
  --_c: var(--shm-badge-color, #ffd34d);
  background: var(--_c);
  color: #111;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1; /* keep pill tight */
}
.shm-badge--inline-left {
  margin-right: 6px;
  margin-left: 0;
  order: -1;
}
.shm-badge--above {
  position: absolute;
  top: -8px; /* was -10px, a bit closer */
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  padding: 2px 8px; /* capsule feel */
  white-space: nowrap;
}
.shm-has-badge-above > .shm-menu__link {
  position: relative;
  display: inline-flex; /* was inline-block — this caused vertical misalignment */
  align-items: center; /* align text baseline consistently */
  padding-top: 0; /* do not push item down */
  min-height: 28px; /* match the default item height */
}

/* Submenu dropdowns */
.shm-menu li > ul.sub-menu {
  position: absolute;
  top: 100%; /* was calc(100% + 10px) */
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  display: none;
  z-index: 1000;
  list-style: none; /* remove bullets */
  margin: 0;
}
.shm-menu li > ul.sub-menu > li {
  list-style: none; /* ensure no bullets on li */
}
.shm-menu li > ul.sub-menu > li > a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
}
.shm-menu li > ul.sub-menu > li > a:hover {
  background: #faf9f7;
}
.shm-menu li.menu-item-has-children::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 16px; /* was 10px */
  display: block;
}
@media (min-width: 769px) {
  .shm-menu li.menu-item-has-children:hover > ul.sub-menu,
  .shm-menu li.menu-item-has-children:focus-within > ul.sub-menu {
    display: block;
  }
}

/* Mobile panel */
.shm-mobile {
  position: fixed;
  inset: 0 auto 0 0;
  width: 86%;
  max-width: 360px;
  background: #fff;
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 9999; /* increase z-index so panel overlays theme elements (Astra header, etc.) */
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}
.shm-mobile[aria-hidden="false"] {
  transform: translateX(0);
}
body.shm-mobile-open {
  overflow: hidden;
}

.shm-mobile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}
.shm-mobile__title {
  font-weight: 600;
  letter-spacing: .08em;
}
.shm-mobile__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--shm-fg) !important; /* ensure close (×) icon is visible against light/dark content */
  opacity: 1 !important;
  z-index: 2;
  display: inline-block;
}
.shm-mobile__body {
  overflow: auto;
  padding: 6px 0;
}

.shm-mobile__menu,
.shm-mobile__menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.shm-mobile__menu > li {
  border-bottom: 1px solid #f1f1f1;
}
.shm-mobile__menu a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 16px;
}
.shm-mobile__menu .shm-badge.shm-badge--above {
  position: relative;
  transform: none;
  left: auto;
  top: auto;
  margin: 0 0 2px 0;
  font-size: 11px;
}
.shm-mobile__menu .menu-item-has-children > a::after {
  align-self: flex-end;
  margin-top: -18px;
  content: "+";
  margin-left: 8px;
  color: #666;
}
.shm-mobile__menu .menu-item-has-children.is-open > a::after {
  content: "−";
}
.shm-mobile__menu .menu-item-has-children > ul {
  display: none;
  padding-left: 8px;
  background: #fafafa;
}
.shm-mobile__menu .menu-item-has-children.is-open > ul {
  display: block;
}
.shm-mobile__menu .menu-item-has-children .shm-badge.shm-badge--above {
  position: static;
  transform: none;
  margin: 0 0 6px auto;
}

/* Astra compatibility: hide theme header only when user enables option */
.shm-hide-theme-header .site-header,
.shm-hide-theme-header .ast-hfb-header {
  display: none !important;
}

/* Hide Astra menu components when our header is active to avoid duplicate menus on desktop */
body.shm-header-active .ast-builder-menu,
body.shm-header-active .main-header-menu,
body.shm-header-active .ast-desktop .main-header-bar-navigation,
body.shm-header-active .ast-mobile-header-wrap .ast-builder-menu {
  display: none !important;
}

/* hide desktop nav whenever mobile panel is open (prevents both menus showing) */
body.shm-mobile-open .shm-nav {
  display: none !important;
}

/* Also hide Astra menu components while our mobile panel is open */
body.shm-mobile-open .ast-builder-menu,
body.shm-mobile-open .main-header-menu,
body.shm-mobile-open .ast-desktop .main-header-bar-navigation,
body.shm-mobile-open .ast-mobile-header-wrap .ast-builder-menu {
  display: none !important;
}

/* ensure mobile menu unaffected by desktop hover dropdowns */
@media (max-width: 768px) {
  .shm-middle__row {
    gap: 8px;
  }
  .shm-hamburger {
    display: inline-flex;
    order: 0;
    margin-right: 4px;
    z-index: 2;
  }
  .shm-logo {
    order: 1;
    margin-left: 6px;
  }
  .shm-icons {
    order: 2;
    margin-left: auto;
    gap: 10px;
  }
  .shm-adv-search {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 6px;
  }
}

/* allow admin to set action icon colors consistently */
.shm-actions a,
.shm-actions a i,
.shm-actions button,
.shm-actions svg,
.shm-icons a,
.shm-icons a i,
.shm-icons button,
.shm-icons svg {
  color: var(--shm-action-icon) !important;
  fill: var(--shm-action-icon) !important;
}

/* force-remove any UA/theme borders from the search input */
.shm-search-input,
.shm-search-wrap input[type="search"] {
  border: 0 !important;
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
}
.shm-search-wrap input[type="search"]::-webkit-search-decoration,
.shm-search-wrap input[type="search"]::-webkit-search-cancel-button,
.shm-search-wrap input[type="search"]::-webkit-search-results-button,
.shm-search-wrap input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* scope bottom-row search behavior to mobile only; restore desktop defaults */
.shm-adv-search {
  /* desktop/default behavior restored */
  flex: 0 1 auto; /* was flex: 1 1 100% */
  max-width: 640px;
  margin: 0 auto; /* keep centered inline on desktop */
  order: initial; /* was order: 3 */
  width: auto; /* was width: 100% */
  /* was margin-top: 8px; */
}

/* ensure mobile close (×) button always visible */
.shm-mobile__close {
  color: var(--shm-fg) !important;
  opacity: 1 !important;
  z-index: 2;
  display: inline-block;
}

/* optional: ensure desktop ordering remains natural */
@media (min-width: 769px) {
  .shm-logo {
    order: 0;
    margin-left: 0;
  }
  .shm-logo--mobile {
    display: none !important;
  }
  .shm-hamburger {
    display: none !important;
  }
}


/* >>> Mobile header fixes added by assistant to ensure hamburger visibility and correct ordering <<< */
@media (max-width: 768px) {
  /* keep middle row compact and aligned */
  .shm-middle__row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
  }

  /* Ensure hamburger is always visible, above other layers, and uses action icon color when provided */
  .shm-hamburger {
    display: inline-flex !important;
    order: 0 !important;
    margin-right: 8px !important;
    z-index: 9999 !important;
    position: relative !important;
    background: transparent !important;
    padding: 6px !important;
    border-radius: 6px;
  }
  .shm-hamburger span {
    background: var(--shm-action-icon, var(--shm-fg)) !important;
  }

  /* Logo immediately after hamburger */
  .shm-logo {
    order: 1 !important;
    margin-left: 6px !important;
    display: inline-block;
    z-index: 9998;
  }

  /* Icons to the far right */
  .shm-icons {
    order: 2 !important;
    margin-left: auto !important;
    gap: 10px;
    z-index: 9998;
  }

  /* Search bar moves to its own full-width row and is centered */
  .shm-adv-search {
    order: 3 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-top: 6px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  .shm-adv-search .shm-search-wrap {
    width: 100%;
    max-width: 560px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Ensure topbar doesn't block clicks or visuals when hidden */
  .shm-topbar.is-hidden {
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Make sure middle/bottom bars sit above topbar when collapsed */
  .shm-middle, .shm-bottom {
    position: relative;
    z-index: 1000;
  }
}


/* >>> Additional mobile fixes <<< */
@media (max-width: 768px) {
  /* Ensure all hamburger bars show */
  .shm-hamburger {
    width: 28px !important;
    height: auto !important;
  }
  .shm-hamburger span {
    display: block !important;
    height: 2px !important;
    margin: 5px 0 !important;
    width: 100% !important;
    background: var(--shm-action-icon, var(--shm-fg)) !important;
  }

  /* Resize logo smaller */
  .shm-logo img {
    max-height: 32px !important;
    width: auto !important;
  }

  /* Hide desktop navigation/menu on mobile */
  .shm-desktop,
  .shm-bottom .shm-nav,
  .shm-middle .shm-nav {
    display: none !important;
  }
/* PATCH: Ensure hamburger fully visible */
.shm-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 24px;
  cursor: pointer;
  z-index: 1001;
}
.shm-hamburger span {
  display: block;
  height: 3px !important;
  width: 100% !important;
  margin: 4px 0 !important;
  background: var(--shm-fg) !important;
  border-radius: 2px;
}

/* PATCH: Logo size */
.shm-logo img {
  max-height: 48px !important;
}


}
