/* ============================================
   HEADER - 3 Columnas: Toggle | Logo | Idiomas
   ============================================ */

/* Variables */
:root {
    --chocolate: #4F413B;
}

/* Header Container */
.zem-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: transparent;
    padding: 40px 40px 40px 40px;
    transition: background-color 0.3s ease, padding-bottom 0.3s ease, padding-top 0.3s ease;
}

.zem-header.scrolled {
    background-color: #4F413BE5;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding-bottom: 20px;
    padding-top: 20px;
}

/* Header forzado como scrolled (ej: páginas de Legales) */
body.header-is-scrolled .zem-header {
    position: relative;
    /* Para que deje de ser fixed (fijo) y haga scroll con la página */
    background-color: #4F413BE5;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding-bottom: 20px;
    padding-top: 20px;
}

.zem-header__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: start;
    gap: 20px;
    max-width: 1920px;
    margin: 0 auto;
}

.zem-header.scrolled .zem-header__logo img,
body.header-is-scrolled .zem-header__logo img {
    max-height: 100px;
}

.zem-header__logo svg {
    height: 145px;
    width: auto;
    display: block;
    transition: height 0.3s ease;
}

@media (min-width: 769px) {

    .zem-header.scrolled .zem-header__logo svg,
    body.header-is-scrolled .zem-header__logo svg {
        height: 100px;
    }
}

/* Columna 1: Toggle Button */
.zem-header__col--left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 45px;
}

.menu-toggle {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 10px 20px !important;
    margin: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: none !important;
    height: 100%;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.menu-toggle:focus {
    outline: none;
    box-shadow: none !important;
    background: none !important;
}

.menu-toggle__line {
    display: block;
    width: 35px;
    height: 1px;
    background-color: white;
    transition: all 0.3s ease;
}

.menu-toggle:hover .menu-toggle__line {
    background-color: white;
}

/* Columna 2: Logo */
.zem-header__col--center {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.zem-header__logo {
    display: block;
    transition: opacity 0.3s ease;
}

.zem-header__logo:hover {
    opacity: 0.8;
}

.zem-header__logo img {
    width: 100%;
    height: auto;
    max-height: 145px;
    display: block;
    object-fit: contain;
    transition: max-height 0.3s ease;
}

/* Columna 3: Selector de Idiomas + Right Menu */
.zem-header__col--right {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    gap: 20px;
}

/* Language Selector Dropdown */
.language-selector-dropdown {
    position: relative;
    display: inline-flex;
    flex-direction: column;
}

.language-selector-dropdown__button {
    background: none !important;
    border: none !important;
    padding: 10px 20px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-radius: 0 !important;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: none !important;
    height: 100%;
    width: 100%;
}

.language-selector-dropdown__button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.language-selector-dropdown__current {
    color: white;
    font-family: "Lato", sans-serif;
    font-size: 16px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-selector-dropdown__arrow {
    transition: transform 0.3s ease;
}

.language-selector-dropdown__button.active .language-selector-dropdown__arrow {
    transform: rotate(90deg);
}

.language-selector-dropdown__list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background-color: rgba(79, 65, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    isolation: isolate;
}

.language-selector-dropdown__list::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -1;
}

.language-selector-dropdown__list.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-selector-dropdown__item {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-family: "Lato", sans-serif;
    font-size: 16px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.language-selector-dropdown__item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.language-selector-dropdown__item--active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 500;
}

/* Right Menu */
.right-menu__list {
    display: flex;
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.right-menu__list li {
    margin: 0;
}

.right-menu__list a {
    color: var(--chocolate);
    text-decoration: none;
    font-family: "Lato", sans-serif;
    font-size: 16px;
    font-weight: 300;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: white;
    padding: 10px 30px;
    display: inline-block;
    text-align: center;
    min-width: 140px;
}

.right-menu__list a:hover {
    background-color: #948979;
    color: white;
}

.right-menu__list .current-menu-item>a,
.right-menu__list .current_page_item>a {
    background-color: #948979;
    color: white;
    font-weight: 500;
}

/* ============================================
   MENÚ MÓVIL (se abre en todas las pantallas)
   ============================================ */

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s;
}

.mobile-menu.active {
    visibility: visible;
    opacity: 1;
}

.mobile-menu__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.mobile-menu__content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background-color: rgba(255, 255, 255, 1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    .mobile-menu.active .mobile-menu__content {
        padding-left: 20px;
    }
}



.mobile-menu.active .mobile-menu__content {
    transform: translateX(0);
}

.mobile-menu__header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 45px 40px 10px 25px;
    border-bottom: none;
    min-height: 45px;
}

@media (max-width: 768px) {
    .mobile-menu__header {
        padding-top: 40px;
        padding-left: 30px;
    }
}

.mobile-menu__logo {
    display: none;
}

.mobile-menu__logo img,
.mobile-menu__logo svg {
    width: 100%;
    height: auto;
}

.mobile-menu__close {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 10px 20px !important;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: none !important;
    height: 100%;
    width: 55px;
}

@media (max-width: 768px) {
    .mobile-menu__close {
        padding: 12px !important;
        width: auto;
        justify-content: flex-start;
    }
}

.mobile-menu__close:hover {
    background: rgba(79, 65, 59, 0.1) !important;
    border-radius: 0 !important;
}

.mobile-menu__close:focus {
    outline: none;
    box-shadow: none !important;
    background: none !important;
}

.mobile-menu__close svg {
    width: 14px;
    height: 17px;
}

.mobile-menu__close svg path {
    fill: #4F413B;
}

.mobile-menu__nav {
    flex: 1;
    padding: 0 30px 30px 40px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .mobile-menu__nav {
        padding-left: 40px;
        padding-right: 40px;
    }
}

.mobile-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu__list li {
    margin-bottom: 0;
    width: 100%;
}

.mobile-menu__list a {
    color: #4F413B;
    text-decoration: none;
    font-family: "Lato", sans-serif;
    font-size: 24px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

/* Flechas de navegación para items con submenú */
.mobile-menu__list .menu-item-has-children>a::after {
    content: '';
    width: 11px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg width='11' height='16' viewBox='0 0 11 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.320069 15.3841L9.32007 7.88411L0.320069 0.384109' stroke='%234F413B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-left: 10px;
}

/* Ocultar flecha en items con hijos dentro de nivel 1 */
.mobile-menu__list .sub-menu .menu-item-has-children>a::after {
    display: none;
}

/* Submenús - ocultos por defecto */
.mobile-menu__list .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 10;
}

.mobile-menu__list .sub-menu.active {
    transform: translateX(0);
}

.mobile-menu__list .sub-menu {
    display: flex;
    flex-direction: column;
    padding-left: 25px;
}

.mobile-menu__list .sub-menu li {
    margin-bottom: 0;
    width: 100%;
}

/* Título del submenú */
.mobile-menu__submenu-title {
    color: #4F413B;
    text-decoration: none;
    font-family: "Lato", sans-serif;
    font-size: 24px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px 10px 30px;
    transition: opacity 0.3s ease;
    margin: 0;
}

.mobile-menu__submenu-title a {
    color: inherit;
    text-decoration: none;
    font: inherit;
    letter-spacing: inherit;
    text-transform: uppercase !important;
    margin-bottom: 0 !important;
}

.mobile-menu__list .sub-menu a {
    font-family: "Lato", sans-serif;
    font-size: 20px;
    text-transform: none;
    font-weight: 300;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* ========================================
   EFECTO HOVER EN ENLACES DEL MENÚ MÓVIL
   Para desactivar: comenta todo este bloque
   ======================================== */
.mobile-menu__list a {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu__list a:hover,
.mobile-menu__list a:active {
    opacity: 0.6;
    transform: translateX(5px);
}

.mobile-menu__list .sub-menu a:hover,
.mobile-menu__list .sub-menu a:active {
    opacity: 0.6;
    transform: translateX(8px);
}

/* ======================================== */

.mobile-menu__list .sub-menu>li {
    padding: 0 30px;
}

/* Sub-sub-menú nivel 2: mostrar inline debajo del padre */
.mobile-menu__list .sub-menu .sub-menu {
    display: block !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    padding-left: 10px !important;
    background: none !important;
    box-shadow: none !important;
    overflow-y: visible !important;
}

/* Botón de volver en submenús */
.mobile-menu__back {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 10px 20px !important;
    margin: 40px 0 5px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: none !important;
    min-height: 45px;
    width: 55px;
}

@media (max-width: 768px) {
    .mobile-menu__back {
        margin-top: 20px;
        padding: 10px;
        width: 50px;
        justify-content: flex-start;
        margin-left: 10px;
        padding: 12px !important;
    }
}

.mobile-menu__back:hover {
    background: rgba(79, 65, 59, 0.1) !important;
    border-radius: 0 !important;
}

.mobile-menu__back:focus {
    outline: none;
    box-shadow: none !important;
    background: none !important;
}

.mobile-menu__back svg {
    width: 11px;
    height: 17px;
}

.mobile-menu__footer {
    padding: 30px;
    border-top: none;
}

.mobile-menu__social {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.mobile-menu__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    transition: opacity 0.3s ease;
}

.mobile-menu__social a:hover {
    opacity: 0.7;
}

.mobile-menu__social svg {
    width: 20px;
    height: 20px;
}

.mobile-menu__social svg path {
    fill: #4F413B;
}

/* Prevenir scroll del body cuando el menú está abierto */
body.mobile-menu-open {
    overflow: hidden;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .zem-header {
        padding: 30px 30px 15px 30px;
    }

    .zem-header__wrapper {
        grid-template-columns: 80px 1fr 80px;
    }

    .zem-header__logo {
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .zem-header {
        padding: 15px 20px;
    }

    /* Evitar que el scroll agrande el header en móvil */
    .zem-header.scrolled {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .zem-header__wrapper {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }

    .zem-header__col--left {
        align-items: center;
    }

    .zem-header__col--center {
        justify-content: flex-end;
        padding-right: 10px;
    }

    .zem-header__col--right {
        display: none;
    }

    .zem-header__logo {
        max-width: none;
        margin-left: auto;
    }

    .zem-header__logo img {
        max-height: 60px;
    }

    .zem-header__logo svg {
        height: 80px;
    }

    /* Evitar que el logo se agrande al hacer scroll en móvil */
    .zem-header.scrolled .zem-header__logo img {
        max-height: 60px;
    }



    .right-menu,
    .language-selector-dropdown {
        display: none;
    }

    .mobile-menu__content,
    .mobile-menu__list .sub-menu {
        max-width: 100%;
    }

    .mobile-menu__list .sub-menu {
        padding-left: 20px;
    }

    .mobile-menu__list .sub-menu>li,
    .mobile-menu__submenu-title {
        padding-left: 20px;
    }

    .menu-toggle {
        padding: 10px !important;
    }

    .mobile-menu__list .sub-menu.menu-level-1 {
        padding-left: 20px;
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .zem-header {
        padding: 20px;
    }

    /* Evitar que el scroll agrande el header en pantallas pequeñas */
    .zem-header.scrolled {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .menu-toggle__line {
        width: 30px;
    }

    .zem-header__logo {
        max-width: 100px;
    }
}

/* Elementor Editor */
.elementor-editor-active .zem-header {
    position: relative !important;
}