/*
 * HomeMart mobile bottom navigation (replaces Journal3 Bottom Menu 266 on phones).
 * Server path: catalog/view/theme/journal3/stylesheet/hm-mobile-nav.css
 * Loaded from Journal → Settings → Custom Code → Header, with ?v=.
 * Every rule is gated on html.hm-mnav-on, which hm-mobile-nav.js sets only
 * where Journal rendered its own bottom menu. Without the JS nothing changes.
 */

html.hm-mnav-on {
  --hm-mnav-h: 62px;
  --hm-mnav-safe: env(safe-area-inset-bottom, 0px);
  --hm-mnav-ink: #2b3036;
  --hm-mnav-muted: #6b737c;
  --hm-mnav-active: #428bca;
  --hm-mnav-call: #02b519;
  --hm-mnav-call-dark: #029a15;
  --hm-mnav-badge: #dd0e1c;
}

/* Old bar out, space reserved for the new one */
html.hm-mnav-on .bottom-menu { display: none !important; }
html.hm-mnav-on body { padding-bottom: calc(var(--hm-mnav-h) + var(--hm-mnav-safe)) !important; }

/* Keep Journal's floating buttons clear of the bar and the raised call button */
html.hm-mnav-on .scroll-top { bottom: calc(var(--hm-mnav-h) + var(--hm-mnav-safe) + 14px) !important; right: 14px !important; }
html.hm-mnav-on .scroll-top i { font-size: 42px !important; }
html.hm-mnav-on.has-bottom-menu .mobile-filter-trigger { margin-bottom: 0 !important; bottom: calc(var(--hm-mnav-h) + var(--hm-mnav-safe) + 34px) !important; }

.hm-mnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: calc(var(--hm-mnav-h) + var(--hm-mnav-safe));
  padding: 0 4px var(--hm-mnav-safe);
  background: #fff;
  border-top: 1px solid #e3e6ea;
  box-shadow: 0 -4px 18px rgba(20, 30, 40, .07);
  font-family: "Exo 2", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.hm-mnav ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  height: var(--hm-mnav-h);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hm-mnav li { margin: 0; padding: 0; display: flex; }

.hm-mnav a {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: var(--hm-mnav-muted) !important;
  text-decoration: none !important;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .01em;
}

.hm-mnav a:active { opacity: .7; }
.hm-mnav a:focus-visible { outline: 2px solid var(--hm-mnav-active); outline-offset: -4px; border-radius: 10px; }

.hm-mnav-ico { position: relative; display: block; width: 24px; height: 24px; }
.hm-mnav svg { display: block; width: 24px; height: 24px; fill: none; stroke: var(--hm-mnav-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hm-mnav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.hm-mnav a[aria-current="page"] { color: var(--hm-mnav-active) !important; font-weight: 600; }
.hm-mnav a[aria-current="page"] svg { stroke: var(--hm-mnav-active); }
.hm-mnav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 3px;
  margin-left: -14px;
  border-radius: 0 0 3px 3px;
  background: var(--hm-mnav-active);
}

/* Count badge: Journal's common.js updates .compare-badge / .count-zero itself */
.hm-mnav .count-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  margin: 0;
  padding: 0 4px;
  border-radius: 9px;
  border: 2px solid #fff;
  background: var(--hm-mnav-badge);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
  transform: none;
  box-sizing: border-box;
}
.hm-mnav .count-badge.count-zero { display: none; }

/* Centre: raised call button */
.hm-mnav-call a { justify-content: flex-end; padding-bottom: 11px; color: var(--hm-mnav-call-dark) !important; font-weight: 700; }
.hm-mnav-call .hm-mnav-fab {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--hm-mnav-call);
  box-shadow: 0 0 0 5px #fff, 0 6px 16px rgba(2, 150, 20, .38);
}
.hm-mnav-call svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 2; }
.hm-mnav-call a:active .hm-mnav-fab { background: var(--hm-mnav-call-dark); transform: scale(.96); }

/* One soft pulse after load draws the eye once, then stays still */
.hm-mnav-call .hm-mnav-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(2, 181, 25, .45);
  animation: hm-mnav-pulse 1.6s ease-out .8s 2;
}
@keyframes hm-mnav-pulse {
  0% { box-shadow: 0 0 0 0 rgba(2, 181, 25, .45); }
  100% { box-shadow: 0 0 0 16px rgba(2, 181, 25, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hm-mnav-call .hm-mnav-fab::after { animation: none; }
}

/* Very narrow phones (≤340px): tighter labels */
@media (max-width: 340px) {
  .hm-mnav a { font-size: 10px; }
}
