/* mesh — file-based site header. Brutalist: cream bar, black uppercase nav,
   purple dropdown panels + accents, purple Súmate CTA. Scoped under #mesh-hd.
   Note the !important resets: the active theme styles generic <button>s (purple
   fill), which would otherwise bleed into our nav toggles / burger. */
#mesh-hd, #mesh-hd * { box-sizing: border-box; }
#mesh-hd {
  --bk:#0a0a0a; --wh:#f5f2eb; --pu:#6041d5; --pu-lt:#b79cff; --yl:#ffe135;
  --fh:'Barlow Condensed',sans-serif; --fb:'Space Grotesk',sans-serif;
  position: sticky; top: 0; z-index: 9000;
  background: var(--wh);
  border-bottom: 2px solid var(--bk);
  font-family: var(--fb);
  /* Full-bleed: span the viewport even when rendered inside a constrained
     container (Elementor header section / page content). */
  width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw);
}
body.admin-bar #mesh-hd { top: 32px; }
@media (max-width: 782px) { body.admin-bar #mesh-hd { top: 46px; } }

.mesh-hd-inner {
  display: flex; align-items: center; gap: 16px;
  width: 100%; max-width: none; margin: 0;
  padding: 0 clamp(16px, 3vw, 44px); height: 70px;
}
/* Every direct text element renders its glyphs from a tight, centered box so
   logo / nav / account share the same optical line (no per-element padding
   pushing them off). */
.mesh-hd-logo, .mesh-hd-nav, .mesh-hd-actions { align-self: center; }
.mesh-hd-link, .mesh-hd-logo-txt, #mesh-hd .mesh-acct-trigger { line-height: 1 !important; }

/* Logo — line-height:1 + flex centering so it sits on the same optical line as
   the nav. Sized to balance the (larger) nav type. */
.mesh-hd-logo { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; margin-right: 8px; }
.mesh-hd-logo-txt { font-family: var(--fh); font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -.02em; color: var(--bk); text-transform: lowercase; display: block; transform: translateY(-10%); }
.mesh-hd-logo-img { max-height: 40px; width: auto; display: block; }

/* Account control ([mesh_account]) — match the nav's uppercase Barlow so
   "Acceso" / the user's name align with the rest of the bar. */
#mesh-hd .mesh-acct-trigger { font-family: var(--fh) !important; font-weight: 800 !important; font-size: 23px !important; letter-spacing: .03em !important; text-transform: uppercase !important; color: var(--bk) !important; }
#mesh-hd .mesh-acct-caret { font-size: 13px !important; }

/* Primary nav — sits left after the logo; margin-right:auto pushes search +
   actions to the right edge so the bar reads cleanly at full width. */
.mesh-hd-nav { display: flex; align-items: center; gap: 2px; flex-shrink: 0; margin-right: auto; }
.mesh-hd-item { position: relative; }
.mesh-hd-link {
  -webkit-appearance: none !important; appearance: none !important;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fh) !important; font-weight: 800 !important; font-size: 23px !important;
  letter-spacing: .03em !important; text-transform: uppercase !important; color: var(--bk) !important;
  background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  cursor: pointer; padding: 10px 13px !important; text-decoration: none !important; white-space: nowrap;
  line-height: 1 !important; transition: color .12s;
}
.mesh-hd-link:hover { color: var(--pu) !important; }
.mesh-hd-link.is-active { color: var(--pu) !important; box-shadow: inset 0 -3px 0 var(--pu) !important; }
.mesh-hd-caret { font-size: 15px; transition: transform .15s; }
.mesh-hd-item.is-open .mesh-hd-caret { transform: rotate(180deg); }

/* Dropdown — purple panel, black bold items (the look you liked) */
.mesh-hd-sub {
  position: absolute; top: calc(100% + 1px); left: 0; z-index: 20;
  display: none; flex-direction: column; min-width: 230px;
  background: var(--pu-lt); border: 2px solid var(--bk); box-shadow: 5px 5px 0 var(--bk);
  padding: 6px;
}
.mesh-hd-item.is-open > .mesh-hd-sub { display: flex; animation: meshHdPop .14s ease; }
@keyframes meshHdPop { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform: translateY(0); } }
.mesh-hd-sublink {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--fh) !important; font-size: 22px !important; font-weight: 700 !important;
  letter-spacing: .02em !important; text-transform: uppercase !important; color: var(--bk);
  text-decoration: none !important; padding: 11px 13px; transition: background .12s, color .12s;
}
.mesh-hd-sublink:hover { background: var(--bk); color: var(--wh); }
.mesh-hd-sublink.is-active { background: rgba(10,10,10,.14); }
.mesh-hd-soon { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: var(--yl); color: var(--bk); padding: 2px 5px; }

/* Hover-to-open ONLY on real hover devices — prevents sticky-hover keeping the
   dropdown open on touch (which made it impossible to re-close on mobile). */
@media (hover: hover) and (pointer: fine) {
  .mesh-hd-item:hover > .mesh-hd-link { color: var(--pu) !important; }
  .mesh-hd-item:hover > .mesh-hd-sub { display: flex; animation: meshHdPop .14s ease; }
  .mesh-hd-item:hover .mesh-hd-caret { transform: rotate(180deg); }
}

/* Search slot — Jet AJAX search brings its own styles; we size + cap it, lower
   it slightly for optical balance, and re-apply the brutalist field styling the
   old Elementor widget had (the block renders a plain box). */
.mesh-hd-search { flex: 0 1 300px; min-width: 0; transform: translateY(5%); }
.mesh-hd-search .jet-ajax-search,
.mesh-hd-search .jet-ajax-search__field { width: 100% !important; }
.mesh-hd-search .jet-ajax-search__field {
  border: 2px solid var(--bk) !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 var(--bk) !important;
  background: #fff !important;
  color: var(--bk) !important;
  font-family: var(--fb) !important;
  font-size: 15px !important;
  padding: 12px 40px 12px 14px !important;
  height: auto !important;
}
.mesh-hd-search .jet-ajax-search__field::placeholder { color: #8a8a8a !important; }
.mesh-hd-search .jet-ajax-search__field:focus { box-shadow: 4px 4px 0 var(--pu) !important; border-color: var(--pu) !important; }
.mesh-hd-search .jet-ajax-search__submit,
.mesh-hd-search .jet-ajax-search__field-icon { color: var(--bk) !important; }

/* Actions */
.mesh-hd-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mesh-hd-sumate {
  -webkit-appearance: none !important; appearance: none !important;
  display: inline-flex; align-items: center;
  font-family: var(--fh) !important; font-weight: 900 !important; font-size: 20px !important; letter-spacing: .05em !important;
  text-transform: uppercase !important; color: #fff !important; text-decoration: none !important;
  background: var(--pu) !important; border: 2px solid var(--bk) !important; border-radius: 0 !important; box-shadow: 3px 3px 0 var(--bk) !important;
  padding: 11px 20px !important; line-height: 1 !important; transition: transform .1s, box-shadow .1s, background .12s;
}
.mesh-hd-sumate:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--bk) !important; background: #6d31e0 !important; color: #fff !important; }
.mesh-hd-sumate:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--bk) !important; }

/* Burger (mobile only) */
.mesh-hd-burger { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent !important; border: 2px solid var(--bk) !important; border-radius: 0 !important; box-shadow: none !important; color: var(--bk) !important; cursor: pointer; flex-shrink: 0; padding: 0 !important; }
.mesh-hd-burger i { font-size: 24px; }

/* Off-canvas drawer */
.mesh-hd-overlay { position: fixed; inset: 0; z-index: 9100; background: rgba(10,10,10,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.mesh-hd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 9200;
  width: min(360px, 90vw);
  /* Full-purple mobile menu (matches the brand's mobile nav) with black text. */
  background: #9b7bf0; border-left: 2px solid var(--bk);
  display: flex; flex-direction: column; gap: 4px; padding: 16px;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.mesh-hd-drawer.is-open { transform: translateX(0); }
.mesh-hd-drawer-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid var(--bk); margin-bottom: 6px; }
.mesh-hd-close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: transparent !important; border: 2px solid var(--bk) !important; border-radius: 0 !important; box-shadow: none !important; color: var(--bk) !important; cursor: pointer; padding: 0 !important; }
.mesh-hd-close i { font-size: 22px; }
.mesh-hd-drawer-search { margin-bottom: 14px; }
/* Match the desktop field's brutalist look, tuned for touch + the purple bg. */
.mesh-hd-drawer-search .jet-ajax-search,
.mesh-hd-drawer-search .jet-ajax-search__field { width: 100% !important; }
.mesh-hd-drawer-search .jet-ajax-search__field {
  border: 2px solid var(--bk) !important; border-radius: 0 !important;
  box-shadow: 3px 3px 0 var(--bk) !important;
  background: #fff !important; color: var(--bk) !important;
  font-family: var(--fb) !important; font-size: 16px !important;
  padding: 14px 42px 14px 14px !important; height: auto !important;
}
.mesh-hd-drawer-search .jet-ajax-search__field::placeholder { color: #8a8a8a !important; }
.mesh-hd-drawer-search .jet-ajax-search__field:focus { border-color: var(--pu) !important; }
.mesh-hd-drawer-search .jet-ajax-search__submit,
.mesh-hd-drawer-search .jet-ajax-search__field-icon { color: var(--bk) !important; }
/* Logged-in users get a one-tap, prominent portal entry near the top of the
   drawer (the account dropdown buried it). */
.mesh-hd-drawer-portal { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 13px 14px; background: var(--pu); color: #fff !important; font-family: var(--fh); font-weight: 800; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; text-decoration: none; border: 2px solid var(--bk); box-shadow: 3px 3px 0 var(--bk); }
.mesh-hd-drawer-portal i { font-size: 20px; }
.mesh-hd-drawer-portal:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--bk); }
.mesh-hd-drawer-nav { display: flex; flex-direction: column; }
.mesh-hd-drawer-nav .mesh-hd-item { width: 100%; border-bottom: 1px solid rgba(10,10,10,.18); }
.mesh-hd-drawer-nav .mesh-hd-link { padding: 14px 4px !important; font-size: 22px !important; justify-content: space-between; width: 100%; }
/* Kill the theme's <button> purple fill inside the drawer (it's more insistent
   here than in the top bar). Keep toggles as plain text rows in every state. */
.mesh-hd-drawer .mesh-hd-link,
.mesh-hd-drawer .mesh-hd-toggle,
.mesh-hd-drawer .mesh-hd-link:hover,
.mesh-hd-drawer .mesh-hd-link:focus,
.mesh-hd-drawer .mesh-hd-link:active,
.mesh-hd-drawer .mesh-hd-item.is-open > .mesh-hd-link {
  background: transparent !important; background-image: none !important;
  color: var(--bk) !important; box-shadow: none !important; border: 0 !important;
}
.mesh-hd-drawer-nav .mesh-hd-sub { position: static; display: none; background: transparent; box-shadow: none; border: 0; border-left: 3px solid rgba(10,10,10,.45); margin: 0 0 10px 10px; padding: 0; min-width: 0; animation: none; }
.mesh-hd-drawer-nav .mesh-hd-item.is-open > .mesh-hd-sub { display: flex; }
.mesh-hd-drawer-nav .mesh-hd-sublink { padding: 11px 12px; }
.mesh-hd-drawer-nav .mesh-hd-sublink:hover { background: var(--bk); color: var(--wh); }
.mesh-hd-drawer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--bk); }
.mesh-hd-drawer-actions .mesh-hd-sumate { justify-content: center; }

/* Responsive: collapse the desktop row into the drawer before it can overflow */
@media (max-width: 1100px) {
  .mesh-hd-nav, .mesh-hd-search, .mesh-hd-actions { display: none; }
  .mesh-hd-burger { display: inline-flex; }
  .mesh-hd-inner { gap: 12px; height: 60px; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .mesh-hd-item.is-open > .mesh-hd-sub { animation: none; }
  .mesh-hd-drawer { transition: none; }
  .mesh-hd-sumate { transition: background .12s; }
  .mesh-hd-sumate:hover, .mesh-hd-sumate:active { transform: none; }
}

/* ── Flush placement inside an Elementor header ──────────────────────────────
   When [mesh_header] is dropped into an Elementor header template, the wrapping
   Elementor container (e-con-boxed) keeps its own padding / min-height /
   background, which frames our full-bleed bar with a black strip above and a
   gap below. Collapse ONLY the wrappers that contain our bar so it sits flush.
   (:has scopes these rules strictly to the header's own ancestor chain.) */
.elementor-widget:has(#mesh-hd),
.elementor-widget-container:has(> .elementor-shortcode > #mesh-hd),
.elementor-shortcode:has(> #mesh-hd) {
  margin: 0 !important; padding: 0 !important;
}
.e-con:has(#mesh-hd),
.e-con:has(#mesh-hd) > .e-con-inner {
  padding-top: 0 !important; padding-bottom: 0 !important;
  min-height: 0 !important;
  background-color: transparent !important; background-image: none !important;
}
