/* =====================================================
   Header CSS (Scoped to fm- classes only)
   File: /theme/css/header.css
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* ── Page Loader ───────────────────────────────────── */
.se-pre-con {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: #fff url('/assets/images/page-loader.gif') center no-repeat;
}

/* ── Global page offset below fixed navbar ─────────────
   Navbar is 72px tall (logo 48px + 12px padding × 2).
   Every inner page gets pushed down automatically.
   Homepage slider intentionally sits behind the navbar
   (full-screen effect) — add class fm-page-home to
   #page-content in your home page include to disable it.
   ────────────────────────────────────────────────────── */
#page-content {
  padding-top: 72px;
}

/* Homepage & any full-bleed hero: no offset needed */
#page-content.fm-page-home,
#page-content.fm-page-fullbleed {
  padding-top: 0;
}

/* ── Navbar ────────────────────────────────────────── */
#mainNav.fm-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  transition: all .25s ease;
}

#mainNav.fm-navbar.fm-scrolled {
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.fm-navbar-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ── Logo ──────────────────────────────────────────── */
.fm-logo img {
  height: 48px;
  width: auto;
  display: block;
}

/* ── Desktop Menu ──────────────────────────────────── */
.fm-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
}

.fm-menu {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fm-menu > li {
  position: relative;
}

.fm-menu > li > a {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  color: #222;
  padding: 6px 4px;
  font-family: 'Open Sans', Arial, sans-serif;
  transition: color .2s ease;
}

.fm-menu > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #fec107, #f94141);
  transition: width .25s ease;
}

.fm-menu > li:hover > a,
.fm-menu > li.fm-active > a {
  color: #f19107;
}

.fm-menu > li:hover > a::after,
.fm-menu > li.fm-active > a::after {
  width: 100%;
}

/* ── Dropdown ──────────────────────────────────────── */
.fm-submenu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 210px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all .2s ease;
  list-style: none;
  margin: 0;
  z-index: 20;
}

.fm-menu > li:hover .fm-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fm-submenu li a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: #444;
  text-decoration: none;
  transition: all .15s ease;
}

.fm-submenu li a:hover {
  background: rgba(254, 193, 7, .09);
  color: #f19107;
  padding-left: 20px;
}

/* ── "See all" parent link — hidden on desktop ─────── */
.fm-submenu-all {
  display: none;
}

/* ── CTA Button ────────────────────────────────────── */
.fm-cta {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fec107, #f94141);
  color: #222;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(249, 65, 65, .32);
  transition: all .15s ease;
  white-space: nowrap;
  font-family: 'Open Sans', Arial, sans-serif;
}

.fm-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(249, 65, 65, .4);
}

/* ── Mobile Toggle Button ──────────────────────────── */
.fm-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .7);
  background: rgba(255, 255, 255, .9);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fm-toggle-lines {
  width: 18px;
  height: 14px;
  position: relative;
  display: block;
}

.fm-toggle-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #111827;
  transition: all .2s ease;
  border-radius: 2px;
}

.fm-toggle-line:nth-child(1) { top: 0; }
.fm-toggle-line:nth-child(2) { top: 6px; }
.fm-toggle-line:nth-child(3) { bottom: 0; }

.fm-toggle.fm-open .fm-toggle-line:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.fm-toggle.fm-open .fm-toggle-line:nth-child(2) {
  opacity: 0;
}

.fm-toggle.fm-open .fm-toggle-line:nth-child(3) {
  bottom: 6px;
  transform: rotate(-45deg);
}

/* ── Mobile / Responsive ───────────────────────────── */
@media (max-width: 991px) {

  .fm-toggle {
    display: inline-flex;
  }

  /* Full-height slide-in panel */
  .fm-menu-wrapper {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    height: calc(100dvh - 72px);
    background: #fff;
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 48px;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s ease, opacity .28s ease, visibility .28s;
    z-index: 9999;
  }

  .fm-menu-wrapper.fm-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Lock page scroll when menu is open */
  body.fm-nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* Flat list — remove flex gap between items */
  .fm-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  /* Each top-level item gets a divider */
  .fm-menu > li {
    border-bottom: 1px solid #f3f3f3;
  }

  /* Top-level links: large touch target, space for chevron */
  .fm-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    font-size: 13px;
    letter-spacing: .06em;
    /* reset desktop underline pseudo */
    border: none;
  }

  /* Desktop underline animation — hide on mobile */
  .fm-menu > li > a::after {
    display: none;
  }

  /* Chevron indicator for items with submenus */
  .fm-has-sub > a .fm-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #bbb;
    border-bottom: 2px solid #bbb;
    transform: rotate(45deg);
    transition: transform .2s ease, border-color .2s ease;
    flex-shrink: 0;
    margin-left: 8px;
  }

  .fm-has-sub.fm-sub-open > a .fm-chevron {
    transform: rotate(-135deg);
    border-color: #f19107;
  }

  .fm-has-sub.fm-sub-open > a {
    color: #f19107;
    background: #fffbf3;
  }

  /* Accordion submenus — collapsed by default */
  .fm-submenu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    opacity: 1;
    visibility: visible;
    transform: none;
    /* Accordion */
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height .3s ease;
  }

  /* Open state */
  .fm-has-sub.fm-sub-open .fm-submenu {
    max-height: 500px;
  }

  .fm-submenu li a {
    padding: 12px 20px 12px 36px;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #efefef;
  }

  .fm-submenu li:last-child a {
    border-bottom: none;
  }

  .fm-submenu li a:hover {
    color: #f19107;
    background: #fff7e6;
    padding-left: 36px; /* keep indent, no shift on mobile */
  }

  /* ── "See all" parent link — mobile only ──────────── */
  .fm-submenu-all {
    display: block;
    border-bottom: 1px solid #eedfc0 !important;
  }

  .fm-submenu-all a {
    padding: 13px 20px 13px 20px !important;
    font-weight: 700 !important;
    color: #f19107 !important;
    background: #fffbf0;
    font-size: 13px;
    letter-spacing: .04em;
  }

  .fm-submenu-all a::before {
    content: "→ ";
  }

  .fm-submenu-all a:hover {
    background: #fff3d6 !important;
    color: #d97b00 !important;
    padding-left: 20px !important;
  }

  /* CTA — full width at the bottom */
  .fm-cta {
    display: block;
    margin: 18px 16px 0;
    text-align: center;
    padding: 14px 18px;
    border-radius: 999px;
    align-self: unset;
  }
}
