/* ================= HEADER ================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body {
    padding-top: 80px;
}

/* NAV */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    position: relative;
    width: 100%;
}

/* LOGO */
.logo img {
    height: 70px;
}

/* ================= MENU DESKTOP ================= */
.menu {
    display: flex;
    list-style: none;
    gap: 25px;
}

.menu li a {
    text-decoration: none;
    color: #111;
    font-weight: 600;
}

/* SUBMENU */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    width: 200px;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.has-submenu:hover .submenu {
    display: block;
}

/* ================= RIGHT ================= */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-quote {
    background: #ff7a00;
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
}

/* ================= SUBMENU ================= */
.has-submenu {
    position: relative;
}

/* CONTENEDOR */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.25s ease;
    z-index: 1000;
}

/* LINEA NARANJA SUPERIOR */
.submenu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ff7a00;
}

/* ITEMS */
.submenu li {
    border-bottom: 1px solid #eee;
}

.submenu li:last-child {
    border-bottom: none;
}

/* LINKS */
.submenu li a {
    display: block;
    padding: 14px 18px;
    color: #222;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* HOVER */
.submenu li a:hover {
    background: #f5f5f5;
    padding-left: 25px;
}

/* MOSTRAR EN DESKTOP */
.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    margin-top: 10px;
}

/* ================= TOGGLE ================= */
.menu-toggle {
    display: none;
    font-size: 25px;
    cursor: pointer;
    background: #fff;
    padding: 5px;
    z-index: 10001;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    .menu-toggle {
        display: block;
        position: relative;
        order: 3;
    }

    .nav-right {
        display: none;
    }

    /* Asegurar que el logo y toggle estén en posiciones fijas */
    .nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .logo {
        order: 1;
    }

    .menu-toggle {
        order: 2;
    }

    .menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background: #fff;
        flex-direction: column;
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        z-index: 9998;
        margin: 0;
        padding: 0;
    }

    .menu.active {
        transform: translateX(0);
    }

    .menu li {
        border-bottom: 1px solid #eee;
        list-style: none;
    }

    .menu li a {
        display: block;
        padding: 15px 20px;
        font-size: 16px;
    }

    /* SUBMENU MOBILE */
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        box-shadow: none;
        width: 100%;
        background: #fafafa;
    }

    .submenu::before {
        display: none;
    }

    .submenu li a {
        padding-left: 40px;
        font-size: 14px;
    }

    .submenu li a:hover {
        padding-left: 45px;
    }

    .has-submenu.open .submenu {
        display: block;
    }

    /* Estilo para el ícono de flecha en móvil */
    .has-submenu > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .has-submenu > a i {
        transition: transform 0.3s ease;
    }

    .has-submenu.open > a i {
        transform: rotate(180deg);
    }

    /* Evitar que el body haga scroll cuando el menú está abierto */
    body.menu-open {
        overflow: hidden;
    }
}

/* Opcional: Ajustes para móviles muy pequeños */
@media (max-width: 480px) {
    .menu li a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .submenu li a {
        padding-left: 30px;
        font-size: 13px;
    }
    
    .submenu li a:hover {
        padding-left: 35px;
    }
}