/* ===================== Megamenú MasterLED ===================== */
  .ml-nav {
    position: relative;
    --ml-navy: #01468d;
    --ml-accent: #092a63;
    --ml-text: #333;
    --ml-sidebar: 300px;
    font-family: inherit;
  }

  .ml-nav *,
  .ml-nav *::before,
  .ml-nav *::after {
    box-sizing: border-box;
  }

  .ml-svg-icon {
    width: 1.25em;
    height: 1.25em;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    flex: none;
  }

  .ml-nav__bar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ml-nav__bar li::before {
    content: none !important;
  }

  .ml-nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 6px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--ml-text);
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    transition: color .15s ease, background .15s ease;
  }

  .ml-nav__link:hover,
  .ml-nav__link:focus-visible {
    color: var(--ml-navy);
  }

  .ml-nav__link .ml-svg-icon {
    width: 20px;
    height: 20px;
  }

  .ml-products-toggle__chev {
    transition: transform .2s ease;
  }

  .ml-nav__item--products.is-open .ml-products-toggle {
    color: var(--ml-navy);
  }

  .ml-nav__item--products.is-open .ml-products-toggle__chev {
    transform: rotate(180deg);
  }

  .ml-overlay {
    position: fixed;
    left: 0;
    width: 100vw;
    top: var(--ml-header-bottom, 120px);
    height: calc(100vh - var(--ml-header-bottom-vp, 120px));
    z-index: 1090;
    background: rgba(0, 0, 0, .3);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .2s ease;
  }

  .ml-overlay.is-visible {
    opacity: 1;
  }

  .ml-products-panel {
    position: fixed;
    left: 0;
    width: 100vw;
    top: var(--ml-header-bottom, 120px);
    z-index: 1100;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
    border-top: 1px solid var(--ml-accent);
    overflow: hidden;
  }

  .ml-products-inner {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
  }

  .ml-products-head {
    display: none;
  }

  .ml-parents {
    flex: 0 0 var(--ml-sidebar);
    width: var(--ml-sidebar);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    background: #f7f8fa;
    border-right: 1px solid #e7e9ee;
    height: 100%;
    overflow-y: auto;

    & .ml-parent:not(:nth-last-child(1)) {
      margin-bottom: 10px !important;
    }
  }

  .ml-parents li::before {
    content: none !important;
  }

  .ml-parent {
    position: static;
  }

  .ml-parent__head {
    display: flex;
    align-items: center;
  }

  .ml-parent__name {
    flex: 1 1 auto;
    display: block;
    padding: 12px 14px;
    color: var(--ml-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: all .15s ease;
  }

  .ml-parent__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    color: #9aa1ad;
    cursor: pointer;
    padding: 8px 12px;
  }

  .ml-parent__toggle .ml-svg-icon {
    transition: transform .2s ease;
  }

  .ml-mega__panel {
    display: none;
    position: absolute;
    top: 0;
    left: var(--ml-sidebar);
    width: calc(100% - var(--ml-sidebar));
    height: 100%;
    overflow-y: auto;
    padding: 26px 30px;
    background: #fff;
  }

  .ml-mega__columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-flow: row dense;
    grid-auto-rows: 8px;
    gap: 18px 34px;
    align-content: start;
  }

  .ml-mega__col {
    break-inside: avoid;
    margin-bottom: 0;
  }

  .ml-mega__heading {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--ml-navy);
    text-decoration: none;
    padding-bottom: 2px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--ml-accent);
  }

  .ml-mega__heading:hover {
    color: #000;
  }

  .ml-mega__list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .ml-mega__list li::before {
    content: none !important;
  }

  .ml-mega__list li {
    margin: 0;
  }

  .ml-mega__list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13.5px;
    color: #555;
    text-decoration: none;
    transition: color .12s ease, padding .12s ease;
  }

  .ml-mega__miniature {
    display: block;
    flex: 0 0 40px;
    width: 40px;
    max-width: 40px;
    height: 40px;
    max-height: 40px;
    object-fit: contain;
  }

  .ml-mega__list a.ml-mega__heading {
    color: var(--ml-navy) !important;
  }

  .ml-mega__list a:hover {
    color: var(--ml-navy);
    /*padding-left: 5px;*/
  }

  .ml-mega__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ml-navy);
    text-decoration: none;
  }

  .ml-mega__all .ml-svg-icon {
    width: 18px;
    height: 18px;
    transition: transform .15s ease;
  }

  .ml-mega__all:hover .ml-svg-icon {
    /*transform: translateX(3px);*/
  }

  .ml-parents .ml-parent.is-hover>.ml-mega__panel {
    display: block;
  }

  .ml-parents .ml-parent.is-hover>.ml-parent__head .ml-parent__name {
    border-left-color: var(--ml-accent);
    background: #fff;
    color: var(--ml-navy);
  }

  /* Grid de marcas */
  .ml-brands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    align-content: start;
  }

  .ml-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    min-height: 96px;
    border: 1px solid #e7e9ee;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: var(--ml-text);
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
  }

  .ml-brand:hover {
    border-color: var(--ml-accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
  }

  .ml-brand__logo {
    max-width: 120px;
    max-height: 40px;
    object-fit: contain;
  }

  .ml-brand__name {
    font-size: 13px;
    font-weight: 600;
  }

  .ml-brand.no-logo .ml-brand__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ml-navy);
  }

  .ml-products-panel[hidden] {
    display: none;
  }

  .ml-overlay[hidden] {
    display: none;
  }

  /* ===== Barra estrecha (<=1460px): PRODUCTOS solo hamburguesa + texto 12px ===== */
  @media (min-width:992px) and (max-width:1460px) {
    .ml-products-toggle__label {
      display: none;
    }

    .ml-nav__link {
      font-size: 12px;
      padding: 14px 10px;
      letter-spacing: .2px;
    }
    .ml-mega__list a {
      padding: 2px 0;
    }
  }

  @media(min-width:992px) {

    .main-menu__footer,
    .main-menu__header {
      display: none;
    }
  .ml-products-inner > .ml-mobile-menu-spacer {
    display: none;
  }

    /*
   * La variable se inicializa desde JavaScript.
   * Sin variable, todo queda en auto y puede medirse naturalmente.
   */
    .ml-products-panel {
      height: var(--ml-products-height, auto);
      max-height: calc(100dvh - var(--ml-header-bottom-vp, 120px));
    }

    .ml-products-inner {
      height: var(--ml-products-height, auto);
      min-height: 0;
    }

    /*
   * Menú principal izquierdo.
   */
    .ml-products-inner>.ml-parents:not(.main-menu__footer) {
      height: var(--ml-products-height, auto);
      min-height: 0;
      max-height: none;
      overflow-y: auto;
    }

    /*
   * Panel derecho activo.
   */
    .ml-mega__panel {
      height: var(--ml-products-height, auto);
      min-height: 0;
      max-height: none;
      overflow-y: auto;
    }
  }

  /* ===================== MÓVIL (acordeón) ===================== */
  @media (max-width:991.98px) {
    .ml-nav {
      position: fixed;
      left: 0;
      right: 0;
      top: var(--ml-header-bottom, 0px);
      bottom: auto;
      height: calc(var(--ml-vh, 100dvh) - var(--ml-header-bottom-vp, 0px));
      width: 100%;
      margin: 0;
      z-index: 1090;
      background: #fff;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity .24s ease, visibility .24s ease;
    }

    .ml-nav.is-open {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }

    /* Móvil: solo se muestra el panel de categorías, sin la barra de parents */
    .ml-nav__bar {
      display: none;
    }

    .ml-nav__item {
      width: 100%;
      border-bottom: 1px solid #eee;
    }

    .ml-nav__link {
      width: 100%;
      padding: 14px 18px;
    }

    .ml-products-panel {
      position: fixed;
      top: var(--ml-header-bottom, 0px);
      bottom: auto;
      height: calc(var(--ml-vh, 100dvh) - var(--ml-header-bottom-vp, 0px));
      left: 0;
      right: 0;
      width: auto;
      margin: 0;
      z-index: 1100;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      border-top: 0;
      box-shadow: none !important;
    }

    .ml-products-inner {
      display: block;
      max-width: none;
      min-height: 100%;
    }

    .ml-products-head {
      display: none;
      align-items: center;
      justify-content: space-between;
      padding: 14px 18px;
      font-weight: 700;
      color: var(--ml-navy);
      border-bottom: 2px solid var(--ml-accent);
      position: sticky;
      top: 0;
      background: #fff;
      z-index: 2;
    }

    .ml-products-close {
      background: none;
      border: 0;
      cursor: pointer;
      color: var(--ml-text);
    }

    .ml-parents {
      flex: none;
      width: 100%;
      padding: 0;
      background: #fff;
      border-right: 0;
      height: fit-content;

      & .ml-parent:not(:nth-last-child(1)) {
        margin-bottom: 0px !important;
      }
    }

    .ml-parent {
      border-bottom: 1px solid #eee;
      margin-bottom: unset !important;
    }

    .ml-parent__head {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      height: 54px;
    }

    .ml-parent__name {
      padding: 0 44px 0 18px;
      width: 100%;
      text-align: left;
      text-transform: uppercase;
      font-weight: 700;
      letter-spacing: .02em;
      line-height: 1.2;
    }

    .ml-parent__toggle {
      display: inline-flex;
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
    }

    .ml-parent.is-open .ml-parent__toggle .ml-svg-icon {
      transform: rotate(90deg);
    }

    .ml-mega__panel,
    .ml-parents .ml-parent.is-hover>.ml-mega__panel {
      position: static;
      left: auto;
      width: 100%;
      height: auto;
      min-height: 0;
      display: block;
      max-height: 0;
      overflow: hidden;
      padding: 0 18px;
      background: #fafbfc;
      transition: max-height .28s ease, padding .28s ease;
    }

    .ml-parent.is-open>.ml-mega__panel {
      max-height: 2000px;
      padding: 8px 18px 18px;
    }

    .ml-mega__columns {
      grid-template-columns: 1fr;
      grid-auto-flow: row;
      grid-auto-rows: auto;
      gap: 0;
    }

    .ml-mega__columns>* {
      grid-row-end: auto !important;
    }

    .ml-mega__col {
      margin-bottom: 14px;
    }

    .ml-mega__all {
      margin-top: 10px;
    }

    .main-menu__header {
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 24px 18px 0;
      padding: 10px 0;
      font-weight: 700;
      color: var(--ml-navy);
      border-bottom: 2px solid var(--ml-accent);
      background: #fff;
    }

    .main-menu__footer {
      align-content: flex-start !important;
      align-items: flex-start !important;
      margin-top: 5rem !important;
    }

    /* Menú adicional: opciones centradas y algo más pequeñas que las categorías */
    .main-menu__footer .ml-parent__head {
      justify-content: center;
      height: 46px;
    }

    .main-menu__footer .ml-parent__name {
      padding: 0 18px;
      text-align: center;
      font-size: 13px;
      text-transform: none !important;
      font-weight: 400 !important
    }

    .main-menu__footer .ml-parent {
      position: relative;
      border-bottom: unset !important;
      margin-bottom: 6px;
    }

    .main-menu__footer .ml-parent::after {
      position: absolute;
      bottom: 0;
      left: 50%;
      content: '';
      height: 1px;
      width: 60%;
      background: #eee;
      transform: translateX(-50%);
    }

    #ml-products-close {
      display: none;
      pointer-events: none;
    }

  }

  @media(max-width:480px) {
    /* Antes top:96px fijo (altura antigua del header). Ahora la variable dinámica,
       relativa al containing block de .header-top (ver setHeaderOffset en menu_header.tpl). */
    .ml-nav.is-open {
      top: var(--ml-header-bottom, 0px);
    }

    .ml-nav.is-open .ml-overlay.is-visible {
      top: var(--ml-header-bottom, 0px);
    }
  }

  body.main_menu_open {
    overflow: hidden !important;
  }

  html {
    width: unset !important;
    max-width: unset !important;
    overflow-x: unset !important;
  }

/* 23/11/2026: banners del buscador en el menú móvil (los copia menu_header.tpl), carrusel horizontal como en el buscador */
.ml-menubn { margin: 2rem 0 0; }
.ml-menubn .ds-empty__banners { display: flex; gap: 8px; margin: 0; padding: 0 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
.ml-menubn .ds-empty__banners::-webkit-scrollbar { display: none; }
.ml-menubn .ds-empty__banner { position: relative; display: block; flex: 0 0 78%; height: 110px; overflow: hidden; margin: 0; padding: 0 !important; border-radius: 12px; background: #1a2332; scroll-snap-align: start; }
.ml-menubn .ds-empty__banner img { width: 100% !important; height: 100%; max-width: none; max-height: none; margin: 0 !important; object-fit: cover; object-position: 70% 50%; border-radius: 0; }
.ml-menubn .ds-empty__banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 18, 28, .78) 0%, rgba(12, 18, 28, .35) 45%, rgba(12, 18, 28, 0) 75%); }
.ml-menubn .ds-empty__banner-cap { position: absolute; left: 14px; bottom: 12px; z-index: 1; max-width: 60%; color: #fff; font-size: 17px; font-weight: 400; line-height: 1.2; }
.ml-menubn .ds-empty__banner-cap::after { content: " →"; color: #ffdd00; }
.ml-menubn:not([hidden]) + script + .main-menu__footer { margin-top: 1.5rem !important; }
@media (min-width: 768px) { .ml-menubn { display: none !important; } }
