/*
 * Menú del sitio (widget site-menu): enlaces, cuenta, botón de la evaluación y menú lateral.
 * Va dentro del encabezado de Elementor (Theme Builder), en un elemento vacío con la clase ftv-widget-site-menu.
 *
 *  - Escritorio (> 1024 px): enlaces, "Iniciar sesión" / "Mi cuenta" en texto y el botón.
 *  - Tablet (768–1024 px): botón, icono de cuenta y hamburguesa; el panel lleva los 4 enlaces.
 *  - Teléfono (≤ 767 px): solo la hamburguesa; el panel lleva los enlaces, la cuenta y el botón, en texto.
 * Puntos de corte: los de Elementor por defecto (tablet 1024, móvil 767).
 *
 * Colores de las variables globales V4 del kit (con respaldo). Para un ajuste solo aquí, redefinir --ftvh-* en el
 * elemento ftv-widget-site-menu.
 */
.ftv-widget-site-menu {
    --ftvh-accent: var(--accent, #9BD34F);
    --ftvh-accent-ink: var(--button-black, #141414);
    --ftvh-text: var(--white, #FFFFFF);
    --ftvh-muted: var(--grey_text, #999999);
    --ftvh-panel: var(--black, #000000);
    --ftvh-line: #ffffff1f;
    --ftvh-font: var(--MainFont, "Poppins");
    --ftvh-gap: clamp(24px, 3.2vw, 72px);
    flex: 1 1 auto;
    min-width: 0;
}

/* El encabezado de Theme Builder queda fijo arriba (debajo de la barra de administración si está). */
.elementor-location-header:has(.ftv-widget-site-menu) {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0px);
    z-index: 900;
}

.ftvh, .ftvh * , .ftvh *::before, .ftvh *::after { box-sizing: border-box; }
.ftvh {
    color: var(--ftvh-text);
    font-family: var(--ftvh-font), "Poppins", sans-serif;
    font-size: 18px;
    line-height: 1.3;
}
.ftvh ul { margin: 0; padding: 0; list-style: none; }
.ftvh a { color: inherit; text-decoration: none; }
.ftvh a:focus-visible, .ftvh button:focus-visible { outline: 2px solid var(--ftvh-accent); outline-offset: 3px; }
/* El tema (Hello Elementor) pinta los botones de rosa: se anula y cada botón define su estilo. */
.ftvh button, .ftvh button:hover, .ftvh button:focus, .ftvh button:active {
    margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    color: inherit; font: inherit; line-height: 1; text-transform: none; cursor: pointer;
}

/* ---------- Barra ---------- */
.ftvh-bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--ftvh-gap); }
.ftvh-links { display: flex; align-items: center; gap: var(--ftvh-gap); }
.ftvh-link { white-space: nowrap; transition: color .15s ease; }
.ftvh-link:hover, .ftvh-link[aria-current="page"] { color: var(--ftvh-accent); }

.ftvh-account { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: color .15s ease; }
.ftvh-account:hover { color: var(--ftvh-accent); }
.ftvh-account__icon { display: none; width: 26px; height: 26px; flex: none; }
.ftvh-account__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.ftvh-cta {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 28px; border-radius: 999px;
    background: var(--ftvh-accent); color: var(--ftvh-accent-ink) !important;
    white-space: nowrap; transition: background-color .15s ease;
}
.ftvh-cta:hover { background: color-mix(in srgb, var(--ftvh-accent) 88%, #000000); }

.ftvh-burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--ftvh-text) !important; }
.ftvh-burger svg, .ftvh-close svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Panel lateral ---------- */
.ftvh-backdrop {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(0, 0, 0, .55);
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s;
}
.ftvh-panel {
    /* debajo de la barra de administración de WordPress (si está) */
    position: fixed; top: var(--wp-admin--admin-bar--height, 0px); right: 0; bottom: 0; z-index: 9999;
    display: flex; flex-direction: column; gap: 28px;
    width: min(360px, 86vw);
    padding: 20px 28px calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--ftvh-panel); color: var(--ftvh-text);
    border-left: 1px solid var(--ftvh-line);
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
}
.ftvh.is-open .ftvh-backdrop { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.ftvh.is-open .ftvh-panel { transform: none; visibility: visible; transition: transform .3s ease; }
.ftvh-panel__top { display: flex; justify-content: flex-end; }
.ftvh-close { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; margin-right: -10px; color: var(--ftvh-text) !important; }
.ftvh-panel__links { display: grid; }
.ftvh-panel__links .ftvh-link { display: block; padding: 14px 0; border-bottom: 1px solid var(--ftvh-line); font-size: 22px; font-weight: 500; }
.ftvh-panel__extra { display: none; flex-direction: column; gap: 16px; margin-top: auto; }
.ftvh-panel__extra .ftvh-account { justify-content: center; min-height: 48px; border: 1px solid var(--ftvh-line); border-radius: 999px; font-size: 17px; }
.ftvh-panel__extra .ftvh-cta { min-height: 52px; font-size: 17px; }
html.ftvh-lock, html.ftvh-lock body { overflow: hidden; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
    .ftvh-bar { gap: 18px; }
    .ftvh-bar .ftvh-links { display: none; }
    .ftvh-burger { display: inline-flex; }
    .ftvh-bar .ftvh-account__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ftvh-bar .ftvh-account__icon { display: block; }
    .ftvh-bar .ftvh-cta { order: 1; min-height: 40px; padding: 0 20px; font-size: 16px; }
    .ftvh-bar .ftvh-account { order: 2; }
    .ftvh-bar .ftvh-burger { order: 3; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 767px) {
    .ftvh-bar .ftvh-account, .ftvh-bar .ftvh-cta { display: none; }
    .ftvh-panel__extra { display: flex; }
}

/* Escritorio: el panel no existe aunque se haya quedado abierto al ensanchar la ventana */
@media (min-width: 1025px) {
    .ftvh-panel, .ftvh-backdrop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ftvh-panel, .ftvh-backdrop { transition: none; }
}
