/**
 * ogmegamenu.css — estilos del megamenú (horizontal y vertical).
 */

.ogmegamenu {
  --ogmm-bg: #ffffff;
  --ogmm-fg: #1a1a1a;
  --ogmm-muted: #6b7280;
  --ogmm-accent: #d32f2f;
  --ogmm-accent-badge: var(--ogmm-accent);
  --ogmm-border: #e5e7eb;
  --ogmm-panel-bg: var(--ogmm-bg);
  --ogmm-panel-fg: var(--ogmm-fg);
  --ogmm-panel-shadow: 0 12px 32px rgba(0, 0, 0, .12);
  --ogmm-radius: 6px;
  --ogmm-gap: 24px;

  position: relative;
  background: var(--ogmm-bg);
  color: var(--ogmm-fg);
  font-size: 15px;
}

.ogmegamenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ogmegamenu a {
  color: inherit;
  text-decoration: none;
}

/* ── Contenedor de ítems ──────────────────────────────────────────────── */

.ogmegamenu-bar {
  width: 100%;
}

.ogmegamenu-bar--container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0px;
}

.ogmegamenu--contained {
  max-width: 1295px;
  margin: 0 auto;
  border-radius: var(--ogmm-radius);
}

/* ── Raíces ───────────────────────────────────────────────────────────── */

.ogmegamenu-roots {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.ogmegamenu--vertical .ogmegamenu-roots {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--ogmm-border);
  border-radius: var(--ogmm-radius);
}

.ogmegamenu-root {
  position: relative;
}

.ogmegamenu--horizontal .ogmegamenu-root--full-panel {
  position: static;
}

.ogmegamenu--vertical .ogmegamenu-root + .ogmegamenu-root {
  border-top: 1px solid var(--ogmm-border);
}

.ogmegamenu-root-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-weight: var(--ogmm-fw-items, 600);
  font-size: var(--ogmm-fs-items, inherit);
  line-height: 1.2;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}

.ogmegamenu-root-link--button {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: left;
}

.ogmegamenu--vertical .ogmegamenu-root-link--button {
  width: 100%;
}

.ogmegamenu-root-link:hover,
.ogmegamenu-root-link:focus-visible,
.ogmegamenu-root--current > .ogmegamenu-root-link {
  color: var(--ogmm-item-hover, var(--ogmm-accent))!important;
  filter: brightness(.9)!important;
}

.ogmegamenu-root-link[style*="background"]:hover,
.ogmegamenu-root-link[style*="background"]:focus-visible {
  filter: brightness(.85)!important;
}

/* ── Hover per-entry ── */
.ogmegamenu-link:hover,
.ogmegamenu a.ogmegamenu-link:hover,
.ogmegamenu-link-item--current > .ogmegamenu-link {
  color: var(--ogmm-entry-hover, var(--ogmm-accent))!important;
}

.ogmegamenu-root-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ogmegamenu-badge {
  background: var(--ogmm-accent-badge);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
}

.ogmegamenu-caret {
  margin-left: auto;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
}

/* ── Panel desplegable ────────────────────────────────────────────────── */

.ogmegamenu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 400;
  min-width: 280px;
  background: var(--ogmm-panel-bg);
  color: var(--ogmm-panel-fg);
  border: 1px solid var(--ogmm-border);
  border-radius: var(--ogmm-radius);
  box-shadow: var(--ogmm-panel-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  width: max-content;
}

.ogmegamenu--vertical .ogmegamenu-panel {
  top: 0;
  left: 100%;
  min-height: 100%;
  transform: translateX(6px);
}

.ogmegamenu-panel--full {
  left: 0;
  right: 0;
  width: 100%;
}

.ogmegamenu-root--open > .ogmegamenu-panel,
.ogmegamenu-root:hover > .ogmegamenu-panel,
.ogmegamenu-root:focus-within > .ogmegamenu-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.ogmegamenu-panel-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  padding: 24px 12px;
}

.ogmegamenu-sidebar-pane .ogmegamenu-panel-inner {
  flex-wrap: wrap;
}

/* ── Columnas ─────────────────────────────────────────────────────────── */

.ogmegamenu-column {
  flex: 0 0 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 12px;
}

.ogmegamenu-col-1  { width: 8.333%; }
.ogmegamenu-col-2  { width: 16.666%; }
.ogmegamenu-col-3  { width: 25%; }
.ogmegamenu-col-4  { width: 33.333%; }
.ogmegamenu-col-5  { width: 41.666%; }
.ogmegamenu-col-6  { width: 50%; }
.ogmegamenu-col-7  { width: 58.333%; }
.ogmegamenu-col-8  { width: 66.666%; }
.ogmegamenu-col-9  { width: 75%; }
.ogmegamenu-col-10 { width: 83.333%; }
.ogmegamenu-col-11 { width: 91.666%; }
.ogmegamenu-col-12 { width: 100%; }

.ogmegamenu-col-auto {
  flex: 1 1 0;
  min-width: 0;
}

/*
 * Columnas del árbol automático: cada categoría de primer nivel es una
 * columna completa. Al superar la cantidad configurada, flex-wrap crea una
 * nueva fila y su posición vertical queda determinada por la columna más
 * alta de la fila anterior.
 */
.ogmegamenu-column--auto-category {
  flex: 0 0 calc(100% / var(--ogmm-auto-columns, 1));
  width: calc(100% / var(--ogmm-auto-columns, 1));
  max-width: calc(100% / var(--ogmm-auto-columns, 1));
}

.ogmegamenu-column-title,
.ogmegamenu a.ogmegamenu-column-title {
  display: block;
  font-weight: var(--ogmm-fw-title, 700);
  font-size: var(--ogmm-fs-title, 13px);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ogmm-title-color, var(--ogmm-fg));
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--ogmm-border);
}

/* Nivel 1 del submenú: títulos/entradas directas, sean <a> o <span>. */
.ogmegamenu .ogmegamenu-column-title,
.ogmegamenu a.ogmegamenu-column-title {
  color: var(--ogmm-title-color, var(--ogmm-fg));
}

.ogmegamenu .ogmegamenu-column-title:hover,
.ogmegamenu a.ogmegamenu-column-title:hover {
  color: var(--ogmm-title-hover, var(--ogmm-accent)) !important;
}


/* ── Enlaces ──────────────────────────────────────────────────────────── */

.ogmegamenu-links,
.ogmegamenu-sublinks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ogmegamenu-link,
.ogmegamenu a.ogmegamenu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: var(--ogmm-fs-link, 14px);
  font-weight: var(--ogmm-fw-link, 400);
  color: var(--ogmm-link-color, var(--ogmm-muted));
  text-decoration: none;
  transition: color .15s ease;
}

/* Nivel 2: hijos del título de nivel 1. */
.ogmegamenu .ogmegamenu-sublinks .ogmegamenu-sublink {
  color: var(--ogmm-link-color, var(--ogmm-muted));
  transition: color .15s ease;
}

.ogmegamenu .ogmegamenu-sublinks .ogmegamenu-sublink:hover,
.ogmegamenu .ogmegamenu-sublinks .ogmegamenu-sublink:focus-visible {
  color: var(--ogmm-link-hover, var(--ogmm-accent)) !important;
}

/* Árbol automático: los enlaces dentro de cada categoría son nivel 2
 * aunque se rendericen directamente como .ogmegamenu-link. No deben usar
 * el hover general del ítem; deben usar la configuración de Hover nivel 2. */
.ogmegamenu .ogmegamenu-column--auto-category .ogmegamenu-link,
.ogmegamenu .ogmegamenu-column--auto-category a.ogmegamenu-link {
  color: var(--ogmm-link-color, var(--ogmm-muted));
}

.ogmegamenu .ogmegamenu-column--auto-category .ogmegamenu-link:hover,
.ogmegamenu .ogmegamenu-column--auto-category .ogmegamenu-link:focus-visible,
.ogmegamenu .ogmegamenu-column--auto-category .ogmegamenu-link-item--current > .ogmegamenu-link {
  color: var(--ogmm-link-hover, var(--ogmm-accent)) !important;
}

.ogmegamenu-link-item--highlight > .ogmegamenu-link {
  font-weight: 700;
  color: var(--ogmm-fg);
}

.ogmegamenu-link--see-all {
  font-weight: 600;
  color: var(--ogmm-accent) !important;
  font-size: var(--ogmm-fs-link, 13px);
}

.ogmegamenu-link--see-all:hover {
  text-decoration: underline !important;
}

.ogmegamenu-link-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.ogmegamenu-sublinks {
  padding-left: 12px;
  border-left: 1px solid var(--ogmm-border);
  margin: 2px 0 6px;
}

.ogmegamenu-sublink {
  display: block;
  padding: 3px 0;
  font-size: 14px;
  color: var(--ogmm-muted);
}



/* ── Productos destacados ─────────────────────────────────────────────── */

.ogmegamenu-products {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ogmegamenu-product {
  flex: 1 1 120px;
  max-width: 160px;
  display: block;
}

.ogmegamenu-product-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 6px;
}

.ogmegamenu-product-name {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ogmm-fg);
}

.ogmegamenu-product-price {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ogmm-accent);
  margin-top: 2px;
}

/* ── Imagen y HTML ────────────────────────────────────────────────────── */

.ogmegamenu-image img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.ogmegamenu-html {
  font-size: 14px;
  color: var(--ogmm-muted);
  line-height: 1.5;
}

/* ── Botón mobile ─────────────────────────────────────────────────────── */

.ogmegamenu-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 12px 16px;
}

.ogmegamenu-toggle-bar,
.ogmegamenu-toggle-bar::before,
.ogmegamenu-toggle-bar::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ogmm-mobile-toggle, currentColor);
  position: relative;
}

.ogmegamenu-toggle-bar::before,
.ogmegamenu-toggle-bar::after {
  content: '';
  position: absolute;
}

.ogmegamenu-toggle-bar::before { top: -7px; }
.ogmegamenu-toggle-bar::after  { top: 7px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Overlay mobile ───────────────────────────────────────────────────── */

.ogmegamenu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 5999;
}

.ogmegamenu-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ── Mobile panel ─────────────────────────────────────────────────────── */

.ogmegamenu-mobile-panel {
  display: none;
}

body.ogmegamenu-body-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .ogmegamenu-toggle {
    display: block;
  }

  .ogmegamenu--horizontal .ogmegamenu-roots {
    display: none;
  }

  .ogmegamenu-mobile-panel {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: var(--ogmm-bg);
    z-index: 6000;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .ogmegamenu-mobile-panel--open {
    display: flex;
    transform: translateX(0);
  }

  .ogmegamenu-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--ogmm-border);
  }

  .ogmegamenu-mobile-title {
    color: var(--ogmm-panel-fg, var(--ogmm-fg));
    font-size: var(--ogmm-fs-title, 18px);
    font-weight: var(--ogmm-fw-title, 700);
  }

  .ogmegamenu-mobile-header--no-title {
    justify-content: flex-end;
  }

  .ogmegamenu-mobile-close {
    background: none;
    border: 0;
    padding: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
  }

  .ogmegamenu-mobile-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 100px;
  }

  .ogmegamenu-mobile-item {
    border-bottom: 1px solid var(--ogmm-border);
  }

  .ogmegamenu-mobile-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #efefef;
  }

  .ogmegamenu-mobile-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: var(--ogmm-fs-items, 16px);
    font-weight: var(--ogmm-fw-items, 600);
    color: var(--ogmm-panel-fg, var(--ogmm-fg)) !important;
    text-decoration: none;
  }

  /* Ítem raíz sin URL: se renderiza como button y debe verse igual que el link. */
  button.ogmegamenu-mobile-link {
    background: none;
    border: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
  }

  .ogmegamenu-mobile-link:hover,
  .ogmegamenu-mobile-link:focus {
    color: var(--ogmm-panel-fg, var(--ogmm-fg)) !important;
    text-decoration: none;
  }

  .ogmegamenu-mobile-link .ogmegamenu-root-icon {
    width: 26px;
    height: 26px;
  }

  .ogmegamenu-mobile-toggle {
    flex: 0 0 auto;
    background: none;
    border: 0;
    border-left: 1px solid var(--ogmm-border);
    padding: 14px 16px;
    cursor: pointer;
    color: var(--ogmm-muted);
    transition: transform .2s ease;
    display: flex;
    align-items: center;
  }

  .ogmegamenu-mobile-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
  }

  .ogmegamenu-mobile-item--open > .ogmegamenu-mobile-row > .ogmegamenu-mobile-toggle svg {
    transform: rotate(180deg);
  }

  .ogmegamenu-mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    background: var(--ogmm-panel-bg, #f8f9fa);
    border-top: 1px solid var(--ogmm-border);
  }

  .ogmegamenu-mobile-item--open > .ogmegamenu-mobile-submenu {
    max-height: 3000px;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 12px 24px;
    font-size: var(--ogmm-fs-link, 15px);
    font-weight: var(--ogmm-fw-link, 400);
    color: var(--ogmm-link-color, var(--ogmm-panel-fg, var(--ogmm-fg))) !important;
    text-decoration: none;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-link-item {
    border-bottom: 1px solid #eee;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-link-item:last-child {
    border-bottom: 0;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-link-item + .ogmegamenu-link-item {
    border-top: none;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-column-title {
    padding: 12px 16px 8px 24px;
    margin-bottom: 0;
    border-bottom: 2px solid currentColor;
    font-size: var(--ogmm-fs-title, 13px);
    font-weight: var(--ogmm-fw-title, 700);
    color: var(--ogmm-title-color, var(--ogmm-fg));
  }


  .ogmegamenu-mobile-submenu .ogmegamenu-sublinks {
    margin-left: 28px;
    padding-left: 12px;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-sublink {
    padding: 6px 0;
    font-size: var(--ogmm-fs-link, 14px);
    font-weight: var(--ogmm-fw-link, 400);
    color: var(--ogmm-link-color, var(--ogmm-muted));
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-sublink:hover,
  .ogmegamenu-mobile-submenu .ogmegamenu-sublink:focus-visible {
    color: var(--ogmm-link-hover, var(--ogmm-accent)) !important;
  }

  .ogmegamenu-mobile-submenu .ogmegamenu-link:hover,
  .ogmegamenu-mobile-submenu .ogmegamenu-link:focus-visible {
    color: var(--ogmm-link-hover, var(--ogmm-accent)) !important;
  }
}

/* ── Highlighted root item (pill) ─────────────────────────────────── */

.ogmegamenu-root--highlight > .ogmegamenu-root-link {
  background: var(--ogmm-accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  margin: 4px 4px;
}

.ogmegamenu-root--highlight > .ogmegamenu-root-link:hover,
.ogmegamenu-root--highlight > .ogmegamenu-root-link:focus-visible {
  filter: brightness(.85) !important;
  color: #fff !important;
}

/* ── Sidebar panel (all_categories desktop) ──────────────────────── */

.ogmegamenu-panel--sidebar {
  min-width: 700px;
}

.ogmegamenu-sidebar-wrap {
  display: flex;
  min-height: 340px;
}

.ogmegamenu-sidebar-nav {
  flex: 0 0 240px;
  border-right: 1px solid var(--ogmm-border);
  padding: 12px 0;
  overflow-y: auto;
  background: #f8f9fa;
}

.ogmegamenu-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ogmm-fg);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
  cursor: pointer;
}

.ogmegamenu-sidebar-item:hover,
.ogmegamenu-sidebar-item--active {
  background: rgba(176, 20, 87, 0.05);

}

.ogmegamenu-sidebar-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: .4;
}

.ogmegamenu-sidebar-item--active .ogmegamenu-sidebar-chevron,
.ogmegamenu-sidebar-item:hover .ogmegamenu-sidebar-chevron {
  opacity: 1;
}

.ogmegamenu-sidebar-content {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}

.ogmegamenu-sidebar-pane {
  display: none;
  padding: 0;
}

.ogmegamenu-sidebar-pane--active {
  display: block;
}

.ogmegamenu-sidebar-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 0;
  border-bottom: 1px solid var(--ogmm-border);
  margin-bottom: 0;
}

.ogmegamenu-sidebar-pane-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ogmm-fg);
  padding-bottom: 12px;
}

.ogmegamenu-sidebar-pane .ogmegamenu-panel-inner {
  padding: 20px 12px;
}

.ogmegamenu-sidebar-see-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 12px;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0%;
  color: #B01457!important;
  text-decoration: none;
  white-space: nowrap;
}

.ogmegamenu-sidebar-see-all:hover {
  text-decoration: underline;
}

/* ── Mobile drill-down ───────────────────────────────────────────── */

@media (max-width: 991px) {
  .ogmegamenu-mobile-item--drilldown .ogmegamenu-mobile-toggle svg {
    transition: none;
  }

  .ogmegamenu-drill-view {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ogmm-bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 10;
    animation: ogmm-drill-in .25s ease forwards;
  }

  .ogmegamenu-drill-view--active {
    display: block;
  }

  @keyframes ogmm-drill-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }

  .ogmegamenu-drill-back {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--ogmm-border);
    font-size: 16px;
    font-weight: 700;
    color: var(--ogmm-fg);
    cursor: pointer;
  }

  .ogmegamenu-drill-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #efefef;
  }

  .ogmegamenu-drill-row .ogmegamenu-mobile-link {
    flex: 1 1 auto;
  }

  .ogmegamenu-drill-row .ogmegamenu-mobile-toggle {
    border-left: 1px solid var(--ogmm-border);
  }

  .ogmegamenu-drill-view .ogmegamenu-column-title {
    padding: 12px 16px 8px;
    margin-bottom: 0;
    border-bottom: 2px solid currentColor;
  }

  .ogmegamenu-drill-view .ogmegamenu-link {
    padding: 12px 16px 12px 24px;
    font-size: 12px;
  }

  .ogmegamenu-drill-view .ogmegamenu-link-item {
    border-bottom: 1px solid #eee;
  }

  .ogmegamenu-drill-view .ogmegamenu-link-item:last-child {
    border-bottom: 0;
  }
}

/* ── Hamburguesa en el header (displayTop) ──────────────────────────── */
.ogmegamenu-header-toggle {
  order: -1;
  width: auto;
}
