/* ==========================================================================
   JMCL — Header (3 layers), mega menu, drawer, search overlay, footer, floats
   ========================================================================== */

/* ---------- A. Top bar ---------- */
.jm-topbar { background: var(--jm-dark); color: var(--jm-on-dark-soft); font-size: var(--jm-fs-xs); }
.jm-topbar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--jm-s3); min-height: 40px; padding-block: .3rem; }
.jm-topbar a { color: var(--jm-on-dark-soft); display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; }
.jm-topbar a:hover { color: #fff; text-decoration: none; }
.jm-topbar svg { width: 15px; height: 15px; flex: none; }
.jm-topbar__date { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.jm-topbar__right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--jm-s4); }
.jm-topbar__social { display: flex; gap: .25rem; }
.jm-topbar__social a { width: 32px; height: 32px; justify-content: center; border-radius: 50%; background: var(--jm-on-dark-fill); }
.jm-topbar__social a:hover { background: var(--jm-primary); color: #fff; }
.jm-langswitch { display: inline-flex; align-items: center; border: 1px solid var(--jm-on-dark-line); border-radius: var(--jm-r-pill); overflow: hidden; }
.jm-langswitch a { padding: .15rem .6rem; min-height: 28px; font-weight: 600; font-family: var(--jm-font-head); }
.jm-langswitch a[aria-current="true"] { background: var(--jm-primary); color: #fff; }
@media (max-width: 767px) {
  .jm-topbar__inner { justify-content: center; }
  .jm-topbar__right { justify-content: center; gap: var(--jm-s3); }
}

/* ---------- B. Brand header ---------- */
.jm-masthead { background: #fff; border-bottom: 1px solid var(--jm-border); }
.jm-masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--jm-s6); padding-block: var(--jm-s4); }
.jm-brand { display: flex; align-items: center; gap: var(--jm-s4); text-decoration: none; min-width: 0; }
.jm-brand:hover { text-decoration: none; }
.jm-brand__logo { display: block; flex: none; line-height: 0; }
/* Cap both dimensions: JMCL's logo is a wide horizontal lockup — 2048x301, so
   6.8:1 — and height alone would let it push the rest of the masthead off the
   row. Because it is that wide, max-width is the cap that actually binds: at
   320px it was only drawing 47px tall despite the 58px allowance. Both numbers
   are raised together so the height is what decides. */
.jm-brand__logo img { height: 72px; width: auto; max-width: 440px; object-fit: contain; }
/* With a wordmark logo the text column only carries the location and tagline. */
.jm-brand--has-logo .jm-brand__text { padding-inline-start: var(--jm-s2); border-inline-start: 1px solid var(--jm-border); }
.jm-brand--has-logo .jm-brand__text:empty { display: none; }
.jm-brand__mark { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: var(--jm-r); background: var(--jm-dark); color: #fff; font-family: var(--jm-font-head); font-weight: 700; font-size: 1.35rem; }
.jm-brand__text { min-width: 0; }
.jm-brand__name { display: block; font-family: var(--jm-font-head); font-weight: 700; font-size: clamp(1rem, .9rem + .45vw, 1.25rem); color: var(--jm-heading); line-height: 1.25; }
.jm-brand__loc, .jm-brand__tagline { display: flex; align-items: center; gap: .3rem; font-size: var(--jm-fs-xs); color: var(--jm-muted); line-height: 1.5; }
.jm-brand__loc svg { width: 13px; height: 13px; flex: none; color: var(--jm-cta-ink); }
.jm-brand__tagline { color: var(--jm-accent-ink); font-weight: 600; }
.jm-masthead__actions { display: flex; align-items: center; gap: var(--jm-s3); flex: none; }
@media (max-width: 1023px) {
  .jm-masthead__inner { padding-block: var(--jm-s3); }
  .jm-brand__logo img { height: 58px; max-width: 320px; }
  .jm-brand__mark { width: 44px; height: 44px; font-size: 1.1rem; }
  .jm-brand__tagline { display: none; }
  .jm-brand--has-logo .jm-brand__text { padding-inline-start: .6rem; }
}
@media (max-width: 767px) {
  /* On a phone the logo carries the identity on its own, and by this width the
     masthead's buttons are gone too — so nothing else is competing for the row
     and the lockup runs the full width of the container. At 6.8:1 that is a
     little over 50px tall on a 375px screen, against 34px before. */
  .jm-brand--has-logo .jm-brand__text { display: none; }
  .jm-masthead__inner { gap: 0; }
  .jm-brand, .jm-brand__logo { width: 100%; }
  .jm-brand__logo img { width: 100%; height: auto; max-width: none; }
}

/* ---------- C. Sticky navbar ---------- */
.jm-navbar { background: var(--jm-primary); position: sticky; top: 0; z-index: var(--jm-z-sticky); transition: box-shadow var(--jm-t) var(--jm-ease); }
/* The navbar deliberately stays below the scrim while the drawer is open:
   lifting it above put a blue band straight across the open menu. The drawer
   carries its own close button, so the burger does not need to stay live. */
.jm-navbar.is-stuck { box-shadow: var(--jm-e3); }
.jm-navbar__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--jm-s4); }
.jm-nav { display: none; }
@media (min-width: 1024px) { .jm-nav { display: block; flex: 1; } }
.jm-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.jm-menu > li { position: relative; }
.jm-menu > li > a, .jm-menu > li > button {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 52px; padding: 0 .8rem;
  color: #fff; font-family: var(--jm-font-head); font-size: var(--jm-fs-sm); font-weight: 500;
  text-decoration: none; position: relative; transition: background var(--jm-t) var(--jm-ease);
}
.jm-menu > li > a:hover, .jm-menu > li > button:hover,
.jm-menu > li.is-open > a, .jm-menu > li.is-open > button { background: var(--jm-primary-700); color: #fff; text-decoration: none; }
.jm-menu > li.current-menu-item > a, .jm-menu > li.current-menu-ancestor > a, .jm-menu > li > a[aria-current="page"] { font-weight: 700; }
.jm-menu > li.current-menu-item > a::after, .jm-menu > li.current-menu-ancestor > a::after, .jm-menu > li > a[aria-current="page"]::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: 8px; height: 3px; border-radius: 2px; background: var(--jm-cta);
}
.jm-menu__caret { width: 15px; height: 15px; transition: transform var(--jm-t) var(--jm-ease); }
.jm-menu > li.is-open .jm-menu__caret { transform: rotate(180deg); }

/* Dropdown */
.jm-subnav {
  list-style: none; margin: 0; padding: .5rem; position: absolute; top: 100%; inset-inline-start: 0;
  min-width: 250px; background: #fff; border: 1px solid var(--jm-border); border-radius: 0 0 var(--jm-r) var(--jm-r);
  box-shadow: var(--jm-e3); z-index: 2;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--jm-t) var(--jm-ease), transform var(--jm-t) var(--jm-ease), visibility var(--jm-t);
}
.jm-menu > li.is-open > .jm-subnav { opacity: 1; visibility: visible; transform: none; }
.jm-subnav a { display: block; padding: .6rem .875rem; min-height: 44px; border-radius: var(--jm-r-sm); color: var(--jm-heading); font-size: var(--jm-fs-sm); font-weight: 500; }
.jm-subnav a:hover { background: var(--jm-tint-2); color: var(--jm-primary-700); text-decoration: none; }

/* Mega menu */
.jm-mega {
  position: absolute; top: 100%; inset-inline-start: 0; width: min(1060px, calc(100vw - 4rem));
  background: #fff; border: 1px solid var(--jm-border); border-radius: 0 0 var(--jm-r-lg) var(--jm-r-lg);
  box-shadow: var(--jm-e3); padding: var(--jm-s8); z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr) minmax(220px, .85fr); gap: var(--jm-s8);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--jm-t) var(--jm-ease), transform var(--jm-t) var(--jm-ease), visibility var(--jm-t);
}
.jm-menu > li.is-open > .jm-mega { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 1280px) { .jm-mega { inset-inline-start: 50%; transform: translateX(-50%) translateY(-6px); } .jm-menu > li.is-open > .jm-mega { transform: translateX(-50%); } }
.jm-mega__col h3 { font-size: var(--jm-fs-xs); text-transform: uppercase; color: var(--jm-cta-ink); margin-bottom: var(--jm-s3); padding-bottom: var(--jm-s2); border-bottom: 1px solid var(--jm-border); }
.jm-mega__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.jm-mega__col a { display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem; min-height: 40px; border-radius: var(--jm-r-sm); color: var(--jm-text); font-size: var(--jm-fs-sm); }
.jm-mega__col a:hover { background: var(--jm-tint-2); color: var(--jm-primary-700); text-decoration: none; }
.jm-mega__col a svg { width: 16px; height: 16px; color: var(--jm-accent-ink); flex: none; }
.jm-mega__col a.is-viewall { color: var(--jm-primary); font-weight: 600; }
.jm-mega__promo { background: var(--jm-dark); color: #fff; border-radius: var(--jm-r-lg); padding: var(--jm-s6); display: flex; flex-direction: column; gap: var(--jm-s3); }
.jm-mega__promo h3 { color: #fff; font-size: var(--jm-fs-base); border: 0; text-transform: none; margin: 0; }
.jm-mega__promo p { color: var(--jm-on-dark-soft); font-size: var(--jm-fs-sm); margin: 0; }
.jm-mega__promo .jm-btn { margin-top: auto; }

.jm-navbar__tools { display: flex; align-items: center; gap: .25rem; flex: none; }
.jm-navbar__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; transition: background var(--jm-t) var(--jm-ease); }
.jm-navbar__icon:hover { background: var(--jm-primary-700); color: #fff; }
.jm-navbar__icon svg { width: 21px; height: 21px; }

/* Hamburger */
.jm-burger { display: inline-flex; align-items: center; gap: .5rem; min-height: 52px; padding: 0 .75rem; color: #fff; font-family: var(--jm-font-head); font-size: var(--jm-fs-sm); font-weight: 600; }
@media (min-width: 1024px) { .jm-burger { display: none; } }
.jm-burger__bars { width: 22px; height: 16px; position: relative; flex: none; }
.jm-burger__bars span { position: absolute; left: 0; width: 100%; height: 2px; background: #fff; border-radius: 2px; transition: transform var(--jm-t) var(--jm-ease), opacity var(--jm-t-fast) var(--jm-ease); }
.jm-burger__bars span:nth-child(1) { top: 0; }
.jm-burger__bars span:nth-child(2) { top: 7px; }
.jm-burger__bars span:nth-child(3) { top: 14px; }
/* No X transform while the drawer is open. The burger sits behind the scrim at
   that point, so an X there is a dimmed decoy next to the drawer's real close
   button — two closes, one of which does not look pressable. */

/* ---------- Off-canvas drawer ---------- */
.jm-scrim { position: fixed; inset: 0; z-index: var(--jm-z-scrim); background: rgba(5,25,40,.6); opacity: 0; visibility: hidden; transition: opacity var(--jm-t) var(--jm-ease), visibility var(--jm-t); }
.jm-scrim.is-open { opacity: 1; visibility: visible; }
.jm-drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: var(--jm-z-drawer);
  width: min(360px, 88vw); background: #fff; box-shadow: var(--jm-e4);
  transform: translateX(105%); transition: transform var(--jm-t-slow) var(--jm-ease-out);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
}
.jm-drawer.is-open { transform: none; }
.jm-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--jm-s4); padding: var(--jm-s4) var(--jm-s5); border-bottom: 1px solid var(--jm-border); position: sticky; top: 0; background: #fff; z-index: 1; }
.jm-drawer__close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--jm-muted); }
.jm-drawer__close:hover { background: var(--jm-tint-2); color: var(--jm-heading); }
.jm-drawer__close svg { width: 22px; height: 22px; }
.jm-drawer__body { padding: var(--jm-s4) var(--jm-s5) var(--jm-s10); }
.jm-drawer__menu, .jm-drawer__menu ul { list-style: none; margin: 0; padding: 0; }
.jm-drawer__menu a { display: block; padding: .75rem .25rem; min-height: 48px; color: var(--jm-heading); font-family: var(--jm-font-head); font-weight: 600; font-size: var(--jm-fs-base); border-bottom: 1px solid var(--jm-border); }
.jm-drawer__menu a:hover { color: var(--jm-primary); text-decoration: none; }
.jm-drawer__menu li.has-children > .jm-drawer__row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--jm-border); }
.jm-drawer__menu li.has-children > .jm-drawer__row > a { border-bottom: 0; flex: 1; }
.jm-drawer__toggle { width: 48px; height: 48px; display: grid; place-items: center; color: var(--jm-primary); flex: none; }
.jm-drawer__toggle svg { width: 20px; height: 20px; transition: transform var(--jm-t) var(--jm-ease); }
.jm-drawer__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.jm-drawer__menu ul { padding-inline-start: var(--jm-s4); }
.jm-drawer__menu ul a { font-weight: 500; font-size: var(--jm-fs-sm); color: var(--jm-muted); min-height: 44px; }
.jm-drawer__menu ul[hidden] { display: none; }
.jm-drawer__actions { display: grid; gap: var(--jm-s3); margin-top: var(--jm-s6); }
.jm-drawer__contact { margin-top: var(--jm-s6); padding-top: var(--jm-s6); border-top: 1px solid var(--jm-border); display: grid; gap: var(--jm-s3); font-size: var(--jm-fs-sm); }
.jm-drawer__contact a { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; color: var(--jm-muted); }
.jm-drawer__contact svg { width: 17px; height: 17px; color: var(--jm-primary); flex: none; }
body.jm-locked { overflow: hidden; }

/* ---------- Search overlay ---------- */
.jm-search-overlay {
  position: fixed; inset: 0; z-index: var(--jm-z-modal); background: rgba(7,44,70,.97);
  display: grid; align-content: start; padding: clamp(1rem, 6vh, 5rem) var(--jm-gutter);
  opacity: 0; visibility: hidden; transition: opacity var(--jm-t) var(--jm-ease), visibility var(--jm-t);
}
.jm-search-overlay.is-open { opacity: 1; visibility: visible; }
.jm-search-overlay__inner { width: min(760px, 100%); margin-inline: auto; }
.jm-search-overlay__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--jm-s4); margin-bottom: var(--jm-s6); color: #fff; }
.jm-search-overlay label { display: block; color: #fff; font-family: var(--jm-font-head); font-weight: 600; margin-bottom: var(--jm-s3); }
.jm-search-overlay__field { display: flex; gap: var(--jm-s3); }
.jm-search-overlay input[type="search"] { flex: 1; min-height: 56px; font-size: 1.125rem; border-radius: var(--jm-r-pill); padding-inline: 1.5rem; border: 2px solid transparent; }
.jm-search-overlay__hint { color: var(--jm-on-dark-mute); font-size: var(--jm-fs-sm); margin-top: var(--jm-s4); }
.jm-search-overlay__close { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
.jm-search-overlay__close:hover { background: rgba(255,255,255,.24); }
.jm-search-overlay__close svg { width: 24px; height: 24px; }

/* ---------- Notice ticker ---------- */
.jm-ticker { background: var(--jm-dark-2); color: #fff; font-size: var(--jm-fs-sm); overflow: hidden; }
.jm-ticker__inner { display: flex; align-items: center; gap: var(--jm-s4); min-height: 44px; }
.jm-ticker__label { flex: none; display: inline-flex; align-items: center; gap: .4rem; background: var(--jm-cta-ink); color: #fff; padding: .3rem .875rem; border-radius: var(--jm-r-pill); font-family: var(--jm-font-head); font-size: var(--jm-fs-xs); font-weight: 600; }
.jm-ticker__label svg { width: 15px; height: 15px; }
.jm-ticker__viewport { flex: 1; overflow: hidden; min-width: 0; }
.jm-ticker__track { display: flex; gap: var(--jm-s10); white-space: nowrap; animation: jm-marquee 38s linear infinite; will-change: transform; }
.jm-ticker__viewport:hover .jm-ticker__track, .jm-ticker__viewport:focus-within .jm-ticker__track { animation-play-state: paused; }
.jm-ticker__track a { color: var(--jm-on-dark-soft); }
.jm-ticker__track a:hover { color: #fff; }
.jm-ticker__pause { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--jm-on-dark-fill); }
.jm-ticker__pause svg { width: 16px; height: 16px; }
.jm-ticker.is-paused .jm-ticker__track { animation-play-state: paused; }
@keyframes jm-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .jm-ticker__track { animation: none; white-space: normal; flex-wrap: wrap; gap: var(--jm-s4); }
}

/* ---------- Footer ---------- */
.jm-footer { background: var(--jm-dark); color: var(--jm-on-dark-soft); border-top: 4px solid var(--jm-cta); font-size: var(--jm-fs-sm); }
.jm-footer a { color: var(--jm-on-dark-soft); }
.jm-footer a:hover { color: #fff; }
.jm-footer h3 { color: #fff; font-size: var(--jm-fs-base); margin-bottom: var(--jm-s4); position: relative; padding-bottom: var(--jm-s3); }
.jm-footer h3::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 36px; height: 3px; border-radius: 2px; background: var(--jm-cta); }
.jm-footer__top { padding-block: var(--jm-s10) var(--jm-s8); border-bottom: 1px solid var(--jm-on-dark-line); display: flex; flex-wrap: wrap; gap: var(--jm-s6); align-items: center; justify-content: space-between; }
.jm-footer__brand { display: flex; align-items: center; gap: var(--jm-s4); max-width: 620px; }
.jm-footer__brand img { height: 56px; width: auto; }
.jm-footer__brand p { margin: 0; color: var(--jm-on-dark-soft); }
.jm-footer__social { display: flex; gap: .5rem; }
.jm-footer__social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--jm-on-dark-fill); border: 1px solid var(--jm-on-dark-line); }
.jm-footer__social a:hover { background: var(--jm-primary); border-color: var(--jm-primary); }
.jm-footer__social svg { width: 20px; height: 20px; }
.jm-footer__cols { padding-block: var(--jm-s10); display: grid; gap: var(--jm-s10); grid-template-columns: 1fr; }
@media (min-width: 640px) { .jm-footer__cols { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .jm-footer__cols { grid-template-columns: 1.15fr .85fr 1.1fr 1.1fr; gap: var(--jm-s8); } }
.jm-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.jm-footer__links a { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; }
.jm-footer__links a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--jm-accent); flex: none; }
.jm-footer__notice { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--jm-s4); }
.jm-footer__notice li { display: grid; gap: .2rem; }
.jm-footer__notice time { font-size: var(--jm-fs-xs); color: var(--jm-on-dark-mute); }
.jm-footer__contact { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--jm-s4); }
.jm-footer__contact li { display: grid; grid-template-columns: 20px 1fr; gap: var(--jm-s3); align-items: start; }
.jm-footer__contact svg { width: 18px; height: 18px; color: var(--jm-accent); margin-top: 4px; }
.jm-footer__bottom { border-top: 1px solid var(--jm-on-dark-line); padding-block: var(--jm-s5); display: flex; flex-wrap: wrap; gap: var(--jm-s3) var(--jm-s6); align-items: center; justify-content: space-between; font-size: var(--jm-fs-xs); color: var(--jm-on-dark-mute); }
.jm-footer__bottom nav { display: flex; flex-wrap: wrap; gap: var(--jm-s4); }

/* ---------- Floating actions ---------- */
.jm-floats { position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: var(--jm-z-sticky); display: grid; gap: .625rem; justify-items: end; }
.jm-float {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; box-shadow: var(--jm-e3); transition: transform var(--jm-t) var(--jm-ease), box-shadow var(--jm-t) var(--jm-ease);
}
.jm-float:hover { transform: scale(1.06); color: #fff; box-shadow: var(--jm-e4); }
.jm-float svg { width: 26px; height: 26px; }
.jm-float--whatsapp { background: #25D366; }
.jm-float--viber { background: #7360F2; }
.jm-float--call { background: var(--jm-accent-ink); }
.jm-float--top { background: var(--jm-dark); opacity: 0; visibility: hidden; transform: translateY(10px); }
.jm-float--top.is-visible { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 1024px) { .jm-float--call { display: none; } }
@media (max-width: 480px) { .jm-floats { inset-inline-end: .75rem; bottom: .75rem; } .jm-float { width: 48px; height: 48px; } }

/* ---------- Notice popup ---------- */
.jm-popup { border: 0; padding: 0; max-width: min(560px, calc(100vw - 2rem)); border-radius: var(--jm-r-xl); overflow: hidden; box-shadow: var(--jm-e4); }
.jm-popup::backdrop { background: rgba(5,25,40,.75); }
.jm-popup__head { background: var(--jm-dark); color: #fff; padding: var(--jm-s4) var(--jm-s5); display: flex; align-items: center; justify-content: space-between; gap: var(--jm-s4); }
.jm-popup__head h2 { color: #fff; font-size: var(--jm-fs-base); margin: 0; }
.jm-popup__close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--jm-on-dark-fill); flex: none; }
.jm-popup__close svg { width: 20px; height: 20px; }
.jm-popup__body { padding: 0; }
.jm-popup__body img { width: 100%; }
.jm-popup__body embed, .jm-popup__body iframe { width: 100%; height: 60vh; border: 0; }
.jm-popup__foot { padding: var(--jm-s4) var(--jm-s5); display: flex; flex-wrap: wrap; gap: var(--jm-s3); justify-content: flex-end; border-top: 1px solid var(--jm-border); }
