/* ==== Activador ==== */
  .nasty-compact-nav { position: relative; display: none; }
  .nasty-compact-trigger {
    display: inline-flex; align-items: center; gap: 0.5em;
    background: transparent; border: 1.5px solid #e8c46a; color: #e8c46a;
    font-weight: 600; font-size: 0.9rem; padding: 0.5em 1em; border-radius: 999px;
    cursor: pointer; transition: background 0.2s ease; white-space: nowrap;
  }
  .nasty-compact-trigger:hover { background: rgba(232, 196, 106, 0.12); }
  .nasty-compact-trigger svg { width: 1em; height: 1em; transition: transform 0.25s ease; }
  .nasty-compact-nav.is-open .nasty-compact-trigger svg { transform: rotate(180deg); }

/* ==== PANEL ==== */

    .nasty-compact-panel-mask {
	position: absolute;
  padding-top: 22px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, width 0.25s ease;
}

.nasty-compact-panel-mask:before {
    content: "";
    position: absolute;
    left: 40px;
    top: 10px;
    width: 12px;
    height: 12px;
    background-color: #1c2410;
    border-top: 1px solid rgba(232, 196, 106, 0.25);
    border-left: 1px solid rgba(232, 196, 106, 0.25);
    transform: translateY(50%) rotate(45deg);
    z-index: 999;
}

.nasty-compact-nav.is-open .nasty-compact-panel-mask {
  opacity: 1 !important;
  transform: translateY(0px) !important;
}

  .nasty-compact-panel {
    position: relative;
    top: calc(100% + 22px);
    left: 0;
    background: #1c2410;
    border: 1px solid rgba(232, 196, 106, 0.25);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, width 0.25s ease;
    z-index: 50;
    width: 230px;
  }
  .nasty-compact-nav.is-open .nasty-compact-panel { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nasty-compact-panel.has-active-submenu { width: 500px; }
  .nasty-compact-panel.has-active-subsubmenu { width: 770px; }

  .nasty-compact-panel::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 0;
    width: 100%;
    height: 22px;
  }

/* ===== MENÚ ===== */
  ul.nasty-compact-links {
    list-style: none;
    margin: 0;
    padding: 0.5em;
    width: 230px;
  }
  
 .nasty-compact-panel ul.nasty-compact-links:after {
	content: "";
    position: absolute;
    bottom: calc(100% + 0px);
    left: 40px;
    width: 12px;
    height: 12px;
    background-color: #1c2410;
    border-top: 1px solid rgba(232, 196, 106, 0.25);
    border-left: 1px solid rgba(232, 196, 106, 0.25);
    transform: translateY(50%) rotate(45deg);
    z-index: 1;
}

  .nasty-compact-links li.menu-item { position: static; list-style: none; }

  /* Fila del item: el link ocupa el espacio disponible, la flecha es un botón aparte */
  .nasty-compact-links li.menu-item-has-children {
    display: flex;
    align-items: stretch;
  }

  .nasty-compact-links li.menu-item > a {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    color: #f2ead6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.7em 0.8em;
    border-left: 3px solid transparent;
    border-radius: 6px 0 0 6px;
  }
  .nasty-compact-links li.menu-item:not(.menu-item-has-children) > a { border-radius: 6px; }
  .nasty-compact-links li.menu-item > a:hover { background: rgba(232, 196, 106, 0.08); }

  /* Botón de flecha: SEPARADO del link, es su propio elemento clicable
     (esto es lo que resuelve el problema en tablets: tocar el texto navega,
     tocar la flecha abre el submenú) */
  .nasty-compact-arrow {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.4em;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    color: #f2ead6;
  }
  .nasty-compact-arrow:hover { background: rgba(232, 196, 106, 0.12); }
  .nasty-compact-arrow::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
  }

  .nasty-compact-links li.menu-item-has-children.is-active > a,
  .nasty-compact-links li.menu-item-has-children.is-active > .nasty-compact-arrow {
    border-left-color: #e8c46a;
    background: rgba(232, 196, 106, 0.1);
    color: #e8c46a;
  }
  .nasty-compact-links li.menu-item-has-children.is-active > .nasty-compact-arrow::after {
    transform: rotate(45deg);
  }

  /* Submenús: TODOS anclados al panel completo (position: static en los li
     padres es lo que garantiza esto — nunca a un ancestro intermedio) */
  .nasty-compact-links .sub-menu {
    display: none;
    flex-direction: column;
    list-style: none;
    margin: 0;
    width: 270px;
    box-sizing: border-box;
    padding: 0.9em 1em;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: #16200c;
    position: absolute;
    top: 0;
    height: 100%;
  }
  .nasty-compact-links > li.menu-item-has-children > .sub-menu { left: 230px; }
  .nasty-compact-links .sub-menu .sub-menu { left: 270px; background: #101a08; }

  .nasty-compact-links li.menu-item-has-children.is-active > .sub-menu { display: flex; }

  .sub-menu li.menu-item { position: static; }

  .nasty-compact-submenu-title {
    color: #e8c46a;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3em 0.3em 0.7em;
    margin-bottom: 0.3em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sub-menu li.menu-item > a {
    color: #f2ead6;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5em 0.3em;
    border-radius: 6px;
    display: flex;
    flex: 1;
    align-items: center;
  }
  .sub-menu li.menu-item > a:hover { background: rgba(232, 196, 106, 0.08); color: #e8c46a; }
  .sub-menu li.menu-item-has-children.is-active > a,
  .sub-menu li.menu-item-has-children.is-active > .nasty-compact-arrow { color: #e8c46a; }
  .sub-menu .nasty-compact-arrow { width: 2em; }
  .sub-menu .nasty-compact-arrow::after { width: 6px; height: 6px; }

  /* ============ VISIBILIDAD POR RANGO ============ */

	@media (max-width: 1220px) {
	#ast-desktop-header .site-primary-header-wrap #primary-site-navigation-desktop {
		display: none;
	}
}

  @media (max-width: 1220px) and (min-width: 922px) {
    .nasty-compact-nav { display: block; }
}