/* ==========================================================================
   Harmony Mobile Menu — Frosted Glass Style (WoodMart & Custom Header)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Standalone Trigger Button (Used if shortcode trigger is shown)
   -------------------------------------------------------------------------- */
.hmm-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 9999;
  color: inherit;
}

/* Three-line hamburger */
.hmm-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}
.hmm-hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Auto-hide standalone trigger if WoodMart mobile header element already exists */
body:has(.whb-main-header) .hmm-trigger-auto,
.whb-main-header ~ * .hmm-trigger-auto {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2. Navbar Elements Elevation during Menu Open State
   - Search icon, cart icon, mobile hamburger icon, and logo MUST have:
     position: relative !important;
     z-index: 999999999 !important;
   -------------------------------------------------------------------------- */
body.hmm-open .wd-header-search,
body.hmm-open .wd-header-search-mobile,
body.hmm-open .wd-header-search a,
body.hmm-open .wd-header-cart,
body.hmm-open .cart-widget-opener,
body.hmm-open .wd-header-cart a,
body.hmm-open .wd-header-mobile-nav,
body.hmm-open .wd-header-mobile-nav a,
body.hmm-open .hmm-trigger,
body.hmm-open .site-logo,
body.hmm-open .site-logo a,
body.hmm-open .site-logo img,
body.hmm-open .wd-logo,
body.hmm-open .wd-main-logo,
body.hmm-open .whb-column_mobile2,
body.hmm-open .whb-column_mobile3,
body.hmm-open .whb-column_mobile4,
[data-mobile-menu-open="true"] .wd-header-search,
[data-mobile-menu-open="true"] .wd-header-search-mobile,
[data-mobile-menu-open="true"] .wd-header-search a,
[data-mobile-menu-open="true"] .wd-header-cart,
[data-mobile-menu-open="true"] .cart-widget-opener,
[data-mobile-menu-open="true"] .wd-header-cart a,
[data-mobile-menu-open="true"] .wd-header-mobile-nav,
[data-mobile-menu-open="true"] .wd-header-mobile-nav a,
[data-mobile-menu-open="true"] .hmm-trigger,
[data-mobile-menu-open="true"] .site-logo,
[data-mobile-menu-open="true"] .site-logo a,
[data-mobile-menu-open="true"] .site-logo img,
[data-mobile-menu-open="true"] .wd-logo,
[data-mobile-menu-open="true"] .wd-main-logo,
[data-mobile-menu-open="true"] .whb-column_mobile2,
[data-mobile-menu-open="true"] .whb-column_mobile3,
[data-mobile-menu-open="true"] .whb-column_mobile4 {
  position: relative !important;
  z-index: 999999999 !important;
  pointer-events: auto !important;
}

/* Also ensure parent header containers have matching high z-index */
body.hmm-open .whb-main-header,
body.hmm-open .whb-row,
body.hmm-open .whb-general-header,
body.hmm-open .whb-flex-row,
body.hmm-open .whb-header,
body.hmm-open header.whb-header,
[data-mobile-menu-open="true"] .whb-main-header,
[data-mobile-menu-open="true"] .whb-row,
[data-mobile-menu-open="true"] .whb-general-header,
[data-mobile-menu-open="true"] .whb-flex-row,
[data-mobile-menu-open="true"] .whb-header,
[data-mobile-menu-open="true"] header.whb-header {
  position: relative !important;
  z-index: 999999999 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: none !important;
  pointer-events: auto !important;
}

/* WP Admin Bar offset compensation */
body.admin-bar.hmm-open .whb-main-header,
body.admin-bar.hmm-open .whb-header,
body.admin-bar.hmm-open header.whb-header {
  top: 32px !important;
}
@media screen and (max-width: 782px) {
  body.admin-bar.hmm-open .whb-main-header,
  body.admin-bar.hmm-open .whb-header,
  body.admin-bar.hmm-open header.whb-header {
    top: 46px !important;
  }
}

/* --------------------------------------------------------------------------
   3. Fullscreen Overlay & Frosted Glass Backdrop
   - z-index: 999999900 (right below the 999999999 navbar elements)
   -------------------------------------------------------------------------- */
.hmm-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* Dynamic padding-top calculated by JS so content starts right below the navbar (plus extra 30px lowering) */
  padding-top: calc(var(--hmm-navbar-h, 75px) + 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.hmm-overlay[hidden] {
  display: none !important;
}

/* Frosted glass backdrop layer */
.hmm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Dark rich burgundy/wine tint blending with the cherry hero section */
  background: rgba(20, 4, 8, 0.45);
  backdrop-filter: blur(25px) saturate(140%);
  -webkit-backdrop-filter: blur(25px) saturate(140%);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   4. Menu Container & "✕ Close" Button
   -------------------------------------------------------------------------- */
.hmm-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  padding: 0 16px 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Row containing "✕ Close" right-aligned above the white card */
.hmm-close-bar {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 12px;
}

.hmm-close {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent !important;
}

.hmm-close:hover {
  opacity: 0.85;
  transform: scale(1.03);
  outline: none !important;
  box-shadow: none !important;
}

.hmm-close:focus,
.hmm-close:focus-visible,
.hmm-close:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.hmm-close-icon {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.hmm-close-text {
  font-size: 16px;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   5. White Card Panel
   -------------------------------------------------------------------------- */
.hmm-panel {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 28px 36px;
  box-shadow:
    0 16px 36px -4px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.1);
  animation: hmm-panel-slide 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hmm-panel-slide {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   6. Navigation Links (Bold, Black, Clean Spacing)
   -------------------------------------------------------------------------- */
.hmm-nav {
  width: 100%;
}

.hmm-nav-list,
.hmm-nav-list li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hmm-nav-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hmm-nav-list > li > a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  color: #000000;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.25;
  letter-spacing: -0.01em;
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(139, 18, 37, 0.15);
  transition: color 0.18s ease, transform 0.18s ease;
}

.hmm-nav-list > li > a:hover,
.hmm-nav-list > li > a:focus-visible {
  color: #8b1225;
  transform: translateX(4px);
}

.hmm-nav-list > li.current-menu-item > a,
.hmm-nav-list > li.current_page_item > a {
  color: #8b1225;
}

/* Sub-menus support */
.hmm-nav-list .sub-menu {
  list-style: none;
  margin: 10px 0 0 16px;
  padding: 0 0 0 12px;
  border-left: 2px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hmm-nav-list .sub-menu a {
  font-size: 16px;
  font-weight: 600;
  color: #444444;
  text-decoration: none;
  transition: color 0.18s ease;
}
.hmm-nav-list .sub-menu a:hover {
  color: #8b1225;
}

/* --------------------------------------------------------------------------
   7. Body Scroll Lock
   -------------------------------------------------------------------------- */
body.hmm-open {
  overflow: hidden !important;
  touch-action: none;
}
