/* ============================================================
   HEY! Menú Móvil — Estilos base
   HEY! World Publicidad · https://heyworld.es
   ============================================================ */

/* ── Wrapper de alineación ───────────────────────────────────── */
/*
 * Usamos display:block + text-align en lugar de flex + justify-content.
 * text-align actúa sobre hijos inline/inline-flex sin importar si estaban
 * ocultos con display:none, lo que evita el bug de alineación en Elementor.
 */
.hey-burger-wrapper {
    display: block;
    width: 100%;
    /* text-align lo inyecta Elementor vía el control responsive de alineación */
}

/* ── Botón hamburguesa ───────────────────────────────────────── */

.hey-burger {
    /* Oculto por defecto; el <style> inline lo activa al breakpoint */
    display: none;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    position: relative;
    z-index: 9999;
}

/* Variante: tres rayas CSS */
.hey-burger--lines {
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 28px;
}

.hey-burger-line {
    display: block;
    width: 28px;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Animación hamburguesa → X */
.hey-burger--lines[aria-expanded="true"] .hey-burger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.hey-burger--lines[aria-expanded="true"] .hey-burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hey-burger--lines[aria-expanded="true"] .hey-burger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Variante: icono Elementor/Font Awesome */
.hey-burger--icon {
    font-size: 28px;
    width: auto;
    height: auto;
}

.hey-burger-icon,
.hey-burger-icon i,
.hey-burger-icon svg {
    display: block;
    line-height: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hey-burger--icon[aria-expanded="true"] .hey-burger-icon {
    transform: rotate(90deg);
    opacity: 0.7;
}

/* ── Overlay / panel del menú ────────────────────────────────── */

.hey-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    overflow-y: auto;

    /* Estado oculto: se usa display:flex siempre para poder animar */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hidden via atributo HTML pero mantenemos display:flex para la animación */
.hey-menu-overlay[hidden] {
    display: flex !important;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Estado abierto (clase añadida por JS) */
.hey-menu-overlay.hey-is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ── Botón cerrar ────────────────────────────────────────────── */

.hey-menu-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    color: #333;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, transform 0.2s;
}

.hey-menu-close:hover {
    opacity: 0.6;
    transform: scale(1.1);
}

.hey-close-icon,
.hey-close-icon svg {
    display: block;
    width: 1em;
    height: 1em;
}

/* ── Nav y lista ─────────────────────────────────────────────── */

.hey-menu-nav {
    width: 100%;
    max-width: 480px;
}

.hey-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
}

.hey-menu-list li {
    width: 100%;
}

.hey-menu-list > li + li {
    border-top: 1px solid #eee;
}

.hey-menu-list a {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    transition: color 0.2s;
}

.hey-menu-list a:hover,
.hey-menu-list .current-menu-item > a {
    color: #888;
}

/* Indicador de sub-menú */
.hey-menu-list .menu-item-has-children > a::after {
    content: " ▾";
    font-size: 0.75em;
    opacity: 0.5;
    display: inline-block;
    transition: transform 0.25s ease;
    vertical-align: middle;
}

.hey-menu-list .menu-item-has-children.hey-parent-open > a::after {
    transform: rotate(180deg);
}

/* ── Sub-menú ────────────────────────────────────────────────── */

.hey-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #f7f7f7;
    display: none;
}

.hey-menu-list .sub-menu.hey-submenu-open {
    display: block;
}

.hey-menu-list .sub-menu a {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    padding: 10px 16px;
}

/* ── Crédito ─────────────────────────────────────────────────── */

.hey-menu-credit {
    margin-top: 32px;
    font-size: 11px;
    opacity: 0.35;
    text-align: center;
}

.hey-menu-credit a {
    color: inherit;
    text-decoration: none;
}

.hey-menu-credit a:hover {
    text-decoration: underline;
}
