/* =============================================================
   Manna Header Widget — v2.0.0
   ============================================================= */

.mhw-wrap { position: relative; }

/* ── Header ───────────────────────────────────────────────── */
.mhw-header {
  display: flex; align-items: center;
  width: 100%; height: 80px;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9999; background: #3b2035; overflow: visible;
  transition: height .3s cubic-bezier(.4,0,.2,1),
              background .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s cubic-bezier(.4,0,.2,1),
              backdrop-filter .3s cubic-bezier(.4,0,.2,1);
  animation: mhwFadeIn .6s ease both;
}
@keyframes mhwFadeIn { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.mhw-header.is-transparent { background: transparent !important; box-shadow: none !important; }
.mhw-header.is-scrolled {
  background: rgba(37,18,32,.93) !important;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0,0,0,.5); height: 64px;
}
.admin-bar .mhw-header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .mhw-header { top: 46px; } }
@media screen and (max-width: 600px) { .admin-bar .mhw-header { top: 0; } }

/* ── Header inner / content wrap ─────────────────────────── */
.mhw-header-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center;
  background: transparent; position: relative;
}
.mhw-content-wrap {
  width: 100%; max-width: 1400px; height: 100%;
  margin: 0 auto; padding: 0 40px 0 0;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}

/* ── Logo Strip ───────────────────────────────────────────── */
.mhw-logo-strip {
  display: flex; align-items: center; gap: 10px;
  height: 100%; background: #d4890a;
  padding: 0 36px 0 28px;
  flex-shrink: 0; text-decoration: none; position: relative; z-index: 2;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 50%, calc(100% - 24px) 100%, 0 100%);
  transition: padding .3s cubic-bezier(.4,0,.2,1), margin-left .3s, width .3s;
}
.mhw-logo-strip:not(.has-strip) { clip-path: none; background: transparent; padding: 0 24px; }
.mhw-header.is-scrolled .mhw-logo-strip { padding-right: 40px; }
.mhw-logo-img, .mhw-logo-svg { width: 42px; height: 42px; flex-shrink: 0; transition: transform .3s cubic-bezier(.4,0,.2,1); }
.mhw-logo-strip:hover .mhw-logo-img,
.mhw-logo-strip:hover .mhw-logo-svg { transform: scale(1.08) rotate(-3deg); }
.mhw-logo-text {
  font-family: 'Cinzel','Times New Roman',serif; font-weight: 700; font-size: 1.65rem;
  color: #fff; text-shadow: 1px 2px 0 #7a3b00; letter-spacing: .04em;
  white-space: nowrap; line-height: 1; transition: font-size .3s;
}
.mhw-header.is-scrolled .mhw-logo-text { font-size: 1.3rem; }

/* ── Desktop Nav ──────────────────────────────────────────── */
.mhw-nav-wrap { overflow: visible !important; }
.mhw-nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; overflow: visible; }
.mhw-nav > li { position: relative; overflow: visible; }
.mhw-nav > li > a, .mhw-nav > li > button {
  font-family: 'Cinzel',serif; font-size: .88rem; font-weight: 600; letter-spacing: .08em;
  color: #fff; text-decoration: none; padding: 10px 14px;
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; position: relative;
  transition: color .18s ease; white-space: nowrap;
}
.mhw-nav > li > a::after, .mhw-nav > li > button::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; right: 50%;
  height: 2px; background: #f5b830; border-radius: 2px;
  transition: left .3s cubic-bezier(.4,0,.2,1), right .3s cubic-bezier(.4,0,.2,1);
}
.mhw-nav > li:hover > a::after, .mhw-nav > li:hover > button::after,
.mhw-nav > li.current-menu-item > a::after { left: 10px; right: 10px; }
.mhw-nav > li:hover > a, .mhw-nav > li:hover > button,
.mhw-nav > li.current-menu-item > a { color: #f5b830; }
.mhw-nav .mhw-chevron { display: inline-flex; transition: transform .18s ease; flex-shrink: 0; }
.mhw-nav > li:hover .mhw-chevron { transform: rotate(180deg); }

/* ── Floating Dropdown ────────────────────────────────────── */
.mhw-dropdown {
  position: fixed; top: 0; left: 0; min-width: 210px;
  background: #2e1628; border: 1px solid #d4890a; border-radius: 8px;
  list-style: none; padding: 8px 0; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  pointer-events: none; z-index: 99999;
  box-shadow: 0 16px 48px rgba(0,0,0,.55); overflow: visible;
}
.mhw-dropdown.is-open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.mhw-dropdown li { list-style: none; }
.mhw-dropdown li a {
  display: block; padding: 9px 18px; font-size: .83rem; color: #e0d0c0;
  text-decoration: none; letter-spacing: .04em; white-space: nowrap;
  transition: background .15s, color .15s, padding-left .15s; font-family: 'Lato',sans-serif;
}
.mhw-dropdown li a:hover { background: rgba(212,137,10,.18); color: #f5b830; padding-left: 24px; }
.mhw-dropdown::before {
  content: ''; position: absolute; top: -6px; left: 20px;
  width: 10px; height: 10px; background: #2e1628;
  border-top: 1px solid #d4890a; border-left: 1px solid #d4890a;
  transform: rotate(45deg); z-index: 1;
}

/* ── Actions ──────────────────────────────────────────────── */
.mhw-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mhw-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
  color: #fff; border-radius: 50%; position: relative; text-decoration: none;
  transition: background .18s, color .18s; flex-shrink: 0;
}
.mhw-icon-btn:hover { background: rgba(255,255,255,.1); color: #f5b830; }
.mhw-icon-btn svg { display: block; }

.mhw-badge {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px;
  background: #e53935; color: #fff; border-radius: 10px;
  font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 3px; font-family: 'Lato',sans-serif; border: 2px solid #3b2035; pointer-events: none;
}
.mhw-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.15); display: flex; align-items: center;
  justify-content: center; overflow: hidden;
}
.mhw-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Flyout Wrapper ───────────────────────────────────────── */
.mhw-flyout-wrap {
  position: relative;
  /* Extend clickable/hover zone downward to bridge the gap to the panel */
  padding-bottom: 12px;
  margin-bottom: -12px;
}

/* ── Flyout Panel ─────────────────────────────────────────── */
.mhw-flyout {
  position: absolute; top: calc(100% + 4px); right: 0;
  width: 300px; background: #2a1424;
  border: 1px solid #d4890a; border-radius: 12px;
  padding: 16px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 99998;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  color: #e8d8c8;
}
.mhw-flyout::before {
  content: ''; position: absolute; top: -6px; right: 16px;
  width: 10px; height: 10px; background: #2a1424;
  border-top: 1px solid #d4890a; border-left: 1px solid #d4890a;
  transform: rotate(45deg);
}
/* Invisible bridge fills the gap between the icon and panel top edge,
   so moving the mouse from icon downward never exits the hover zone */
.mhw-flyout::after {
  content: ''; position: absolute;
  top: -12px; left: 0; right: 0; height: 12px;
  background: transparent;
}
.mhw-flyout-wrap:hover .mhw-flyout,
.mhw-flyout.is-open {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
/* Keep the panel open while hovering inside it */
.mhw-flyout:hover { opacity: 1; visibility: visible; pointer-events: auto; }

/* ── Empty state ──────────────────────────────────────────── */
.mhw-flyout-empty {
  text-align: center; padding: 18px 0 12px;
  font-size: .85rem; color: rgba(232,216,200,.55);
  font-family: 'Lato',sans-serif; margin: 0;
}

/* ── Flyout Action Buttons ────────────────────────────────── */
.mhw-flyout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px; border-radius: 8px;
  background: #d4890a; color: #fff; text-decoration: none;
  font-size: .82rem; font-family: 'Lato',sans-serif; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  border: none; cursor: pointer;
  transition: background .18s, transform .15s;
  margin-top: 10px;
}
.mhw-flyout-btn:first-child { margin-top: 0; }
.mhw-flyout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.mhw-flyout-btn:hover { background: #e59c1e; transform: translateY(-1px); }

.mhw-flyout-btn-outline {
  background: transparent;
  border: 1px solid rgba(212,137,10,.5);
  color: #e8d8c8;
}
.mhw-flyout-btn-outline:hover { background: rgba(212,137,10,.15); border-color: #d4890a; color: #fff; transform: translateY(-1px); }

/* ── Cart Flyout Items ────────────────────────────────────── */
.mhw-cart-items {
  list-style: none; margin: 0 0 12px; padding: 0;
  max-height: 260px; overflow-y: auto;
}
.mhw-cart-items::-webkit-scrollbar { width: 4px; }
.mhw-cart-items::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
.mhw-cart-items::-webkit-scrollbar-thumb { background: rgba(212,137,10,.4); border-radius: 2px; }

.mhw-cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(212,137,10,.12);
}
.mhw-cart-item:last-child { border-bottom: none; }

.mhw-cart-item-thumb {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.06); display: block;
}
.mhw-cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mhw-cart-item-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.mhw-cart-item-name {
  font-size: .8rem; font-family: 'Lato',sans-serif; font-weight: 600;
  color: #e8d8c8; text-decoration: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: color .15s;
}
.mhw-cart-item-name:hover { color: #d4890a; }
.mhw-cart-item-price { font-size: .75rem; color: #d4890a; font-family: 'Lato',sans-serif; font-weight: 700; }

.mhw-cart-item-qty {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.mhw-qty-btn {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(212,137,10,.18); border: 1px solid rgba(212,137,10,.35);
  color: #d4890a; font-size: .9rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  padding: 0;
}
.mhw-qty-btn:hover { background: #d4890a; color: #fff; }
.mhw-qty-val {
  min-width: 22px; text-align: center;
  font-size: .8rem; font-weight: 700; font-family: 'Lato',sans-serif;
  color: #e8d8c8;
}

/* ── Account Flyout Menu Items ────────────────────────────── */
.mhw-account-flyout {
  padding: 10px;
  /* Items must stack vertically */
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mhw-account-menu-item {
  display: flex; align-items: center;
  width: 100%; padding: 9px 14px;
  border-radius: 7px; text-decoration: none;
  font-size: .84rem; font-family: 'Lato',sans-serif; font-weight: 600;
  letter-spacing: .03em;
  /* Do NOT set white-space: nowrap here — let items wrap if needed */
  transition: background .17s, color .17s, border-color .17s, transform .14s;
  box-sizing: border-box;
}

/* Solid (filled) */
.mhw-acct-style-solid {
  background: #d4890a; color: #fff; border: 1px solid #d4890a;
}
.mhw-acct-style-solid:hover { background: #e59c1e; border-color: #e59c1e; transform: translateY(-1px); }

/* Outline */
.mhw-acct-style-outline {
  background: transparent; color: #e8d8c8;
  border: 1px solid rgba(212,137,10,.45);
}
.mhw-acct-style-outline:hover { background: rgba(212,137,10,.15); border-color: #d4890a; color: #fff; transform: translateY(-1px); }

/* Plain link */
.mhw-acct-style-link {
  background: transparent; color: #e8d8c8; border: 1px solid transparent;
}
.mhw-acct-style-link:hover { background: rgba(255,255,255,.06); color: #d4890a; padding-left: 20px; }

/* ── Search ───────────────────────────────────────────────── */
.mhw-search-wrap { position: static; }
.mhw-search-toggle svg { width: 22px; height: 22px; }
.mhw-search-box {
  position: fixed; top: 84px; right: 20px; width: 300px;
  background: #2a1424; border: 1px solid rgba(212,137,10,.55); border-radius: 12px;
  display: flex; align-items: center; padding: 0 14px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,.6); z-index: 10002; pointer-events: none;
}
.mhw-search-box.is-open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.mhw-search-box input { flex: 1; background: none; border: none; outline: none; font-size: .9rem; color: #fff; padding: 12px 8px; font-family: 'Lato',sans-serif; }
.mhw-search-box input::placeholder { color: rgba(255,255,255,.4); }
.mhw-search-box button { background: none; border: none; cursor: pointer; color: #d4890a; display: flex; align-items: center; padding: 4px; }

/* ── Hamburger ────────────────────────────────────────────── */
.mhw-hamburger {
  display: none !important; flex-direction: column !important; gap: 5px;
  padding: 6px !important; border-radius: 6px !important;
  width: 40px !important; height: 40px !important;
}
.mhw-hamburger .mhw-bar {
  display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .18s, width .3s; transform-origin: center;
}
.mhw-hamburger.is-open .mhw-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mhw-hamburger.is-open .mhw-bar:nth-child(2) { opacity: 0; width: 0; }
.mhw-hamburger.is-open .mhw-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 960px) { .mhw-hamburger { display: inline-flex !important; visibility: visible !important; } }

/* ── Overlay ──────────────────────────────────────────────── */
.mhw-overlay {
  display: none; position: fixed; top: 80px; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.65); z-index: 9997; opacity: 0;
  transition: opacity .3s cubic-bezier(.4,0,.2,1);
}
.mhw-overlay.is-open { display: block; opacity: 1; }

/* ── Mobile Drawer ────────────────────────────────────────── */
.mhw-drawer {
  position: fixed; top: 80px; left: 0;
  width: 85vw; max-width: 320px; height: calc(100dvh - 80px);
  background: #2a1424; z-index: 9998;
  transform: translateX(-100%);
  transition: transform .38s cubic-bezier(.4,0,.2,1), opacity .38s, visibility .38s;
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden;
  box-shadow: 4px 0 40px rgba(0,0,0,.55);
  --mhw-drawer-item-color: #e8d8c8;
  --mhw-drawer-accent: #d4890a;
}
.mhw-drawer.from-right  { left: auto; right: 0; transform: translateX(100%); }
.mhw-drawer.full-height { top: 0 !important; height: 100dvh !important; }
.mhw-drawer.is-open     { transform: translateX(0) !important; opacity: 1 !important; visibility: visible !important; }

.mhw-drawer-search {
  padding: 14px 16px; border-bottom: 1px solid rgba(212,137,10,.15); flex-shrink: 0;
}
.mhw-drawer-search input {
  width: 100%; background: rgba(255,255,255,.06); border: 1px solid rgba(212,137,10,.4);
  border-radius: 20px; padding: 9px 16px; color: #fff; font-size: .85rem;
  outline: none; font-family: 'Lato',sans-serif; box-sizing: border-box;
}
.mhw-drawer-search input::placeholder { color: rgba(255,255,255,.4); }

.mhw-drawer-nav { flex: 1; list-style: none; margin: 0; padding: 6px 0; }
.mhw-drawer-nav > li { list-style: none; border-bottom: 1px solid rgba(212,137,10,.1); }
.mhw-drawer-nav > li:last-child { border-bottom: none; }
.mhw-drawer-nav > li > a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; color: var(--mhw-drawer-item-color, #e8d8c8);
  font-family: 'Cinzel',serif; font-size: .85rem; font-weight: 600; letter-spacing: .07em;
  text-decoration: none; line-height: 1.3; width: 100%;
  transition: background .18s, color .18s, padding-left .18s;
}
.mhw-drawer-nav > li > a:hover,
.mhw-drawer-nav > li.current-menu-item > a { background: rgba(212,137,10,.1); color: var(--mhw-drawer-accent, #d4890a); padding-left: 26px; }
.mhw-drawer-sub-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; color: var(--mhw-drawer-item-color, #e8d8c8);
  font-family: 'Cinzel',serif; font-size: .85rem; font-weight: 600; letter-spacing: .07em;
  background: none; border: none; cursor: pointer; width: 100%; text-align: left; line-height: 1.3;
  transition: background .18s, color .18s, padding-left .18s;
}
.mhw-drawer-sub-toggle:hover { background: rgba(212,137,10,.1); color: var(--mhw-drawer-accent, #d4890a); padding-left: 26px; }
.mhw-drawer-sub-toggle .mhw-chevron { flex-shrink: 0; color: rgba(212,137,10,.7); transition: transform .25s; }
.mhw-drawer-sub-toggle.is-open .mhw-chevron { transform: rotate(180deg); color: var(--mhw-drawer-accent, #d4890a); }
.mhw-drawer-nav .sub-menu { list-style: none; margin: 0; padding: 0; background: rgba(0,0,0,.18); border-top: 1px solid rgba(212,137,10,.08); max-height: 0; overflow: hidden; transition: max-height .32s cubic-bezier(.4,0,.2,1); }
.mhw-drawer-nav .sub-menu.is-open { max-height: 600px; }
.mhw-drawer-nav .sub-menu > li { list-style: none; border-bottom: 1px solid rgba(255,255,255,.04); }
.mhw-drawer-nav .sub-menu > li:last-child { border-bottom: none; }
.mhw-drawer-nav .sub-menu > li > a { display: flex; align-items: center; gap: 8px; padding: 10px 20px 10px 32px; font-size: .8rem; color: #b8a898; text-decoration: none; font-family: 'Lato',sans-serif; letter-spacing: .03em; transition: color .15s, padding-left .15s, background .15s; }
.mhw-drawer-nav .sub-menu > li > a::before { content: ''; display: inline-block; width: 4px; height: 4px; background: rgba(212,137,10,.5); border-radius: 50%; flex-shrink: 0; }
.mhw-drawer-nav .sub-menu > li > a:hover { color: var(--mhw-drawer-accent, #d4890a); padding-left: 36px; background: rgba(212,137,10,.06); }
.mhw-drawer-nav .sub-menu > li > a:hover::before { background: var(--mhw-drawer-accent, #d4890a); }

.mhw-drawer-footer { padding: 16px; border-top: 1px solid rgba(212,137,10,.2); background: rgba(0,0,0,.2); display: flex; gap: 10px; flex-shrink: 0; }
.mhw-drawer-footer-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; border-radius: 8px;
  background: rgba(212,137,10,.14); border: 1px solid rgba(212,137,10,.35);
  color: var(--mhw-drawer-item-color, #e8d8c8); text-decoration: none; cursor: pointer;
  font-size: .78rem; font-family: 'Lato',sans-serif; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, transform .15s;
}
.mhw-drawer-footer-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.mhw-drawer-footer-btn:hover { background: rgba(212,137,10,.3); border-color: rgba(212,137,10,.65); color: #fff; transform: translateY(-1px); }

/* ── Visibility helpers ───────────────────────────────────── */
.mhw-mobile-only  { display: none !important; }
.mhw-desktop-only { display: inline-flex !important; }
/* Flyout wraps are block-level; keep them flex for alignment */
.mhw-flyout-wrap { display: flex !important; align-items: center; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .mhw-nav-wrap     { display: none !important; }
  .mhw-mobile-only  { display: inline-flex !important; }
  .mhw-desktop-only { display: none !important; }
  /* Flyout wraps default to desktop-only; show-mobile overrides this */
  .mhw-flyout-wrap  { display: none !important; }
  .mhw-flyout-wrap.mhw-show-mobile { display: flex !important; }
  /* Disable hover flyouts on touch */
  .mhw-flyout-wrap:hover .mhw-flyout { opacity: 0; visibility: hidden; pointer-events: none; }

  .mhw-content-wrap { padding: 0 12px 0 0; margin: 0; max-width: 100%; }
  .mhw-logo-strip   { padding-left: 16px; padding-right: 36px; }
  .mhw-actions      { margin-left: auto; }
}
@media (max-width: 480px) {
  .mhw-logo-text             { font-size: 1.1rem; }
  .mhw-logo-img, .mhw-logo-svg { width: 34px; height: 34px; }
}

/* ── WP nav resets ────────────────────────────────────────── */
.mhw-nav-wrap .mhw-nav { display: flex; }
.mhw-nav .menu-item-has-children { position: relative; }
.mhw-nav .sub-menu { display: none !important; }

/* ── Theme isolation ──────────────────────────────────────── */
.mhw-header-inner, .mhw-content-wrap { background-color: transparent !important; }

/* ── Loading state (AJAX) ─────────────────────────────────── */
.mhw-cart-item.is-updating { opacity: .5; pointer-events: none; }
.mhw-wishlist-item.is-saving { opacity: .5; pointer-events: none; }
