/* ===== NAV DROPDOWN - Services Menu ===== */

/* Dropdown container */
.nav-links li.has-dropdown {
    position: relative;
}

.nav-links li.has-dropdown>a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links li.has-dropdown>a .dropdown-arrow {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

.nav-links li.has-dropdown:hover>a .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(18, 18, 18, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 184, 0, 0.04);
    z-index: 1001;
    list-style: none;
}

/* Show on hover */
.nav-links li.has-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Bridge element to prevent losing hover between link and dropdown */
.nav-links li.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
}

/* Dropdown items */
.nav-dropdown li {
    margin: 0 !important;
}

.nav-dropdown li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ccc;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-dropdown li a::after {
    display: none !important;
}

.nav-dropdown li a::before {
    display: none !important;
}

.nav-dropdown li a:hover {
    background: rgba(255, 184, 0, 0.08);
    color: #FFB800;
}

.nav-dropdown li a .dropdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-dropdown li a:hover .dropdown-icon {
    transform: scale(1.1);
}

/* Icon color variants */
.dropdown-icon.sites {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.dropdown-icon.ia {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.dropdown-icon.crm {
    background: rgba(40, 202, 65, 0.12);
    color: #28ca41;
}

.dropdown-icon.infra {
    background: rgba(255, 107, 107, 0.12);
    color: #ff6b6b;
}

.dropdown-icon.api {
    background: rgba(255, 184, 0, 0.12);
    color: #FFB800;
}

.dropdown-icon.ads {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.dropdown-icon.funis {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

/* Separator */
.nav-dropdown .dropdown-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 6px 10px;
}

/* "Ver todos" link */
.nav-dropdown li a.dropdown-all {
    color: #FFB800;
    font-weight: 600;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 4px;
    padding-top: 12px;
    border-radius: 0 0 8px 8px;
}

.nav-dropdown li a.dropdown-all:hover {
    background: rgba(255, 184, 0, 0.12);
}

/* ===== MOBILE DROPDOWN ===== */
@media screen and (max-width: 768px) {
    .nav-links li.has-dropdown>a .dropdown-arrow {
        display: none;
    }

    .nav-dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: rgba(30, 30, 30, 0.95);
        border: none;
        border-radius: 10px;
        min-width: unset;
        width: 90%;
        margin: 8px auto;
        padding: 6px;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        padding: 0 6px;
    }

    .nav-links li.has-dropdown.mobile-open .nav-dropdown {
        max-height: 500px;
        padding: 6px;
        opacity: 1;
    }

    .nav-dropdown li a {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .nav-dropdown li a .dropdown-icon {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .nav-dropdown .dropdown-separator {
        margin: 4px 8px;
    }
}