:root {
    --mh-header-height: 72px;
  }
  
  @media (max-width: 768px) {
    :root {
      --mh-header-height: 56px;
    }
  }
  
  /* === HEADER BASE === */
  .mh-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--mh-header-height);
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    z-index: 1000;
    transition: all .3s ease;
  }

  .mh-header::after {
    background: #f7f7f7 !important;
  }
  .mh-header.scrolled {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }
  
  /* === ESPACIADO GLOBAL === */
  body {
    margin: 0;
    padding-top: var(--mh-header-height);
    background: #fff;
  }
  .mh-hero,
  .mh-hero-stack,
  main > section:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* === CONTENEDOR FLEX === */
  .mh-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
  }
  
  /* === Ajuste final del header y logo === */
  /* Contenedor del logo */
  .mh-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  /* Imagen del logo: más proporcionada y sin borde visual */
  .mh-logo-img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    filter: none;
    transition: transform 0.25s ease;
  }

  .mh-logo-img:hover {
    transform: scale(1.04);
  }

  @media (max-width: 768px) {
    .mh-logo-img {
      height: 36px;
    }
  
    .mh-container {
      padding: 10px 18px; /* reduce el padding vertical del header */
    }
  }

  
  /* === BOTÓN CTA CENTRO === */
  .mh-cta {
    background: linear-gradient(135deg, #0071ff, #0056d4);
    color: #fff;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all .25s ease;
    box-shadow: 0 3px 10px rgba(0,113,255,0.2);
    margin: 0 auto;
  }
  .mh-cta:hover {
    background: linear-gradient(135deg, #005fe0, #0047a8);
    box-shadow: 0 5px 15px rgba(0,113,255,0.25);
  }
  
  /* === MENÚ === */
  .mh-nav-header {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
  }
  .mh-nav-header a {
    text-decoration: none;
    color: #222;
    font-weight: 500;
    font-size: 15px;
    position: relative;
    transition: color 0.25s ease;
  }
  .mh-nav-header a:hover {
    color: #0071ff;
  }
  .mh-nav-header a::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0071ff;
    transition: width .25s ease;
  }
  .mh-nav-header a:hover::after { width: 100%; }
  
  /* === HAMBURGUESA === */
  .mh-burger {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    justify-content: space-between;
    height: 20px;
    width: 28px;
    cursor: pointer;
    z-index: 1001;
  }
  .mh-burger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  .mh-burger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .mh-burger.active span:nth-child(2) { opacity: 0; }
  .mh-burger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  /* === MÓVIL === */
  @media (max-width: 960px) {
    .mh-nav-header {
      position: absolute;
      top: 100%;
      right: 0;
      flex-direction: column;
      background: #fff;
      width: 240px;
      padding: 20px;
      border: 1px solid rgba(0,0,0,0.05);
      box-shadow: 0 10px 25px rgba(0,0,0,0.1);
      border-radius: 10px;
      display: none;
    }
    .mh-nav-header.open { display: flex; }
    .mh-nav-header a {
      display: block;
      width: 100%;
      padding: 8px 0;
      font-size: 15px;
      line-height: 1.3;
      text-align: left;
    }
    .mh-nav-header a + a {
      border-top: 1px solid rgba(0,0,0,0.05);
    }
    .mh-burger { display: flex; }
    .mh-cta { display: none; }
  }

  /* --- FIX FINAL: elimina espacio blanco en escritorio --- */
@media (min-width: 961px) {
    .wp-block-group.alignfull:first-of-type,
    .wp-block-cover:first-of-type,
    .is-layout-constrained:first-of-type,
    .mh-hero,
    .mh-hero-stack,
    main > section:first-child {
      margin-top: 0 !important;
      padding-top: 0 !important;
    }
  
    body {
      background: #fff !important;
      padding-top: var(--mh-header-height) !important;
    }
  
    html {
      background: #fff !important;
    }
  }

  /* === FIX GLOBAL: compensa cabecera fija en móvil ===
@media (max-width: 768px) {
  main,
  .entry-content,
  .wp-site-blocks > *:first-child {
    margin-top: 90px !important;
  }
} */

/* === EXCEPCIONES: páginas con hero o wizard === */
@media (max-width: 768px) { 
  body.page-id-39 main,
  body.page-id-39 .entry-content,
  body.page-id-39 .wp-site-blocks > *:first-child{
    margin-top: 0 !important;
  }
}

@media (max-width: 768px) {
  body.page-id-34 main,
  body.page-id-173 main,
  body.page-id-178 main,
  body.page-id-203 main,
  body.page-id-34 .entry-content,
  body.page-id-173 .entry-content,
  body.page-id-178 .entry-content,
  body.page-id-203 .entry-content,
  body.page-id-34 .wp-site-blocks > *:first-child,
  body.page-id-173 .wp-site-blocks > *:first-child,
  body.page-id-178 .wp-site-blocks > *:first-child,
  body.page-id-203 .wp-site-blocks > *:first-child{
    margin-top: 50px !important;
  }
}


