/* ==========================================================================
   VIAMARIS — Header propio con megamenú (v1, 2026-11-05)
   Todo cuelga de #vmh para ganar en especificidad al kit 291 de Elementor.
   Lenguaje visual: el de /transitario-china/ — cero border-radius, línea fina,
   negro + oro, Source Sans 3 / Playfair Display solo para titulares de CTA.
   ========================================================================== */

/* Scroll lateral: el footer de Elementor (plantilla 321) va a sangre con width:100vw y
   margin-left:calc(-50vw + 50%). En escritorio 100vw incluye la barra de scroll vertical, así
   que sobresalía ≈8-15 px. Se recorta en su contenedor con overflow-x:clip, que NO crea un
   contenedor de scroll (no rompe el sticky del header ni nada más). */
[data-elementor-type="footer"], .elementor-location-footer { overflow-x: hidden; }
@supports (overflow: clip) { [data-elementor-type="footer"], .elementor-location-footer { overflow-x: clip; } }

#vmh {
  --vmh-gold: #D4A32A;
  --vmh-gold-dk: #B8891F;
  --vmh-ink: #1A1A1A;
  --vmh-black: #0A0A0A;
  --vmh-muted: #6B6B66;
  --vmh-line: #E5E5E3;
  --vmh-surface: #F7F7F5;
  --vmh-cream: #F5EFD8;
  --vmh-h: 76px;
  --vmh-h-s: 62px;
  position: sticky;
  top: 0;
  z-index: 9990;
  overflow-anchor: none; /* que el navegador no reajuste el scroll cuando el header cambia de alto */
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--vmh-ink);
  -webkit-font-smoothing: antialiased;
}
body.admin-bar #vmh { top: 32px; }
@media (max-width: 782px) { body.admin-bar #vmh { top: 0; } }

#vmh *, #vmh *::before, #vmh *::after { box-sizing: border-box; border-radius: 0; }
#vmh a { text-decoration: none; color: inherit; transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
#vmh a:hover, #vmh a:focus { text-decoration: none; }
#vmh ul { list-style: none; margin: 0; padding: 0; }
#vmh p { margin: 0; }
#vmh img { max-width: none; border: 0; box-shadow: none; }
#vmh button {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
  cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: inherit; line-height: inherit;
}
#vmh button:hover, #vmh button:focus { background: none; color: inherit; }
#vmh svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; }
#vmh :focus-visible { outline: 2px solid var(--vmh-gold); outline-offset: 2px; }

#vmh .vmh-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ── Barra superior ───────────────────────────────────────────────────── */
#vmh .vmh-top {
  background: var(--vmh-black);
  color: #CFCFCB;
  font-size: 13px;
  letter-spacing: .02em;
  overflow: hidden;
  max-height: 36px;
  transition: max-height .25s ease;
}
#vmh .vmh-top > .vmh-wrap { display: flex; align-items: center; justify-content: space-between; height: 36px; gap: 24px; }
#vmh .vmh-top__l { display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vmh .vmh-top__l b { color: var(--vmh-gold); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
#vmh .vmh-top__dot { width: 4px; height: 4px; background: var(--vmh-gold); display: inline-block; flex: none; }
#vmh .vmh-top__r { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
#vmh .vmh-top__r a { color: #CFCFCB; display: inline-flex; align-items: center; gap: 7px; }
#vmh .vmh-top__r a:hover { color: #fff; }
#vmh .vmh-top__r svg { width: 14px; height: 14px; color: var(--vmh-gold); }
#vmh.is-scrolled .vmh-top { max-height: 0; }

/* ── Barra principal ──────────────────────────────────────────────────── */
#vmh .vmh-bar {
  /* Sin backdrop-filter: crearía un bloque contenedor y rompería los position:fixed de dentro */
  background: #fff;
  border-bottom: 1px solid var(--vmh-line);
  position: relative;
}
#vmh .vmh-bar > .vmh-wrap { display: flex; align-items: center; height: var(--vmh-h); gap: 32px; transition: height .25s ease; }
#vmh.is-scrolled .vmh-bar > .vmh-wrap { height: var(--vmh-h-s); }
#vmh.is-scrolled .vmh-bar { box-shadow: 0 10px 30px -22px rgba(0,0,0,.45); }

#vmh .vmh-logo { display: flex; align-items: center; flex: none; }
#vmh .vmh-logo img { height: 46px; width: auto; display: block; transition: height .25s ease; }
#vmh.is-scrolled .vmh-logo img { height: 38px; }

/* Navegación */
#vmh .vmh-nav { flex: 1; height: 100%; }
#vmh .vmh-nav > ul { display: flex; align-items: stretch; height: 100%; gap: 4px; }
#vmh .vmh-nav > ul > li { display: flex; align-items: stretch; }
#vmh .vmh-link {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px;
  font-size: 15.5px; font-weight: 600; color: var(--vmh-ink);
  position: relative; height: 100%;
  white-space: nowrap;
}
#vmh .vmh-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--vmh-gold); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
#vmh .vmh-link:hover, #vmh .vmh-item.is-open > .vmh-link, #vmh .vmh-link.is-current { color: var(--vmh-black); }
#vmh .vmh-link:hover::after, #vmh .vmh-item.is-open > .vmh-link::after, #vmh .vmh-link.is-current::after { transform: scaleX(1); }
#vmh .vmh-link svg { width: 12px; height: 12px; stroke-width: 2; transition: transform .22s ease; color: var(--vmh-muted); }
#vmh .vmh-item.is-open > .vmh-link svg { transform: rotate(180deg); color: var(--vmh-gold); }

/* Acciones */
#vmh .vmh-actions { display: flex; align-items: center; gap: 18px; flex: none; }
#vmh .vmh-tel { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--vmh-ink); }
#vmh .vmh-tel svg { width: 17px; height: 17px; color: var(--vmh-gold-dk); }
#vmh .vmh-tel:hover { color: var(--vmh-gold-dk); }
#vmh .vmh-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--vmh-black); color: #fff;
  padding: 0 22px; height: 46px;
  font-size: 15px; font-weight: 700; letter-spacing: .01em;
  border: 1px solid var(--vmh-black);
}
#vmh .vmh-cta svg { width: 16px; height: 16px; stroke-width: 2; color: var(--vmh-gold); transition: transform .2s ease; }
#vmh .vmh-cta:hover { background: var(--vmh-gold); border-color: var(--vmh-gold); color: var(--vmh-black); }
#vmh .vmh-cta:hover svg { color: var(--vmh-black); transform: translateX(3px); }
#vmh.is-scrolled .vmh-cta { height: 42px; }

/* ── Megamenú ─────────────────────────────────────────────────────────── */
#vmh .vmh-mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff;
  border-bottom: 1px solid var(--vmh-line);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.35);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
#vmh .vmh-item.is-open > .vmh-mega {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s;
}
#vmh .vmh-mega__in { display: grid; gap: 40px; padding-top: 36px; padding-bottom: 36px; }
#vmh .vmh-mega--serv .vmh-mega__in { grid-template-columns: 1fr 1fr 360px; }
#vmh .vmh-mega--orig .vmh-mega__in { grid-template-columns: 1fr 360px; }
#vmh .vmh-mega--rec .vmh-mega__in { grid-template-columns: 280px 1fr; }

#vmh .vmh-eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--vmh-gold-dk); padding-bottom: 12px; margin-bottom: 8px;
  border-bottom: 1px solid var(--vmh-line);
  display: flex; align-items: center; justify-content: space-between;
}
#vmh .vmh-eyebrow a { font-size: 12px; letter-spacing: .04em; text-transform: none; color: var(--vmh-muted); font-weight: 600; }
#vmh .vmh-eyebrow a:hover { color: var(--vmh-ink); }

/* Enlace con icono + título + bajada */
#vmh .vmh-svc {
  display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start;
  padding: 12px 12px 12px 0; margin-left: 0;
  border-left: 2px solid transparent;
}
#vmh .vmh-svc__ico {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--vmh-line); background: var(--vmh-surface); color: var(--vmh-ink);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
#vmh .vmh-svc__ico svg { width: 20px; height: 20px; }
#vmh .vmh-svc__t { display: block; font-size: 15.5px; font-weight: 700; color: var(--vmh-ink); line-height: 1.25; }
#vmh .vmh-svc__d { display: block; font-size: 13.5px; color: var(--vmh-muted); line-height: 1.4; margin-top: 3px; }
#vmh .vmh-svc:hover .vmh-svc__ico { background: var(--vmh-black); border-color: var(--vmh-black); color: var(--vmh-gold); }
#vmh .vmh-svc:hover .vmh-svc__t { color: var(--vmh-black); text-decoration: underline; text-decoration-color: var(--vmh-gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Tarjeta destacada (negro con retícula dorada) */
#vmh .vmh-feat {
  background-color: var(--vmh-black);
  background-image:
    linear-gradient(rgba(212,163,42,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,163,42,.10) 1px, transparent 1px);
  background-size: 40px 40px;
  color: #fff; padding: 30px 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 100%;
}
#vmh .vmh-feat__k { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--vmh-gold); }
#vmh .vmh-feat__t { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 26px; line-height: 1.2; margin-top: 12px; color: #fff; }
#vmh .vmh-feat__t em { color: var(--vmh-gold); font-style: normal; }
#vmh .vmh-feat__d { font-size: 14.5px; color: #CFCFCB; line-height: 1.5; margin-top: 10px; }
#vmh .vmh-feat__list { display: grid; gap: 8px; }
#vmh .vmh-feat__list li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: #E6E6E2; }
#vmh .vmh-feat__list svg { width: 15px; height: 15px; color: var(--vmh-gold); stroke-width: 2.2; flex: none; }
#vmh .vmh-feat__btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--vmh-gold); color: var(--vmh-black); font-weight: 700; font-size: 15px;
  padding: 14px 18px; border: 1px solid var(--vmh-gold);
}
#vmh .vmh-feat__btn svg { width: 16px; height: 16px; stroke-width: 2; transition: transform .2s ease; }
#vmh .vmh-feat__btn:hover { background: #fff; border-color: #fff; color: var(--vmh-black); }
#vmh .vmh-feat__btn:hover svg { transform: translateX(3px); }

/* Orígenes: retícula de línea fina */
#vmh .vmh-orig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--vmh-line); border: 1px solid var(--vmh-line); margin-top: 16px; }
#vmh .vmh-orig a { background: #fff; padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 6px; position: relative; }
#vmh .vmh-orig__code {
  font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 30px; line-height: 1;
  color: var(--vmh-gold); margin-bottom: 10px;
}
#vmh .vmh-orig__t { font-size: 16px; font-weight: 700; color: var(--vmh-ink); }
#vmh .vmh-orig__d { font-size: 13.5px; color: var(--vmh-muted); line-height: 1.45; }
#vmh .vmh-orig__go { position: absolute; top: 22px; right: 20px; color: var(--vmh-line); transition: color .18s ease, transform .18s ease; }
#vmh .vmh-orig__go svg { width: 18px; height: 18px; stroke-width: 2; }
#vmh .vmh-orig a:hover { background: var(--vmh-surface); }
#vmh .vmh-orig a:hover .vmh-orig__go { color: var(--vmh-gold-dk); transform: translate(2px,-2px); }
#vmh .vmh-orig-note { font-size: 13.5px; color: var(--vmh-muted); margin-top: 14px; }
#vmh .vmh-orig-note a { color: var(--vmh-ink); font-weight: 600; border-bottom: 1px solid var(--vmh-gold); }

/* Recursos */
#vmh .vmh-res a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--vmh-line); font-size: 15px; font-weight: 600; color: var(--vmh-ink); }
#vmh .vmh-res a span { color: var(--vmh-muted); font-weight: 400; font-size: 13px; }
#vmh .vmh-res a:hover { color: var(--vmh-gold-dk); }
#vmh .vmh-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 16px; }
#vmh .vmh-post { display: flex; flex-direction: column; gap: 10px; }
#vmh .vmh-post__img { aspect-ratio: 300 / 158; background: var(--vmh-surface); overflow: hidden; border: 1px solid var(--vmh-line); }
#vmh .vmh-post__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
#vmh .vmh-post__k { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--vmh-gold-dk); }
#vmh .vmh-post__t { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--vmh-ink); }
#vmh .vmh-post:hover .vmh-post__img img { transform: scale(1.04); }
#vmh .vmh-post:hover .vmh-post__t { text-decoration: underline; text-decoration-color: var(--vmh-gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Velo bajo el megamenú */
#vmh .vmh-scrim {
  position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: -1;
  background: rgba(10,10,10,.28); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s;
}
#vmh.has-open .vmh-scrim { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s; }

/* Hamburguesa (oculta en escritorio) */
#vmh .vmh-burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--vmh-line); }
#vmh .vmh-burger span, #vmh .vmh-burger span::before, #vmh .vmh-burger span::after {
  display: block; width: 20px; height: 2px; background: var(--vmh-ink); position: relative; transition: transform .22s ease, background-color .22s ease;
}
#vmh .vmh-burger span::before, #vmh .vmh-burger span::after { content: ""; position: absolute; left: 0; }
#vmh .vmh-burger span::before { top: -6px; }
#vmh .vmh-burger span::after { top: 6px; }
#vmh.is-mobile-open .vmh-burger span { background: transparent; }
#vmh.is-mobile-open .vmh-burger span::before { transform: translateY(6px) rotate(45deg); }
#vmh.is-mobile-open .vmh-burger span::after { transform: translateY(-6px) rotate(-45deg); }

/* ── Escritorio estrecho ──────────────────────────────────────────────── */
@media (max-width: 1240px) {
  #vmh .vmh-tel span { display: none; }
  #vmh .vmh-link { padding: 0 11px; }
  #vmh .vmh-mega--serv .vmh-mega__in { grid-template-columns: 1fr 1fr 300px; gap: 28px; }
}

/* ── Tablet y móvil ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  #vmh .vmh-top__l { display: none; }
  #vmh .vmh-top > .vmh-wrap { justify-content: center; }
  #vmh .vmh-bar > .vmh-wrap { height: 66px; gap: 12px; }
  #vmh.is-scrolled .vmh-bar > .vmh-wrap { height: 60px; }
  #vmh .vmh-logo img, #vmh.is-scrolled .vmh-logo img { height: 36px; }
  #vmh .vmh-burger { display: inline-flex; order: 3; }
  #vmh .vmh-actions { margin-left: auto; gap: 10px; }
  #vmh .vmh-tel { width: 44px; height: 44px; justify-content: center; border: 1px solid var(--vmh-line); }
  #vmh .vmh-cta { height: 44px; padding: 0 16px; font-size: 14px; }
  #vmh .vmh-cta svg { display: none; }

  #vmh .vmh-nav {
    position: fixed; left: 0; right: 0; bottom: 0; top: var(--vmh-panel-top, 102px);
    background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
    height: auto; flex: none;
    transform: translateX(100%); visibility: hidden;
    transition: transform .28s ease, visibility 0s linear .28s;
    border-top: 1px solid var(--vmh-line);
  }
  #vmh.is-mobile-open .vmh-nav { transform: none; visibility: visible; transition: transform .28s ease, visibility 0s; }
  #vmh .vmh-nav > ul { flex-direction: column; height: auto; gap: 0; padding: 8px 24px 120px; }
  #vmh .vmh-nav > ul > li { flex-direction: column; border-bottom: 1px solid var(--vmh-line); }
  #vmh .vmh-link { height: auto; padding: 18px 0; font-size: 18px; justify-content: space-between; width: 100%; }
  #vmh .vmh-link::after { display: none; }
  #vmh .vmh-link svg { width: 16px; height: 16px; }

  #vmh .vmh-mega {
    position: static; box-shadow: none; border: 0; transform: none;
    opacity: 1; visibility: visible; display: none; transition: none;
  }
  #vmh .vmh-item.is-open > .vmh-mega { display: block; }
  #vmh .vmh-mega .vmh-wrap { padding: 0; }
  #vmh .vmh-mega__in,
  #vmh .vmh-mega--serv .vmh-mega__in,
  #vmh .vmh-mega--orig .vmh-mega__in,
  #vmh .vmh-mega--rec .vmh-mega__in { grid-template-columns: 1fr; gap: 22px; padding: 0 0 22px; }
  #vmh .vmh-orig { grid-template-columns: 1fr; }
  #vmh .vmh-orig a { flex-direction: row; align-items: center; gap: 16px; padding: 16px; }
  #vmh .vmh-orig__code { font-size: 22px; margin: 0; width: 40px; }
  #vmh .vmh-orig__d { display: none; }
  #vmh .vmh-posts { grid-template-columns: 1fr; gap: 14px; }
  #vmh .vmh-post { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
  #vmh .vmh-post__k { display: none; }
  #vmh .vmh-feat { padding: 24px 22px; }
  #vmh .vmh-feat__t { font-size: 22px; }
  #vmh .vmh-scrim { display: none; }

  #vmh .vmh-mobile-foot { display: grid; }
}
#vmh .vmh-mobile-foot { display: none; gap: 10px; padding: 0 24px 40px; }
#vmh .vmh-mobile-foot a { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; font-weight: 700; font-size: 16px; border: 1px solid var(--vmh-black); }
#vmh .vmh-mobile-foot a svg { width: 18px; height: 18px; }
#vmh .vmh-mobile-foot .is-primary { background: var(--vmh-black); color: #fff; }
#vmh .vmh-mobile-foot .is-primary svg { color: var(--vmh-gold); }

@media (max-width: 560px) {
  #vmh .vmh-top { display: none; }
  #vmh .vmh-wrap { padding: 0 16px; }
  #vmh .vmh-cta { padding: 0 12px; }
  #vmh .vmh-nav > ul { padding: 8px 16px 120px; }
  #vmh .vmh-mobile-foot { padding: 0 16px 40px; }
}
@media (max-width: 380px) {
  #vmh .vmh-cta span { display: none; }
  #vmh .vmh-cta svg { display: block; }
  #vmh .vmh-cta { width: 44px; padding: 0; justify-content: center; }
}

html.vmh-lock, html.vmh-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  #vmh *, #vmh *::before, #vmh *::after { transition: none !important; }
}
