/* ============================================= */
/* MISATO MENU - OPTIMIZED CSS v2.1              */
/* ============================================= */

:root {
    --transition-duration: 0.3s;
    --transition-easing: cubic-bezier(0.19, 1, 0.22, 1);
    --menu-speed: 600ms;
}

/* ============================================= */
/* RESET & CLEANUP */
/* ============================================= */

.elementor-widget-menudesplegable-misato,
.elementor-widget-menudesplegable-misato .elementor-widget-container {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
}

.misato-menu-wrapper,
.misato-menu-wrapper *,
.menu-toggle-button,
.menu-toggle-container {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.menu-toggle-button:focus,
.menu-toggle-button:focus-visible,
.menu-toggle-container:focus {
    outline: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* ============================================= */
/* WRAPPER & CONTAINER */
/* ============================================= */

.misato-menu-wrapper {
    position: relative;
    z-index: 999;
    display: inline-block;
}

.menu-toggle-container {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    z-index: 10001 !important;
    background: transparent !important;
}

/* ============================================= */
/* BUTTON */
/* ============================================= */

.menu-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    transition: transform 0.2s ease;
    pointer-events: auto !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.menu-toggle-button:hover {
    transform: scale(0.95);
}

.menu-toggle-icon {
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.menu-toggle-icon svg,
.menu-toggle-icon i {
    color: #fff;
    fill: currentColor;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.menu-toggle-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================= */
/* HAMBURGER ANIMATION */
/* ============================================= */

.burger-lines {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 30% 0;
    box-sizing: border-box;
}

.burger-lines span {
    display: block;
    height: 2px;
    width: 50%;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* FIX #4: Eliminado !important para que el color activo sea controlable desde el panel */
.misato-menu-wrapper.is-active .burger-lines span {
    background-color: #000;
}

.misato-menu-wrapper.is-active .burger-lines span:nth-child(1) {
    transform: translateY(250%) rotate(45deg);
}

.misato-menu-wrapper.is-active .burger-lines span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.misato-menu-wrapper.is-active .burger-lines span:nth-child(3) {
    transform: translateY(-250%) rotate(-45deg);
}

/* ============================================= */
/* ACTIVE ICON */
/* ============================================= */

.misato-icon-active-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    z-index: 5;
}

.misato-menu-wrapper.is-active .misato-icon-active-wrapper {
    opacity: 1;
    transform: scale(1);
}

.misato-menu-wrapper.is-active .misato-icon-normal {
    opacity: 0;
    transform: scale(0.5);
}

/* ============================================= */
/* FULLSCREEN MENU - BASE */
/* ============================================= */

.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;   /* FIX #6: left por defecto, no center */
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #ffe700;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-100%);
    transition: transform var(--menu-speed, 600ms) var(--transition-easing),
                opacity 0.4s var(--transition-easing),
                visibility 0s calc(var(--menu-speed, 600ms));
}

.fullscreen-menu.is-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    transform: translateY(0) !important;
    transition: transform var(--menu-speed, 600ms) var(--transition-easing),
                opacity 0.4s var(--transition-easing),
                visibility 0s;
}

/* ============================================= */
/* FIX #6: ALINEACIÓN DEL MENÚ */
/* ============================================= */

/* Izquierda (default) */
.misato-align-left .fullscreen-menu {
    align-items: flex-start;
}
.misato-align-left .main-nav-container {
    padding-left: max(5vw, 40px);
    padding-right: 40px;
}

/* Centro */
.misato-align-center .fullscreen-menu {
    align-items: center;
}
.misato-align-center .main-nav-container {
    padding-left: 40px;
    padding-right: 40px;
}
.misato-align-center .main-nav a {
    text-align: center;
    width: 100%;
    display: block;
}

/* Derecha */
.misato-align-right .fullscreen-menu {
    align-items: flex-end;
}
.misato-align-right .main-nav-container {
    padding-right: max(5vw, 40px);
    padding-left: 40px;
}
.misato-align-right .main-nav a {
    text-align: right;
    width: 100%;
    display: block;
}

/* ============================================= */
/* NOISE EFFECT */
/* ============================================= */

.misato-noise-yes .fullscreen-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAG0lEQVQIW2NkgABGMf//jKqB6gEGEZ8F8gUABjUFB/L/lqkAAAAASUVORK5CYII=");
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

/* ============================================= */
/* SIDEBAR LAYOUT */
/* ============================================= */

.misato-menu-type-sidebar .fullscreen-menu {
    width: 30vw;
    left: auto;
    right: 0;
    transform: translateX(100%);
    justify-content: flex-start;
    padding-top: 80px;
    align-items: flex-start;
}

.misato-menu-type-sidebar .fullscreen-menu.is-active {
    transform: translateX(0) !important;
}

.misato-sidebar-left.misato-menu-type-sidebar .fullscreen-menu {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

.misato-sidebar-left.misato-menu-type-sidebar .fullscreen-menu.is-active {
    transform: translateX(0) !important;
}

/* En sidebar, padding generoso a la izquierda para que el indicador no quede pegado al borde */
.misato-menu-type-sidebar .main-nav-container {
    padding-left: 25px !important;
    padding-right: 25px;
}

/* Social icons en sidebar: siempre alineados a la izquierda */
.misato-menu-type-sidebar .social-icons {
    justify-content: center;
    padding-left: 0;
    width: 100%;
}

/* ============================================= */
/* RESPONSIVE - TABLET */
/* ============================================= */

@media (max-width: 1024px) {
    .misato-menu-type-sidebar .fullscreen-menu {
        width: 50vw;
    }
}

/* ============================================= */
/* RESPONSIVE - MOBILE */
/* ============================================= */

@media (max-width: 768px) {
    .misato-menu-type-sidebar .fullscreen-menu {
        width: 85vw;
    }

    .fullscreen-menu {
        justify-content: flex-start;
        padding-top: 80px;
    }

    .main-nav-container {
        padding-top: 0;
    }

    .misato-align-left .main-nav-container,
    .misato-align-right .main-nav-container {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .fullscreen-menu {
        padding-top: 70px;
    }

    .main-nav li {
        margin: 12px 0 !important;
        padding-bottom: 10px !important;
    }
}

/* ============================================= */
/* MENU STRUCTURE */
/* ============================================= */

.main-nav-container {
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
}

.main-nav {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 50px 0 !important;
    width: 100%;
}

.main-nav li {
    margin: 18px 0 !important;
    padding-bottom: 18px !important;
    position: relative;
    max-width: 100%;
}

.main-nav a {
    text-decoration: none !important;
    text-transform: uppercase;
    display: inline-block;
    font-weight: bold;
    font-size: 2.5rem;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    color: #000;
    position: relative;
    /* FIX #5: transición para el desplazamiento en hover */
    transition: transform 0.35s var(--transition-easing), color 0.3s ease;
}

/* ============================================= */
/* FIX #3: SEPARADORES */

.misato-show-separator .main-nav > li {
    position: relative;
}

.misato-show-separator .main-nav > li::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80%;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    border-bottom-color: #000;
}

.misato-show-separator .main-nav > li:last-child::after {
    display: none;
}

/* Alineación del separador */
.misato-sep-left .misato-show-separator .main-nav > li::after {
    left: 0;
    right: auto;
    transform: none;
}

.misato-sep-center .misato-show-separator .main-nav > li::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.misato-sep-right .misato-show-separator .main-nav > li::after {
    left: auto;
    right: 0;
    transform: none;
}

/* ============================================= */
/* FIX #5: POINTER / INDICADOR DE HOVER         */
/* Indicador en li::before (fijo), texto se      */
/* desplaza siempre hacia la derecha             */
/* ============================================= */

/* Base del indicador - invisible por defecto */
.misato-show-pointer .main-nav > li {
    position: relative;
    overflow: visible;
}

.misato-show-pointer .main-nav > li::before {
    content: "";
    position: absolute;
    top: 50%;
    /* Siempre a la izquierda del texto, incluyendo sidebar */
    left: -28px;
    transform: translateY(-50%) scale(0);
    background-color: #000;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s var(--transition-easing);
    pointer-events: none;
}

/* CÍRCULO */
.misato-show-pointer.misato-pointer-circle .main-nav > li::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* CUADRADO */
.misato-show-pointer.misato-pointer-square .main-nav > li::before {
    width: 10px;
    height: 10px;
    border-radius: 0;
}

/* FIX #5: LÍNEA - dimensiones correctas para línea vertical */
.misato-show-pointer.misato-pointer-line .main-nav > li::before {
    width: 3px;
    height: 32px;
    border-radius: 2px;
    left: -18px;
}

/* Mostrar indicador en hover */
.misato-show-pointer .main-nav > li:hover::before {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* FIX: Texto siempre se desplaza a la DERECHA en hover (todos los tipos de menú) */
.misato-show-pointer .main-nav > li:hover > a {
    transform: translateX(20px);
}

/* ============================================= */
/* SUBMENU */
/* ============================================= */

.main-nav ul {
    list-style: none !important;
    padding: 8px 0 0 0 !important;
    margin: 0 !important;
    opacity: 0.75;
}

.main-nav ul li {
    margin: 6px 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.9em;
}

.main-nav ul li::after {
    display: none !important; /* Sin separadores en subítems */
}

/* ============================================= */
/* SOCIAL ICONS */
/* ============================================= */

.social-icons {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
    /* Sin justify-content aquí - lo controlan las clases de alineación */
    justify-content: flex-start;
}

/* Alineación social sigue al menú en modo fullscreen */
.misato-menu-type-fullscreen.misato-align-left .social-icons {
    justify-content: flex-start;
}

.misato-menu-type-fullscreen.misato-align-center .social-icons {
    justify-content: center;
}

.misato-menu-type-fullscreen.misato-align-right .social-icons {
    justify-content: flex-end;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    color: #000;
}

.social-icons a:hover {
    transform: scale(1.12);
    background: rgba(255, 255, 255, 0.35);
}

.social-icons a svg {
    fill: currentColor;
    width: 50%;
    height: 50%;
}

/* ============================================= */
/* BODY STATE */
/* ============================================= */

body.misato-menu-open {
    overflow: hidden !important;
}

/* ============================================= */
/* PRINT & ACCESSIBILITY */
/* ============================================= */

@media print {
    .misato-menu-wrapper,
    .fullscreen-menu {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fullscreen-menu,
    .menu-toggle-button,
    .main-nav a,
    .social-icons a,
    .main-nav > li::before {
        transition: none !important;
    }
}
