
*{
    margin: 0;
    padding: 0;
    text-decoration: none;
    font-family: "Montserrat", serif;
}

body{
    background-color: #FFFFFF;
    background-size: cover;
    background-position: center;
}

/* Clase para evitar el scroll del body cuando el menú está abierto */
body.no-scroll {
    overflow: hidden;
    /* Opcional: para evitar que el contenido salte en algunos navegadores */
    padding-right: 15px; 
}


header{
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 10px 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    z-index: 1000;
    transition: padding 0.3s ease;
}

.header-top-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.header-bottom-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.header-social {
    display: flex;
    gap: 15px;
    margin-left: 30px;
}

.header-social .icono {
    width: 25px;
    height: 25px;
}

header .logo{
    font-weight: bolder;
}

header .logo img{
    max-width: 100%;
    height: auto;
}

header .navbar ul{
    list-style: none;
}

header .navbar ul li{
    position: relative;
    float: left;
}

header .navbar ul li a{
    font-size: 20px;
    padding: 16px;
    display: block;
    color: black;
    font-weight: 500;
    border: solid transparent 4px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

header .navbar ul li a:hover,
header .navbar ul li a:focus,
header .navbar ul li:hover > a {
    border-color: rgb(166, 25, 46);
    color: black;
}

header .navbar ul li a img{
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

header .navbar ul li ul{
    position: absolute;
    left: 0;
    width: 300px;
    background: #fff;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s ease-in-out;
    border: solid rgb(166, 25, 46) 3px;
    border-radius: 15px;
    text-align: center;
    z-index: 1001;
}

header .navbar ul li ul li {
    width: 100%;
    border-top: 1px solid rgb(165, 165, 165);
    position: relative;
}

header .navbar ul li ul li:nth-child(odd){
    background-color: rgb(238, 238, 238);
}
header .navbar ul li ul li:first-child{
    border-radius: 10px 10px 0 0;
    border-top: none;
}
header .navbar ul li ul li:last-child{
    border-radius: 0 0 10px 10px;
}

/* ✅ REGLA AÑADIDA PARA ELEMENTOS ÚNICOS */
header .navbar ul li ul li:only-child {
  border-radius: 10px;
}

header .navbar ul li ul li a {
    padding: 20px;
    border: none;
}
header .navbar ul li ul li a:hover{
    font-weight: 600;
    transform: scale(1.05);
    color: rgb(166, 25, 46);
}

header .navbar ul li ul li ul{
    left: 100%;
    width: 250px;
    top: 0;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s ease-in-out;
    border: solid rgb(166, 25, 46) 3px;
    border-radius: 15px;
    text-align: center;
    z-index: 1001;
}

/* --- EFECTOS HOVER SOLO PARA ESCRITORIO --- */
@media(min-width: 761px) {
    header .navbar ul li:hover > a img {
        transform: rotate(180deg);
    }

    header .navbar ul li:hover > ul,
    header .navbar ul li ul li:hover > ul {
        visibility: visible;
        opacity: 1;
    }

    header .navbar ul li:hover > a {
        transform: scale(1.05);
    }
}

#menu-bar{
    display: none;
}

header label{
    font-size: 20px;
    cursor: pointer;
    display: none;
}


/* --- RESPONSIVE --- */
@media(max-width:1024px){
    header .navbar ul li a{
        font-size: 17px;
        padding: 10px;
    }
    header .navbar ul li ul{
        width: 220px;
    }
    header .navbar ul li ul li a{
        font-size: 13px;
    }
    header .navbar ul li ul li ul{
        left: 220px;
        width: 200px;
        top: 0;
    }
}

@media(max-width:950px){
    header .navbar ul li a{
        font-size: 17px;
    }
}

@media(max-width:840px){
    header{
        padding: 20px 10px;
    }
}

/* === SECCIÓN FINAL PARA MÓVIL === */
@media(max-width:760px){



    header{
        position: fixed;
        flex-direction: column;
        align-items: center;
        padding: 15px 20px;
        flex-wrap: nowrap;
        transition: transform 0.3s ease-in-out;
    }
    .header-hidden {
        transform: translateY(-100%);
    }

    .header-bottom-row,
    .header-social {
        display: none;
    }
    
    .header-top-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .header-top-row .logo {
        margin-bottom: 10px;
    }

    header label{
        display: block;
        margin: 0 auto; 
        margin-bottom: 15px;
    }

    header label img{
        width: 30px;
    }
    
    header .navbar{
        padding-bottom: 50px; /* Espacio extra al final del menú */
        border-top: 1px solid #ddd;
        width: 100vw; 
    }
    
    .header-bottom-row {
        /* Ocupa el resto de la pantalla y permite el scroll interno */
        overflow-y: auto;
        /* Altura de la pantalla menos la altura del header (ajustar si cambia) */
        height: calc(100vh - 207px); 
        width: 100%;
    }

    header .navbar ul li{
        width: 100%;
        float: none; 
        text-align: center;
        display: flex;
        flex-direction: column;
        place-content: center;
    }
    
    header .navbar ul li a,
    header .navbar ul li ul li a,
    header .navbar ul li ul li ul li a{
        font-size: 17px;
    }

    header .navbar ul li a{
        display: flex;
        flex-direction: row;
        place-content: center;
        gap: 10px;
    }

    header .navbar ul li a img{
        display: initial;
        width: 15px;
        height: 15px;
        margin-top: 4px;
        transition: transform 0.3s ease;
    }

    header .navbar ul li ul{
        position: relative;
        width: 50%;
        margin: 0 auto;
        border: 1px solid transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        visibility: visible;
        opacity: 1;
    }

    header .navbar ul li ul li{
        background: #fff;
    }

    header .navbar ul li a:hover{
        border: none;
    }

    header .navbar ul li ul li ul{
        width: 100%;
        left: 0;
        margin: 0;
        border: 1px solid transparent;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        visibility: visible;
        opacity: 1;
    }

    header .navbar ul li.open > a img {
        transform: rotate(180deg);
    }

    header .navbar ul li.open > ul {
        max-height: 1000px; /* Aumentado para dar espacio a submenús anidados */
        border-color: rgb(191, 189, 189);
    }

    #menu-bar:checked ~ .header-bottom-row {
        display: block;
    }
}