/* Header — Compumundo Store · Vengala Studio */

.cmh, .cmh-drawer {
  --cm-ink: #0b0f19;
  --cm-ink-2: #3b4250;
  --cm-muted: #6b7280;
  --cm-faint: #9aa1ad;
  --cm-line: #eceef2;
  --cm-soft: #f4f5f7;
  --cm-soft-2: #eceef1;
  --cm-accent: #1565c0;
  --cm-wa: #25d366;
  --cm-ease: cubic-bezier(.2, .8, .2, 1);
  font-family: Montserrat, system-ui, -apple-system, sans-serif;
  color: var(--cm-ink);
  -webkit-font-smoothing: antialiased;
}
.cmh *, .cmh *::before, .cmh *::after, .cmh-drawer *, .cmh-drawer *::before, .cmh-drawer *::after { box-sizing: border-box; }
.cmh a, .cmh button, .cmh-drawer a, .cmh-drawer button { font-family: inherit; text-transform: none !important; letter-spacing: normal; text-decoration: none !important; }
.cmh button, .cmh-drawer button { cursor: pointer; }
.cmh svg, .cmh-drawer svg { display: block; flex: none; }
.cmh ul, .cmh-drawer ul { list-style: none; margin: 0; padding: 0; }
.cmh h3 { margin: 0; }

.cmh-wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* El tema pone overflow en <body>, lo que anula position: sticky. El header va fijo y
   .cmh-spacer reserva su alto para que el contenido no quede debajo. */
.cmh {
  --cmh-top-h: 36px;
  position: fixed; top: var(--wp-admin--admin-bar--height, 0px); left: 0; right: 0; z-index: 9990;
  transition: transform .28s var(--cm-ease);
}
.cmh.is-scrolled { transform: translateY(calc(-1 * var(--cmh-top-h))); }
.cmh-spacer { height: var(--cmh-h, 172px); }

/* ---------------------------------------------------------------- */
/* Barra superior                                                    */
/* ---------------------------------------------------------------- */
.cmh-top { background: var(--cm-ink); color: rgba(255, 255, 255, .78); font: 600 12px/1 Montserrat, sans-serif; }
.cmh-top .cmh-wrap { display: flex; align-items: center; gap: 22px; height: 36px; }
.cmh-top-item { display: inline-flex; align-items: center; gap: 7px; color: inherit !important; white-space: nowrap; }
.cmh-top-item svg { width: 14px; height: 14px; opacity: .85; }
.cmh-top-sp { flex: 1; }
.cmh-top-wa { color: #fff !important; font-weight: 700; }
.cmh-top-wa svg { color: var(--cm-wa); opacity: 1; width: 15px; height: 15px; }
.cmh-top-wa:hover { text-decoration: underline !important; }
.cmh-top-social { display: grid; place-items: center; width: 26px; height: 26px; margin-left: -12px; border-radius: 50%; color: rgba(255, 255, 255, .78) !important; }
.cmh-top-social:hover { color: #fff !important; background: rgba(255, 255, 255, .1); }
.cmh-top-social svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- */
/* Barra principal (fija al hacer scroll)                            */
/* ---------------------------------------------------------------- */
.cmh-bar { background: #fff; transition: box-shadow .25s var(--cm-ease); }
.cmh.is-scrolled .cmh-bar { box-shadow: 0 6px 24px rgba(11, 15, 25, .08); }

.cmh-main .cmh-wrap {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo search actions";
  align-items: center; gap: 40px; height: 80px;
}
/* El botón del menú solo existe en celular: en escritorio no debe ocupar lugar en la grilla. */
.cmh-main .cmh-burger { grid-area: burger; display: none; }
.cmh-logo { grid-area: logo; display: flex; align-items: center; }
.cmh-logo img { display: block; height: 42px; width: auto; max-width: 190px; object-fit: contain; }
.cmh-logo b { font: 800 20px Montserrat, sans-serif; color: var(--cm-ink); }

.cmh-icon {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px;
  background: transparent; color: var(--cm-ink); transition: background .15s var(--cm-ease);
}
.cmh-icon:hover { background: var(--cm-soft); }
.cmh-icon svg { width: 24px; height: 24px; }

.cmh-search {
  grid-area: search; justify-self: stretch; width: 100%; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; height: 52px !important; min-height: 52px; padding: 0 8px 0 18px !important; line-height: 1 !important;
  background: var(--cm-soft); border: 1.5px solid transparent; border-radius: 16px; color: var(--cm-muted);
  font: 500 15px/1 Montserrat, sans-serif; text-align: left;
  transition: background .2s var(--cm-ease), border-color .2s var(--cm-ease), box-shadow .2s var(--cm-ease);
}
.cmh-search:hover { background: #fff; border-color: #d9dde3; box-shadow: 0 8px 24px rgba(11, 15, 25, .07); }
.cmh-search:focus-visible { outline: none; border-color: var(--cm-ink); background: #fff; }
.cmh-search svg { width: 21px; height: 21px; color: var(--cm-ink); }
.cmh-search-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmh-search-kbd {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #fff;
  border: 1px solid #e1e4e8; border-bottom-width: 2px; color: var(--cm-faint); font: 700 13px/1 Montserrat, sans-serif;
}

.cmh-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }
.cmh-act {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px 0 5px; border-radius: 16px;
  color: var(--cm-ink) !important; transition: background .15s var(--cm-ease);
}
.cmh-act:hover { background: var(--cm-soft); }
.cmh-act-ico { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--cm-soft); }
.cmh-act:hover .cmh-act-ico { background: #fff; }
.cmh-act-ico svg { width: 21px; height: 21px; }
.cmh-act-wa .cmh-act-ico { background: #e8f9ef; color: #16a34a; }
.cmh-act-cart .cmh-act-ico { background: var(--cm-ink); color: #fff; }
.cmh-act-cart:hover .cmh-act-ico { background: #1d2433; }
.cmh-act-txt { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.cmh-act-txt small { font: 600 11.5px/1 Montserrat, sans-serif; color: var(--cm-muted); }
.cmh-act-txt b { font: 800 14.5px/1 Montserrat, sans-serif; color: var(--cm-ink); font-variant-numeric: tabular-nums; }
.cmh-cart-n {
  position: absolute; top: -3px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; background: #e11d48; color: #fff; border: 2px solid #fff;
  font: 800 11px/1 Montserrat, sans-serif; font-variant-numeric: tabular-nums;
  transition: transform .25s var(--cm-ease);
}
.cmh-cart-n.is-empty { transform: scale(0); }
.cmh-cart-n.is-bump { animation: cmhBump .45s var(--cm-ease); }
@keyframes cmhBump { 40% { transform: scale(1.35); } }

/* ---------------------------------------------------------------- */
/* Categorías                                                        */
/* ---------------------------------------------------------------- */
.cmh-nav { position: relative; border-top: 1px solid var(--cm-line); border-bottom: 1px solid var(--cm-line); background: #fff; }
.cmh-nav > .cmh-wrap { display: flex; align-items: center; gap: 6px; height: 50px; transition: height .25s var(--cm-ease), opacity .2s var(--cm-ease); }
.cmh-cats-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 11px; margin-right: 8px;
  border: 0; border-radius: 10px; background: var(--cm-ink); color: #fff; font: 700 13px/1 Montserrat, sans-serif;
  transition: background .15s var(--cm-ease);
}
.cmh-cats-btn:hover, .cmh-cats-btn[aria-expanded="true"] { background: #1d2433; }
.cmh-cats-btn svg { width: 17px; height: 17px; }
.cmh-links { display: flex; align-items: center; gap: 0; min-width: 0; flex: 1; }
.cmh-link { position: relative; flex: none; }
.cmh-link[hidden] { display: none; }
.cmh-link-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 11px; border: 0; border-radius: 10px;
  background: transparent; color: var(--cm-ink-2); font: 600 13.5px/1 Montserrat, sans-serif; white-space: nowrap;
  transition: background .15s var(--cm-ease), color .15s var(--cm-ease);
}
.cmh-link-btn svg { width: 14px; height: 14px; color: var(--cm-faint); transition: transform .2s var(--cm-ease); }
.cmh-link-btn:hover, .cmh-link-btn[aria-expanded="true"] { background: var(--cm-soft); color: var(--cm-ink); }
.cmh-link-btn[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--cm-ink); }
.cmh-dd {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 3; width: max-content; min-width: 240px; max-width: 340px; max-height: 70vh; overflow-y: auto;
  padding: 8px; background: #fff; border: 1px solid var(--cm-line); border-radius: 14px; box-shadow: 0 18px 40px rgba(11, 15, 25, .12);
}
.cmh-dd[hidden] { display: none; }
.cmh-dd a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 12px; border-radius: 10px;
  color: var(--cm-ink-2) !important; font: 500 13.5px/1.3 Montserrat, sans-serif;
  transition: background .12s var(--cm-ease), color .12s var(--cm-ease);
}
.cmh-dd a span { min-width: 0; }
.cmh-dd a:hover { background: var(--cm-soft); color: var(--cm-ink) !important; }
.cmh-dd small, .cmh-acc-list small {
  flex: none; display: inline-block; width: auto; position: static;
  font: 700 11.5px/1 Montserrat, sans-serif; color: var(--cm-faint); font-variant-numeric: tabular-nums;
}

.cmh-mega {
  position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--cm-line);
  box-shadow: 0 24px 48px rgba(11, 15, 25, .12); max-height: calc(100vh - 180px); overflow-y: auto;
  opacity: 0; transform: translateY(-6px); transition: opacity .18s var(--cm-ease), transform .2s var(--cm-ease);
}
.cmh-mega[hidden] { display: none; }
.cmh-mega-in { display: grid; grid-template-columns: 290px minmax(0, 1fr); padding-top: 0; padding-bottom: 0; min-height: 380px; }

/* Izquierda: grupos */
.cmh-mega-nav { padding: 16px 16px 16px 0; border-right: 1px solid var(--cm-line); max-height: calc(100vh - 200px); overflow-y: auto; }
.cmh-mega-tab {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  height: 42px; padding: 0 12px 0 16px; border: 0; border-radius: 10px; background: transparent;
  color: var(--cm-ink-2); font: 600 14px/1 Montserrat, sans-serif; text-align: left;
  transition: background .12s var(--cm-ease), color .12s var(--cm-ease);
}
.cmh-mega-tab svg { width: 15px; height: 15px; color: var(--cm-faint); opacity: 0; transition: opacity .12s var(--cm-ease); }
.cmh-mega-tab:hover { background: var(--cm-soft); color: var(--cm-ink); }
.cmh-mega-tab.is-on { background: var(--cm-soft); color: var(--cm-ink); font-weight: 700; }
.cmh-mega-tab.is-on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--cm-ink); }
.cmh-mega-tab.is-on svg, .cmh-mega-tab:hover svg { opacity: 1; }

/* Derecha: subcategorías del grupo */
.cmh-mega-panels { padding: 22px 0 26px 32px; }
.cmh-mega-panel[hidden] { display: none; }
.cmh-mega-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.cmh-mega-head h3 { font: 800 20px/1.2 Montserrat, sans-serif; color: var(--cm-ink); letter-spacing: -.01em; }
.cmh-mega-head span { font: 600 13px Montserrat, sans-serif; color: var(--cm-faint); }
.cmh-mega-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cmh-mega-item {
  display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 68px; padding: 12px 16px;
  border-radius: 14px; background: var(--cm-soft); border: 1px solid transparent; color: var(--cm-ink) !important;
  transition: background .15s var(--cm-ease), border-color .15s var(--cm-ease), box-shadow .15s var(--cm-ease), transform .15s var(--cm-ease);
}
.cmh-mega-item:hover { background: #fff; border-color: var(--cm-line); box-shadow: 0 8px 20px rgba(11, 15, 25, .08); transform: translateY(-1px); }
.cmh-mega-item span { font: 700 14px/1.25 Montserrat, sans-serif; }
.cmh-mega-item small { font: 600 12px/1 Montserrat, sans-serif; color: var(--cm-muted); }
@media (max-width: 1180px) { .cmh-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cmh-mega.is-on { opacity: 1; transform: none; }


/* Al bajar, la barra de categorías se esconde para dar espacio. */
.cmh.is-compact .cmh-nav > .cmh-wrap { height: 0; opacity: 0; overflow: hidden; }
.cmh.is-compact .cmh-nav { border-bottom-color: transparent; }
.cmh.is-compact .cmh-main .cmh-wrap { height: 70px; }

/* Ocultar la cabecera vieja de Elementor si quedara algún rastro (caché) */
body.cmh-on .elementor-location-header { display: none !important; }

/* ---------------------------------------------------------------- */
/* Menú lateral (celular)                                            */
/* ---------------------------------------------------------------- */
.cmh-drawer { position: fixed; inset: 0; z-index: 1000000000; }
.cmh-drawer[hidden] { display: none; }
.cmh-drawer-back { position: absolute; inset: 0; background: rgba(9, 12, 22, .45); opacity: 0; transition: opacity .25s var(--cm-ease); }
.cmh-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(390px, 88vw); background: #fff;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-100%); transition: transform .3s var(--cm-ease); box-shadow: 16px 0 48px rgba(9, 12, 22, .2);
}
.cmh-drawer.is-on .cmh-drawer-back { opacity: 1; }
.cmh-drawer.is-on .cmh-drawer-panel { transform: none; }
.cmh-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 20px; padding-top: calc(14px + env(safe-area-inset-top)); }
.cmh-drawer-head img { height: 30px; width: auto; }
.cmh-drawer-search {
  display: flex !important; align-items: center; gap: 12px; margin: 6px 16px 12px !important;
  height: 52px !important; min-height: 52px; padding: 0 18px !important; line-height: 1 !important;
  border: 1.5px solid transparent !important; border-radius: 16px !important; background: var(--cm-soft) !important;
  color: var(--cm-muted) !important; font: 500 16px/1 Montserrat, sans-serif !important; width: auto !important; box-shadow: none !important;
}
.cmh-drawer-search svg { width: 21px; height: 21px; color: var(--cm-ink); }
.cmh-drawer-label { margin: 14px 20px 6px; font: 800 11px/1 Montserrat, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--cm-faint); }
.cmh-drawer-nav { padding: 0 8px; }
.cmh-acc-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--cm-ink); font: 700 15px Montserrat, sans-serif; text-align: left;
}
.cmh-acc-btn:hover { background: var(--cm-soft); }
.cmh-acc-btn span { flex: 1; }
.cmh-acc-btn small { font: 700 12px Montserrat, sans-serif; color: var(--cm-faint); }
.cmh-acc-btn svg { width: 17px; height: 17px; color: var(--cm-faint); transition: transform .2s var(--cm-ease); }
.cmh-acc-btn[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--cm-ink); }
.cmh-acc-list { padding: 2px 0 8px 12px; }
.cmh-acc-list[hidden] { display: none; }
.cmh-acc-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 14px; border-radius: 10px;
  color: var(--cm-ink-2) !important; font: 500 14px Montserrat, sans-serif;
}
.cmh-acc-list a:active, .cmh-acc-list a:hover { background: var(--cm-soft); }
.cmh-acc-list small { font: 700 12px Montserrat, sans-serif; color: var(--cm-faint); }
.cmh-drawer-foot { margin-top: auto; padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--cm-line); display: flex; flex-direction: column; gap: 10px; }
.cmh-drawer-wa {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--cm-wa); color: #fff !important;
}
.cmh-drawer-wa svg { width: 26px; height: 26px; }
.cmh-drawer-wa span { display: flex; flex-direction: column; gap: 2px; }
.cmh-drawer-wa b { font: 800 15px Montserrat, sans-serif; }
.cmh-drawer-wa small { font: 600 12.5px Montserrat, sans-serif; opacity: .9; }
.cmh-drawer-foot p { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 13px Montserrat, sans-serif; color: var(--cm-muted); }
.cmh-drawer-foot p svg { width: 16px; height: 16px; }
.cmh-drawer-link { color: var(--cm-ink-2) !important; text-decoration: underline !important; }
.cmh-drawer-social { display: flex; gap: 8px; }
.cmh-drawer-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--cm-soft); color: var(--cm-ink) !important; }
.cmh-drawer-social svg { width: 18px; height: 18px; }
html.cmh-lock, html.cmh-lock body { overflow: hidden !important; }

/* ---------------------------------------------------------------- */
/* Tablet y celular                                                  */
/* ---------------------------------------------------------------- */
@media (max-width: 1180px) {
  .cmh-act-wa .cmh-act-txt { display: none; }
  .cmh-act-wa { padding: 0 6px; }
}

@media (max-width: 1023px) {
  .cmh { --cmh-top-h: 32px; }
  .cmh-spacer { height: var(--cmh-h, 150px); }
  .cmh-wrap { padding: 0 14px; }
  .cmh-top .cmh-wrap { height: 32px; gap: 14px; font-size: 11.5px; }
  .cmh-hide-sm, .cmh-top-social { display: none; }

  .cmh-main .cmh-wrap {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "burger logo actions" "search search search";
    gap: 4px 8px; height: auto; padding-top: 8px; padding-bottom: 10px;
  }
  .cmh-main .cmh-burger { display: grid; margin-left: -6px; }
  .cmh-logo { justify-self: center; }
  .cmh-main .cmh-burger { justify-self: start; }
  .cmh-actions { justify-self: end; }
  .cmh-logo img { height: 34px; max-width: 160px; }
  .cmh-search { max-width: none; height: 52px !important; min-height: 52px; border-radius: 16px !important; font-size: 16px !important; padding: 0 16px !important; margin-top: 4px; line-height: 1 !important; }
  .cmh-search-kbd { display: none; }
  .cmh-actions { gap: 0; }
  .cmh-act { padding: 0; height: 44px; }
  .cmh-act:hover { background: transparent; }
  .cmh-act-txt, .cmh-act-wa { display: none; }
  .cmh-act-ico { width: 42px; height: 42px; }
  .cmh-nav { display: none; }

  /* Al bajar queda solo el buscador; al subir vuelve la fila del logo. */
  .cmh-main .cmh-wrap > .cmh-burger, .cmh-main .cmh-wrap > .cmh-logo, .cmh-main .cmh-wrap > .cmh-actions {
    transition: opacity .2s var(--cm-ease);
  }
  .cmh.is-compact .cmh-main .cmh-wrap { grid-template-areas: "search search search"; height: auto; padding-top: 8px; }
  .cmh.is-compact .cmh-main .cmh-burger, .cmh.is-compact .cmh-logo, .cmh.is-compact .cmh-actions { display: none; }
  .cmh.is-compact .cmh-search { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cmh *, .cmh-drawer * { transition: none !important; animation: none !important; }
}
