/* ============================================================
   Site-wide menu, footer and phone Call / Refer bar (hm-*)
   Loaded on every page after style.css. The markup comes from
   premier-spine-care-pages/chrome/site_chrome.py.
   ============================================================ */

/* ---------- Header menu ---------- */
.header--menu .header__inner { max-width: 1440px; }
.header--menu .header__lang { margin-left: var(--space-2); }

.hm-nav { margin-left: auto; }
.hm-nav__list { display: flex; align-items: center; gap: 2px; list-style: none; }
.hm-nav__item { position: relative; }
.hm-nav__btn { display: inline-flex; align-items: center; gap: 6px; }
.hm-nav__btn svg { flex: none; transition: transform 0.18s ease; }
.hm-nav__item.is-open > .hm-nav__btn svg { transform: rotate(180deg); }
.hm-nav__item.is-open > .hm-nav__btn { color: var(--color-text); background: var(--color-surface-offset); }

.hm-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: -8px;
  z-index: 120;
  min-width: 310px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--color-divider);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(14, 30, 56, 0.18);
}
.hm-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.hm-menu--wide { min-width: 600px; grid-template-columns: 1fr 1fr; column-gap: 10px; }
.hm-nav__item.is-open > .hm-menu { display: block; }
.hm-nav__item.is-open > .hm-menu--wide { display: grid; }

.hm-menu__head {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.hm-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  text-decoration: none;
}
.hm-menu a small { display: block; margin-top: 1px; font-size: 0.8rem; font-weight: 400; color: var(--color-text-muted); }
.hm-menu a:hover { background: var(--color-primary-light); color: var(--color-primary); }

@media (min-width: 1300px) and (hover: hover) {
  .hm-nav__item:hover > .hm-menu,
  .hm-nav__item:focus-within > .hm-menu { display: block; }
  .hm-nav__item:hover > .hm-menu--wide,
  .hm-nav__item:focus-within > .hm-menu--wide { display: grid; }
}

@media (min-width: 1300px) and (max-width: 1439px) {
  .header--menu .header__cta { padding: var(--space-2); }
  .header--menu .header__cta span { display: none; }
}

@media (max-width: 1299px) {
  .hm-nav { display: none; }
  .header--menu .header__lang { margin-left: auto; }
  .header--menu .hm-nav + .header__cta { margin-left: auto; }
  .header--menu .header__menu-btn { display: flex; }
  .hm-nav.hm-nav--open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    padding: 8px 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--color-divider);
    box-shadow: var(--shadow-lg);
  }
  .hm-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .hm-nav__item + .hm-nav__item { border-top: 1px solid var(--color-divider); }
  .hm-nav .header__nav-link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 15px 8px;
    font-size: 1.06rem;
    color: var(--color-text);
    text-align: left;
  }
  .hm-menu, .hm-menu--wide { position: static; min-width: 0; padding: 0 0 10px; border: 0; border-radius: 0; box-shadow: none; }
  .hm-menu::before { display: none; }
  .hm-nav__item.is-open > .hm-menu--wide { display: block; }
}

/* ---------- Buttons and arrows ---------- */
.hm-more svg, .hm-arrow { flex: none; transition: transform 0.2s ease; }
a:hover > .hm-arrow, .hm-more:hover svg { transform: translateX(3px); }

.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.95rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.hm-btn svg { flex: none; }
.hm-btn:hover { transform: translateY(-2px); }
.hm-btn--white { background: #fff; color: var(--color-primary); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.hm-btn--white:hover { background: var(--color-accent-light); }
.hm-btn--gold { background: #D2AE55; color: #1C1B2E; }
.hm-btn--gold:hover { background: #E0C16F; box-shadow: 0 10px 30px rgba(184, 146, 47, 0.35); }
.hm-btn--navy { background: var(--color-primary); color: #fff; }
.hm-btn--navy:hover { background: var(--color-primary-hover); box-shadow: 0 10px 30px rgba(14, 54, 103, 0.3); }
.hm-btn--line { border-color: var(--color-primary); color: var(--color-primary); }
.hm-btn--line:hover { background: var(--color-primary-light); }
.hm-btn--ghost { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.hm-btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

/* ---------- Footer ---------- */
.hm-foot { padding: clamp(3rem, 6vw, 4.5rem) 0 28px; background: #0A1E38; color: rgba(255, 255, 255, 0.74); font-size: 0.95rem; }
.hm-foot__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.3fr; gap: 36px 32px; }
.hm-foot__brand { font-family: var(--font-display); font-size: 1.6rem; color: #fff; }
.hm-foot__tag { margin: 10px 0 18px; max-width: 30ch; line-height: 1.55; }
.hm-foot__phone { display: inline-flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; color: #EBCF80; text-decoration: none; }
.hm-foot h2 { margin-bottom: 14px; font-family: var(--font-body); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.hm-foot ul { list-style: none; display: grid; gap: 9px; }
.hm-foot a { color: rgba(255, 255, 255, 0.74); text-decoration: none; }
.hm-foot a:hover { color: #fff; text-decoration: underline; }
.hm-foot address { font-style: normal; line-height: 1.55; }
.hm-foot address + address { margin-top: 14px; }
.hm-foot address strong { display: block; color: #fff; }
.hm-foot__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.84rem; color: rgba(255, 255, 255, 0.66); }

/* ---------- Call / Refer bar on phones ---------- */
.hm-bar { display: none; }

@media (max-width: 1100px) {
  .hm-foot__grid { grid-template-columns: repeat(3, 1fr); }
  .hm-foot__grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .hm-foot__grid { grid-template-columns: 1fr 1fr; }
  .hm-foot--bar { padding-bottom: 96px; }

  .hm-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--color-divider);
    box-shadow: 0 -8px 30px rgba(14, 30, 56, 0.12);
    transform: translateY(110%);
    transition: transform 0.3s ease;
  }
  .hm-bar.is-on { transform: none; }
  .hm-bar .hm-btn { padding: 0.8rem 0.6rem; font-size: 0.98rem; }
}

@media (max-width: 560px) {
  .hm-foot__grid { grid-template-columns: 1fr; }
}
