/* ==========================================================================
   Mobile Menu — Hamburger, fullscreen-height drawer, accordion submenu
   BEM: .jsf-hamburger__*, .jsf-drawer__*
   ========================================================================== */

/* ---------- Hamburger ---------- */

.jsf-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.jsf-hamburger__line {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--color-heading);
  transition: transform 300ms var(--ease-premium), opacity 300ms var(--ease-premium),
              background-color var(--transition-fast);
}

.jsf-hamburger:hover .jsf-hamburger__line {
  background: var(--color-primary);
}

.jsf-hamburger.is-active .jsf-hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.jsf-hamburger.is-active .jsf-hamburger__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.jsf-hamburger.is-active .jsf-hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Overlay ---------- */

.jsf-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  transition: opacity var(--transition);
}

.jsf-drawer-overlay.is-visible {
  opacity: 1;
}

.jsf-drawer-overlay[hidden] {
  display: none;
}

/* ---------- Drawer ---------- */

.jsf-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 88vw;
  height: 100%;
  background: var(--color-white);
  background-image: linear-gradient(180deg, rgba(255,255,255,.9), rgba(248,251,253,.98));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-large);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.jsf-drawer.is-open {
  transform: translateX(0);
}

.jsf-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.jsf-drawer__logo img {
  width: 130px;
  height: auto;
}

.jsf-drawer__site-title {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  color: var(--color-heading);
}

.jsf-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-heading);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.jsf-drawer__close svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  max-width: none;
}

.jsf-drawer__close:hover {
  background: var(--color-highlight);
  color: var(--color-primary);
}

.jsf-drawer__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.jsf-drawer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.jsf-drawer__menu .jsf-nav__item {
  border-bottom: 1px solid var(--color-border);
}

.jsf-drawer__menu .jsf-nav__link,
.jsf-drawer__menu .jsf-nav__sublink {
  width: 100%;
  padding: 28px 0;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
  justify-content: space-between;
}

.jsf-drawer__menu .jsf-nav__link::after {
  display: none;
}

.jsf-drawer__menu .jsf-nav__chevron {
  transition: transform 300ms var(--ease-premium);
}

.jsf-drawer__menu .jsf-nav__item--has-children.is-expanded > .jsf-nav__link .jsf-nav__chevron {
  transform: rotate(180deg);
}

/* Accordion submenu */

.jsf-drawer__menu .jsf-nav__submenu {
  position: static;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0 0 var(--space-sm) var(--space-sm);
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows var(--transition-slow);
}

.jsf-drawer__menu .jsf-nav__submenu > li {
  overflow: hidden;
  min-height: 0;
}

.jsf-drawer__menu .jsf-nav__item--has-children.is-expanded > .jsf-nav__submenu {
  grid-template-rows: 1fr;
}

.jsf-drawer__menu .jsf-nav__sublink {
  padding: 16px 0;
  font-size: 17px;
  font-weight: var(--fw-medium);
  color: var(--color-body);
}

.jsf-drawer__footer {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.jsf-drawer__cta {
  width: 100%;
}

/* ---------- Body scroll lock ---------- */

body.jsf-drawer-open {
  overflow: hidden;
}

/* ---------- Visibility ---------- */

.jsf-hamburger,
.jsf-drawer {
  display: none;
}

@media (max-width: 1024px) {
  .jsf-hamburger {
    display: inline-flex;
  }

  .jsf-drawer-overlay,
  .jsf-drawer {
    display: flex;
  }
}
