/* --- Base Styles --- */
li {
    list-style: none;
}
ul{
    margin-bottom: 0;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    transition: transform 0.3s ease;
    padding: 15px 0;
}

.header.hide {
    transform: translateY(-100%);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: 4.25rem;
    position: relative;
}

.brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.logo-img {
    height: 50px;
    width: auto;
    margin-top: 0;
}

.menu-block {
    display: none;
}

/* --- Menú Móvil (Burger y Panel) --- */
.burger {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
    order: -1;
    z-index: 1001;
    width: 1.6rem;
    height: 1.15rem;
    border: none;
    outline: none;
    background: none;
}

.burger-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--color-secondary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-line:nth-child(1) { top: 0px; }
.burger-line:nth-child(2) { top: 0.5rem; width: 70%; }
.burger-line:nth-child(3) { top: 1rem; }

.burger.is-active .burger-line:nth-child(1) { top: 0.5rem; transform: rotate(135deg); }
.burger.is-active .burger-line:nth-child(2) { opacity: 0; visibility: hidden; }
.burger.is-active .burger-line:nth-child(3) { top: 0.5rem; transform: rotate(-135deg); }

.menu {
    position: fixed;
    top: -100vh;
    left: 0;
    width: 100%;
    height: 75vh;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.4s ease;
    z-index: 999;
}

.menu.is-active {
    top: 0;
}

.menu-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    row-gap: 1.5rem;
    list-style: none;
}

/* More specific selector for the mobile menu link */
.navbar .menu-inner .menu-item a {
    font-size: 1.15rem;
    font-weight: 500;
    color: #141414;
    text-decoration: none;
}

/* --- Media Query para Escritorio --- */
@media (min-width: 768px) {
    .burger { display: none; }
    
    .brand {
        position: static;
        transform: none;
        margin-right: auto;
        display: flex;
        align-items: center;
    }

    .logo-img {
        height: 45px;
    }
    
    .navbar {
        justify-content: flex-start;
    }

    /* Increased specificity for the desktop menu container */
    .header .navbar .menu {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        flex-direction: row;
        display: flex;
        align-items: center;
    }

    /* Increased specificity for the desktop menu list */
    .header .navbar .menu .menu-inner {
        flex-direction: row;
        align-items: center;
        gap: 2.5rem;
        margin-right: 1.5rem;
    }
    
    .menu-block {
        display: inline-block;
        font-size: 1.15rem;
        font-weight: 500;
        padding: 0.65rem 1.5rem;
        border-radius: 3rem;
        color: #f1f1f1;
        background-color: var(--color-primary);
        box-shadow: var(--shadow-medium);
        text-decoration: none;
        border: 1px solid transparent;
    }

    /* Increased specificity for ALL menu links on desktop */
    .navbar .menu-inner .menu-item a {
        position: relative;
        padding-bottom: 5px; /* Added some padding for the bottom line */
        margin-right: 1rem;
        color: #141414;
        text-decoration: none;
        display: flex;
        align-items: center;
    }
    
    .navbar .menu-inner .menu-item a:hover {
        color: #141414;
    }

    /* Styling the active menu item's link */
    .navbar .menu-inner .current-menu-item a {
        font-weight: bold; /* Example: make the active link bold */
        color: var(--color-primary);
    }
    
    /* Underline animation on hover */
    .navbar .menu-inner .menu-item a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 3px;
        bottom: 0;
        left: 0;
        background-color: var(--color-primary);
        transition: width 0.3s ease;
    }

    .navbar .menu-inner .menu-item a:hover::after {
        width: 100%;
    }
}