/* Menú hamburguesa per a mòbil - histo.cat */

/* Botó hamburguesa - ocult per defecte */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10000;
    background-color: #D60100;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    width: 45px;
    height: 45px;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Animació de l'icona hamburguesa a X */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Media query per a mòbil (menys de 768px) */
@media screen and (max-width: 768px) {

    /* Mostrar el botó hamburguesa */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Sobreescriure el display:none del responsive.css */
    div#menu {
        display: block !important;
    }

    /* Ocultar el menú desktop per defecte - NOMÉS el UL del menú */
    ul.menunav {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 280px !important;
        height: 100% !important;
        background-color: white !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        transition: right 0.3s ease !important;
        padding-top: 70px !important;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3) !important;
        margin: 0 !important;
        list-style: none !important;
    }

    /* Mostrar el menú quan està actiu */
    ul.menunav.mobile-active {
        display: block !important;
        right: 0 !important;
    }

    /* Estils dels elements del menú */
    ul.menunav li {
        list-style: none !important;
        width: 100% !important;
        padding: 15px 20px !important;
        border-bottom: 1px solid #eee !important;
    }

    ul.menunav a {
        display: block !important;
        color: #333 !important;
        text-decoration: none !important;
        font-size: 16px !important;
    }

    ul.menunav a:hover {
        background-color: #f5f5f5 !important;
        color: #D60100 !important;
    }

    /* Submenús */
    ul.menunav ul.submenu {
        position: static !important;
        display: none !important;
        padding-left: 20px !important;
        background-color: #f9f9f9 !important;
    }

    ul.menunav li:hover > ul.submenu {
        display: block !important;
    }
}

/* Per a tablets (768px - 1024px) - opcional */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Aquí pots afegir estils específics per a tablets si cal */
}
