/* Menú superior modernizado. Solo estilo (más un botón de contacto copiado del menú):
   la estructura del tema no se toca. Colores de marca: verde #229896, naranja #ff9403. */

:root {
  --hm-font: "Lato", "Segoe UI", system-ui, sans-serif;   /* misma letra que los textos de la web */
  --hm-teal: #229896;
  --hm-teal-soft: #eaf5f4;
  --hm-orange: #ff9403;
  --hm-orange-dark: #e98400;
  --hm-text: #2f3b3b;
  --hm-line: rgba(20, 40, 40, .08);
  --hm-h: 90px;          /* alto de la barra */
  --hm-gutter: clamp(48px, 5vw, 96px);   /* margen lateral: crece un poco en pantallas grandes */
}

/* ---------- Barra fija, blanca y translúcida ---------- */
html { scroll-padding-top: var(--hm-h); }
html body #Header { min-height: var(--hm-h) !important; }
html body #Header #Top_bar,
html body #Header #Top_bar.is-sticky {
  position: fixed !important;
  top: 0 !important; left: 0; right: 0;
  width: 100%;
  height: var(--hm-h);
  z-index: 900;
  background: rgba(255, 255, 255, .9) !important;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: none !important;
  border-bottom: 1px solid var(--hm-line);
  transition: box-shadow .25s ease, background .25s ease;
}
html body #Header #Top_bar.hm-scrolled {
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 8px 24px -12px rgba(20, 40, 40, .25) !important;
}
html body #Header #Top_bar .top_bar_left,
html body #Header #Top_bar #menu,
html body #Header #Top_bar .top_bar_right,
html body #Header #Top_bar .top_bar_right:before { background: transparent !important; }
html body #Header_wrapper { background-color: #fff; }

/* Ancho completo: logo pegado a la izquierda, botones a la derecha */
html body #Header #Top_bar .container {
  max-width: none !important;
  width: 100% !important;
  padding: 0 var(--hm-gutter);
  box-sizing: border-box;
}
html body #Header #Top_bar .column.one { position: relative; width: 100%; margin: 0; }
html body #Header #Top_bar .top_bar_left { width: 100% !important; float: none; }
html body #Header #Top_bar .logo { margin-left: 0 !important; }

/* Botón de contacto (fuera del menú, junto al idioma) */
html body #Header #Top_bar .hm-cta {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--hm-orange);
  color: #fff !important;
  font-family: var(--hm-font);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(255, 148, 3, .55);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
html body #Header #Top_bar .hm-cta:hover {
  background: var(--hm-orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -8px rgba(255, 148, 3, .6);
}

/* ---------- Escritorio ---------- */
@media only screen and (min-width: 1240px) {
  /* Menú centrado en la barra */
  html body #Header #Top_bar .menu_wrapper {
    position: absolute;
    left: 50%; top: 0;
    transform: translateX(-50%);
    float: none;
    width: auto;
  }
  html body #Header #Top_bar #menu > ul { width: auto !important; }

  /* Zona derecha: Contacto + idioma, centrados en vertical */
  html body #Header #Top_bar .top_bar_right {
    position: absolute !important;
    right: 0; top: 0;
    height: var(--hm-h) !important;
    display: flex;
    align-items: center;
    padding: 0 !important;
  }
  html body #Header #Top_bar .top_bar_right_wrapper {
    position: static !important;
    top: auto !important;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  html body #Header #Top_bar .top_bar_right .wpml-languages { margin: 0 !important; float: none; }

  /* El "Contacto" del menú se oculta: ya está como botón a la derecha */
  html body #Header #Top_bar .menu > li.hm-cta-item { display: none !important; }

  /* Separadores: rayitas finas y cortas que se desvanecen en los extremos */
  html body #Header #Top_bar .menu > li { border: 0 !important; padding: 0 8px !important; position: relative; }
  html body #Header #Top_bar .menu > li + li:not(.hm-cta-item)::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 1px; height: 22px;
    transform: translateY(-50%);
    background: linear-gradient(to bottom, transparent, rgba(34, 152, 150, .45), transparent);
    pointer-events: none;
  }

  /* Enlaces del primer nivel */
  html body #Header #Top_bar .menu > li > a,
  html body #Header #Top_bar .menu > li.hover > a:first-child {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
    color: var(--hm-text) !important;
    padding: 27.5px 0 !important;
    margin: 0 !important;
    transition: color .2s ease;
  }
  html body #Header #Top_bar .menu > li > a span:not(.description) {
    position: relative;
    font-family: var(--hm-font);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: .005em;
    line-height: 35px !important;
    padding: 0 14px !important;
  }
  /* Hueco para la flecha de Productos */
  html body #Header #Top_bar .menu > li.submenu > a span:not(.description) { padding-right: 26px !important; }
  html body.menuo-arrows #Header #Top_bar .menu > li.submenu > a > span:not(.description)::after {
    border-top-color: currentColor;
    opacity: .6;
  }

  /* Subrayado animado, pegado al texto */
  html body #Header #Top_bar .menu > li > a span:not(.description)::before {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 1px;
    height: 2px;
    border-radius: 2px;
    background: var(--hm-teal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
  }
  html body #Header #Top_bar .menu > li.submenu > a span:not(.description)::before { right: 26px; }
  html body #Header #Top_bar .menu > li:hover > a,
  html body #Header #Top_bar .menu > li.hover > a:first-child { color: var(--hm-teal) !important; }
  html body #Header #Top_bar .menu > li:hover > a span::before,
  html body #Header #Top_bar .menu > li.hover > a span::before { transform: scaleX(1); }

  /* Página actual: texto verde + subrayado fijo */
  html body #Header #Top_bar .menu > li.current-menu-item > a,
  html body #Header #Top_bar .menu > li.current_page_item > a,
  html body #Header #Top_bar .menu > li.current-menu-parent > a,
  html body #Header #Top_bar .menu > li.current-menu-ancestor > a {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--hm-teal) !important;
  }
  html body #Header #Top_bar .menu > li.current-menu-item > a span::before,
  html body #Header #Top_bar .menu > li.current_page_item > a span::before,
  html body #Header #Top_bar .menu > li.current-menu-parent > a span::before,
  html body #Header #Top_bar .menu > li.current-menu-ancestor > a span::before { transform: scaleX(1); }

  /* Desplegable de Productos: tarjeta vertical, centrada bajo "Productos" */
  html body #Header #Top_bar .menu > li > ul.sub-menu {
    background: #fff !important;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(20, 40, 40, .18) !important;
    padding: 10px !important;
    margin-top: 0 !important;
    width: 270px !important;
    left: 50% !important;
    transform: translateX(-50%);
    display: none;
  }
  html body #Header #Top_bar .menu > li.hover > ul.sub-menu,
  html body #Header #Top_bar .menu > li:hover > ul.sub-menu { display: block !important; }
  html body #Header #Top_bar .menu li ul.sub-menu li { width: auto !important; float: none !important; display: block; border: 0 !important; }
  html body #Header #Top_bar .menu li ul.sub-menu li a {
    border: 0 !important;
    border-radius: 10px;
    padding: 9px 16px !important;
    display: block;
    color: var(--hm-text) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: background .15s ease, color .15s ease;
  }
  html body #Header #Top_bar .menu li ul.sub-menu li a span { font-family: var(--hm-font); font-weight: 400; font-size: 16.5px; line-height: 22px !important; padding: 0 !important; }
  html body #Header #Top_bar .menu li ul.sub-menu li a .menu-arrow,
  html body #Header #Top_bar .menu li ul.sub-menu li a span::after { display: none !important; }
  html body #Header #Top_bar .menu li ul.sub-menu li a:hover,
  html body #Header #Top_bar .menu li ul.sub-menu li.current-menu-item > a {
    background: var(--hm-teal-soft) !important;
    color: var(--hm-teal) !important;
  }
}

/* Selector de idioma: píldora discreta, misma altura que el botón */
html body #Header #Top_bar .wpml-languages a.active {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--hm-line) !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 0 12px 0 14px !important;
}
/* Código de idioma junto a la bandera */
html body #Header #Top_bar .wpml-languages .hm-lang-code {
  font-family: var(--hm-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  color: var(--hm-text);
}
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown li a { gap: 6px; }
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown li a:hover .hm-lang-code { color: var(--hm-teal); }

/* El desplegable es una píldora gemela del botón: mismo ancho, alto y forma */
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown {
  width: 100% !important;
  margin-top: 6px !important;
  padding: 0 !important;
  border: 1px solid var(--hm-line) !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: 0 12px 24px -10px rgba(20, 40, 40, .2) !important;
  overflow: visible !important;   /* el tema lo oculta y se perdería el puente de abajo */
}
/* Puente invisible para no perder el hover al bajar el ratón al desplegable */
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown::before {
  content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown li { width: 100% !important; }
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown li a {
  display: flex !important;
  align-items: center;
  height: 42px;              /* 44 del botón menos el borde */
  box-sizing: border-box;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 999px;
}
html body #Header #Top_bar .wpml-languages ul.wpml-lang-dropdown li a:hover { background: var(--hm-teal-soft) !important; }

/* ---------- Móvil y tablet (menú hamburguesa) ---------- */
@media only screen and (max-width: 1239px) {
  :root { --hm-h: 76px; --hm-gutter: 16px; }
  html body #Header #Top_bar .hm-cta { display: none; }   /* en móvil Contacto va dentro del menú */
  html body #Header #Top_bar .logo { float: left !important; width: auto !important; text-align: left !important; margin: 0 !important; }
  html body #Header #Top_bar #logo { margin: 0 !important; height: 50px !important; line-height: 50px !important; padding: 13px 0 !important; }
  html body #Header #Top_bar #logo img { max-height: 50px; width: auto; }
  html body #Header #Top_bar a.responsive-menu-toggle {
    top: 20px !important;
    right: 0 !important;
    color: var(--hm-teal) !important;
    border-radius: 10px;
  }
  /* El idioma se queda en la barra, a la izquierda de la hamburguesa */
  html body #Header #Top_bar .top_bar_right {
    position: absolute !important;
    right: 46px; top: 0;
    height: var(--hm-h) !important;
    display: flex; align-items: center;
    width: auto !important;
  }
  html body #Header #Top_bar .top_bar_right_wrapper { position: static !important; top: auto !important; }
  html body #Header #Top_bar .wpml-languages a.active { height: 36px; }
  html body #Header #Top_bar #menu {
    top: calc(var(--hm-h) - 6px) !important;
    right: 0 !important;
    width: min(320px, calc(100vw - 32px)) !important;
    max-height: calc(100vh - var(--hm-h) - 20px);
    overflow-y: auto;
    background: #fff !important;
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(20, 40, 40, .2);
    padding: 6px 0 12px;
  }
  html body #Header #Top_bar #menu ul li a,
  html body #Header #Top_bar #menu ul li.hover > a,
  html body #Header #Top_bar #menu > ul > li.current-menu-item > a,
  html body #Header #Top_bar #menu > ul > li.current-menu-parent > a,
  html body #Header #Top_bar #menu > ul > li.current-menu-ancestor > a,
  html body #Header #Top_bar #menu > ul > li.current_page_item > a {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: var(--hm-text) !important;
  }
  html body #Header #Top_bar #menu ul li a span { font-family: var(--hm-font); font-size: 18px; font-weight: 400; }
  html body #Header #Top_bar #menu ul li ul li a span { font-size: 16.5px; font-weight: 400; }
  html body #Header #Top_bar #menu > ul > li.current-menu-item > a,
  html body #Header #Top_bar #menu > ul > li.current-menu-parent > a,
  html body #Header #Top_bar #menu > ul > li.current-menu-ancestor > a,
  html body #Header #Top_bar #menu ul li ul li.current-menu-item > a { color: var(--hm-teal) !important; font-weight: 600; }
  html body #Header #Top_bar #menu ul li { border: 0 !important; }
  html body #Header #Top_bar #menu ul li.submenu .menu-toggle { border-left: 0 !important; color: var(--hm-teal); }
  html body #Header #Top_bar #menu ul li ul { background: var(--hm-teal-soft) !important; box-shadow: none !important; margin: 0 12px !important; border-radius: 12px; }
  /* Contacto como botón a lo ancho */
  html body #Header #Top_bar #menu > ul > li.hm-cta-item { padding: 8px 16px 0; }
  html body #Header #Top_bar #menu > ul > li.hm-cta-item > a {
    background: var(--hm-orange) !important;
    color: #fff !important;
    border-radius: 999px !important;
    text-align: center;
    font-weight: 600;
  }
}
