/* ===== NAV BASE ===== */

/* HEADER BASE */
header {
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

html {
    scroll-behavior: smooth;
}

.logo img {
    height: 75px;
}

nav {
    display: flex;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
}

nav a:hover {
    color: #C57AA8;
}

/* ===== HAMBURGUESA ===== */

.menu-toggle {
    position: relative;
    z-index: 3000;
    width: 30px;
    height: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    background: #C57AA8;
    border-radius: 5px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* ANIMACIÓN A X CORRECTA */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== NAV MOBILE ===== */

nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding-top: 80px;

    transform: translateX(100%);
    transition: transform 0.4s ease;

    z-index: 1000;
}

nav a {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2rem;
}

/* ACTIVO */
nav.active {
    transform: translateX(0);
}

/* ===== OVERLAY ===== */

.overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 900;
    pointer-events: none; /* 👈 no bloquea */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* 👈 solo cuando está activo */
}

/* CONTENEDOR */
.dropdown {
    position: relative;
}

/* SUBMENÚ */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
}

/* LINKS */
.submenu a {
    display: block;
    padding: 12px;
    font-size: 0.9rem;
    border-bottom: none;
}



/* ===== DESKTOP ===== */

@media(min-width: 768px){

    .logo img {
        height: 90px;
    }

    .logo{
        margin: 0;
    }

    nav{
        position: static;
        transform: none;

        width: auto;
        height: auto;

        display: flex;
        flex-direction: row;
        align-items: center;

        background: none;
        padding: 0;
    }


    nav a {
        border: none;
        padding: 0;
        margin-left: 25px;
        font-size: 1.3rem;
        position: relative;
    }

    /* EFECTO PREMIUM */
    nav a::after {
        content: "";
        position: absolute;
        width: 0;
        height: 2px;
        background: #C57AA8;
        left: 0;
        bottom: -5px;
        transition: width 0.3s ease;
        justify-content: center;
        gap: 30px;
    }

    nav a:hover::after {
        width: 100%;
    }

    .menu-toggle {
        display: none;
    }

    .overlay {
        display: none;
    }

    header{
        display: flex;
        align-items: center;

        justify-content: flex-start;
        gap: 200px; /* 👈 espacio entre logo y menú */
    }

}

@media(max-width: 767px){

    .submenu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        padding-left: 15px;
    }

    .dropdown.active .submenu {
        display: block;
    }

    .submenu a {
        font-size: 1rem;
        background: rgba(197,122,168,0.05);
        margin: 5px 0;
        border-radius: 8px;
    }
}

/* SOLO móvil muestra flecha */
@media(max-width: 767px){
    .dropbtn::after {
        content: "▾";
        margin-left: 5px;
        transition: transform 0.3s;
    }

    .dropdown.active .dropbtn::after {
        transform: rotate(180deg);
    }
}

/* ESCRITORIO sin flecha */
@media(min-width: 768px){
    .dropbtn::after {
        content: "";
    }
}



/* MOSTRAR EN DESKTOP */
@media(min-width: 768px){
    .mega:hover .mega-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* COLUMNAS */
.mega-column h4 {
    color: #C57AA8;
    margin-top: 7px;
    margin-bottom: 7px;
    font-size: 0.95rem;
}

.mega-column a {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9rem;
}

.mega-column a:hover {
    color: #C57AA8;
}

/* ===== MEGA MENU DESKTOP ===== */
@media(min-width: 768px){

    .mega {
        position: relative;
    }

    .mega-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        width: min(90vw, 700px); /* 👈 evita que se salga */

        width: 650px;
        background: white;
        padding: 30px;
        border-radius: 15px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.1);

        display: flex;
        gap: 40px;
        justify-content: space-between;

        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;

        z-index: 2000;
    }

    .mega:hover .mega-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

@media(max-width: 767px){

    .mega-menu {
        display: none;
        flex-direction: column;
        padding-left: 10px;
    }

    .mega.active .mega-menu {
        display: flex;
    }
}
