/* Barra superior (categorías raíz) */
.auf-tabsbar {
  background: #111;
  width: 100%;
  padding-top: 10px;
  padding-bottom: 10px;
}
.auf-tabs {
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  list-style: none;
  gap: 28px;
}
.auf-tabs > li > a {
  font-family: 'Montserrat', sans-serif;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  font-weight: 400;
  padding-top: 2px;
  padding-bottom: 2px;
  display: inline-block;
  transition: color .2s ease;
}
.auf-tabs > li > a:hover {
  color: #ccc;
}

/* Estilo de la pestaña activa en la barra superior */
.auf-tabsbar {
  position: relative;
}
.auf-tabsbar .auf-tabs > li {
  position: relative;
  z-index: 0;
}
.auf-tabsbar .auf-tabs > li.is-active > a {
  background: #fff;
  color: #111 !important;
  font-weight: 600;
  border-radius: 4px 4px 0 0;
  padding: 4px 10px;
  position: relative;
  z-index: 1;
}
.auf-tabsbar .auf-tabs > li.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  bottom: -12px;
  background: #fff;
  border-radius: 6px 6px 0 0;
  z-index: 0;
}

/* ===== Barra inferior (subcategorías) ===== */
.auf-subbar {
  background: #fff;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  position: relative;
  z-index: 30;
}
.auf-submenu__list {
  margin: 0 auto;
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 31;
}
.auf-subbar li {
  margin: 0;
  padding: 0;
}
.auf-subbar a {
  font-family: 'Montserrat', sans-serif;
  color: #111;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  font-weight: 500;
  padding-bottom: 4px;
  transition: text-shadow .2s ease;
}
/* Estilo para hover y estado activo de la subcategoría */
.auf-subitem:hover > a {
  text-decoration: underline;
  font-weight: 600;
}

/* ===== MEGAMENU (controlado por JS) ===== */
.auf-subitem {
  position: relative;
}

/* Panel base del megamenú */
.auf-mega {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  pointer-events: none;
  margin-top: 12px;
}

/* Caja interior del panel */
.auf-mega__inner {
  max-width: 1420px;
  padding: 20px 24px 24px;
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  display: inline-block;
}

/* Reglas especiales para menús grandes (.rows-10) */
.auf-mega.rows-10 .auf-mega__inner {
  margin: 0 auto;
  display: block;
  width: 1420px;
}

/* Grid de categorías nietas */
.auf-subbar .auf-mega__grid {
  display: grid !important;
  grid-auto-flow: column;
  grid-template-rows: repeat(5, auto);
  grid-auto-columns: auto;
  column-gap: 32px;
  row-gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
.auf-subbar .auf-mega__grid a {
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 12px;
  font-weight: 500;
  color: #111;
  text-decoration: none;
  line-height: 1.5;
  white-space: nowrap;
}

.auf-subbar .auf-mega__grid a:hover {
  font-weight: 600;
  text-decoration: underline;
}

/* Mostrar panel al hacer hover */
.auf-subitem:hover > .auf-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Definición de filas y responsivo */
.auf-subbar .auf-mega.rows-5 .auf-mega__grid {
  grid-template-rows: repeat(5, auto);
}
.auf-subbar .auf-mega.rows-10 .auf-mega__grid {
  grid-template-rows: repeat(10, auto);
}
@media (max-width: 1200px) {
  .auf-subbar .auf-mega__grid {
    grid-template-rows: repeat(4, auto);
  }
}
@media (max-width: 900px) {
  .auf-subbar .auf-mega__grid {
    grid-template-rows: repeat(3, auto);
  }
}

/* Ocultar barra en responsive si está configurado */
@media (max-width: 921px) {
  .el-barato-hide-mobile {
    display: none !important;
  }
}

/* Puentes invisibles para mejorar el hover */
.auf-mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  background: transparent;
}
.auf-subitem > a {
  position: relative;
}
.auf-subitem > a::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -12px;
  height: 12px;
  background: transparent;
}
