/* ==========================================================================
   HEMP FLOWER CO — MOBILE MENU
   Full-screen overlay menu rendered outside all stacking contexts.
   ========================================================================== */

/* --- Hamburger Toggle (visible on mobile only) --- */
.hfc-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 2;
}

.hfc-mobile-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--hfc-charcoal);
  border-radius: 2px;
  transition:
    transform 300ms var(--hfc-ease),
    opacity 200ms var(--hfc-ease);
}

/* Animated hamburger → X */
.hfc-mobile-toggle.is-active .hfc-mobile-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hfc-mobile-toggle.is-active .hfc-mobile-toggle__bar:nth-child(2) {
  opacity: 0;
}

.hfc-mobile-toggle.is-active .hfc-mobile-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .hfc-mobile-toggle {
    display: flex;
  }
}


/* --- Backdrop --- */
.hfc-mm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999998;
  opacity: 0;
  transition: opacity 300ms var(--hfc-ease);
  -webkit-tap-highlight-color: transparent;
}

.hfc-mm-backdrop.is-visible {
  display: block;
  opacity: 1;
}


/* --- Menu Panel --- */
.hfc-mm {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: #fff;
  z-index: 999999;
  transform: translateX(100%);
  transition: transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}

.hfc-mm.is-open {
  transform: translateX(0);
}

@media (max-width: 420px) {
  .hfc-mm {
    max-width: 100%;
  }
}


/* --- Top bar --- */
.hfc-mm__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hfc-sand);
  flex-shrink: 0;
  background: #fff;
}

.hfc-mm__title {
  font-family: var(--hfc-font-display);
  font-size: var(--hfc-text-lg);
  font-weight: 700;
  color: var(--hfc-near-black);
}

.hfc-mm__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--hfc-warm-white);
  border: 1px solid var(--hfc-sand);
  border-radius: 50%;
  cursor: pointer;
  color: var(--hfc-charcoal);
  transition: background 150ms var(--hfc-ease);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.hfc-mm__close svg,
.hfc-mm__close svg * {
  pointer-events: none;
}

.hfc-mm__close:hover,
.hfc-mm__close:active {
  background: var(--hfc-sand);
  color: var(--hfc-near-black);
}


/* --- Search --- */
.hfc-mm__search {
  padding: 16px 20px;
  border-bottom: 1px solid var(--hfc-sand);
  flex-shrink: 0;
  background: var(--hfc-warm-white);
}

.hfc-mm__search form {
  display: flex;
}

.hfc-mm__search input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--hfc-sand);
  border-radius: var(--hfc-radius-md);
  font-family: var(--hfc-font-body);
  font-size: 16px; /* Prevents iOS zoom */
  color: var(--hfc-charcoal);
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.hfc-mm__search input[type="search"]:focus {
  border-color: var(--hfc-sage-light);
  outline: none;
  box-shadow: 0 0 0 3px rgba(82, 121, 111, 0.1);
}

.hfc-mm__search input[type="search"]::placeholder {
  color: var(--hfc-stone);
}


/* --- Category Accordion --- */
.hfc-mm__nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.hfc-mm__section {
  border-bottom: 1px solid var(--hfc-sand);
}

.hfc-mm__section-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
  transition: background 150ms var(--hfc-ease);
}

.hfc-mm__section-trigger:active {
  background: var(--hfc-warm-white);
}

.hfc-mm__section-label {
  font-family: var(--hfc-font-display);
  font-size: var(--hfc-text-base);
  font-weight: 600;
  color: var(--hfc-near-black);
}

.hfc-mm__chevron {
  color: var(--hfc-stone);
  transition: transform 300ms var(--hfc-ease);
  flex-shrink: 0;
}

.hfc-mm__section.is-open .hfc-mm__chevron {
  transform: rotate(180deg);
  color: var(--hfc-forest);
}

.hfc-mm__section.is-open .hfc-mm__section-label {
  color: var(--hfc-forest);
}

/* Section body — hidden by default */
.hfc-mm__section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(0.32, 0.72, 0, 1);
  background: var(--hfc-warm-white);
}

.hfc-mm__section.is-open .hfc-mm__section-body {
  max-height: 800px;
}

/* Groups inside section */
.hfc-mm__group {
  padding: 12px 20px 12px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.hfc-mm__group:last-child {
  border-bottom: none;
  padding-bottom: 16px;
}

.hfc-mm__group-label {
  font-family: var(--hfc-font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hfc-sage);
  padding: 4px 0 8px;
}

/* Category links */
.hfc-mm__link {
  display: flex;
  align-items: center;
  padding: 10px 0;
  font-family: var(--hfc-font-body);
  font-size: var(--hfc-text-sm);
  color: var(--hfc-charcoal);
  text-decoration: none;
  min-height: 44px;
  transition: color 150ms var(--hfc-ease);
  -webkit-tap-highlight-color: transparent;
}

.hfc-mm__link:active {
  color: var(--hfc-forest);
}

.hfc-mm__link--active {
  color: var(--hfc-forest);
  font-weight: 600;
}


/* --- Quick Links --- */
.hfc-mm__quick {
  padding: 12px 20px;
  border-top: 1px solid var(--hfc-sand);
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  background: #fff;
}

.hfc-mm__quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  font-family: var(--hfc-font-display);
  font-size: var(--hfc-text-sm);
  font-weight: 500;
  color: var(--hfc-charcoal);
  text-decoration: none;
  border-bottom: 1px solid var(--hfc-sand);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.hfc-mm__quick-link:last-child {
  border-bottom: none;
}

.hfc-mm__quick-link:active {
  color: var(--hfc-forest);
}

.hfc-mm__quick-link svg {
  color: var(--hfc-sage);
  flex-shrink: 0;
}


/* --- CTA Button --- */
.hfc-mm__cta {
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  background: #fff;
}

.hfc-mm__cta-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--hfc-forest);
  color: #fff;
  border: none;
  border-radius: var(--hfc-radius-md);
  font-family: var(--hfc-font-display);
  font-size: var(--hfc-text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms var(--hfc-ease);
  -webkit-tap-highlight-color: transparent;
}

.hfc-mm__cta-btn:hover,
.hfc-mm__cta-btn:active {
  background: var(--hfc-forest-light);
  color: #fff;
}


/* --- Body lock when menu is open --- */
body.hfc-mm-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}
