/* Mega Menu and Navigation Styles */

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-content nav {
    margin-left: auto;
}

/* Estilos del menú dropdown */
nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
}

nav li {
    position: relative;
}

nav a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--primary);
}

/* Botón de Carrito */
.cart-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(4, 107, 210, 0.3);
    cursor: pointer;
    text-decoration: none;
}

.cart-button::after {
    display: none !important;
}

.cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4, 107, 210, 0.4);
    color: white !important;
}

.cart-button i {
    font-size: 18px;
}

.cart-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    animation: pulseCart 2s infinite;
}

.cart-counter.hidden {
    display: none;
}

@keyframes pulseCart {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes cartButtonPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(4, 107, 210, 0.3);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 8px 24px rgba(4, 107, 210, 0.6);
    }
}

/* Dropdown de Servicios */
.dropdown {
    position: relative;
}

.dropdown>a::before {
    content: '▼';
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover>a::before {
    transform: rotate(-180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown .dropdown-menu:hover {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Área de seguridad invisible entre el botón y el dropdown */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--secondary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
    padding-left: 25px;
}

/* Mega Menu para SOFTWARE */
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 10px;
    min-width: 800px;
    max-width: 1000px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown:hover .mega-menu,
.dropdown .mega-menu:hover {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Área de seguridad invisible entre el botón y el mega-menú */
.mega-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.mega-menu-column {
    position: relative;
}

.mega-menu-column h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu-column h4 i {
    font-size: 18px;
}

.mega-menu-section {
    margin-bottom: 20px;
}

.mega-menu-section:last-child {
    margin-bottom: 0;
}

.mega-menu-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.mega-menu-column a {
    display: block;
    padding: 8px 12px;
    color: var(--secondary);
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin-bottom: 2px;
}

.mega-menu-column a:hover {
    background: linear-gradient(135deg, rgba(4, 107, 210, 0.08), rgba(4, 107, 210, 0.12));
    color: var(--primary);
    padding-left: 16px;
    transform: translateX(2px);
}

.mega-menu-column a::after {
    display: none;
}

.mega-menu-cta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.mega-menu-cta a {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    font-weight: 600;
    text-align: center;
    padding: 10px 16px !important;
}

.mega-menu-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(4, 107, 210, 0.3);
    padding-left: 16px !important;
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .cart-button {
        padding: 8px 12px;
        font-size: 14px;
        gap: 6px;
    }

    .cart-button i {
        font-size: 16px;
    }

    .ai-search-container {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }

    .ai-search-input-wrapper {
        width: 100% !important;
    }

    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 120px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: 30px 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        gap: 20px;
        max-height: 80vh;
        overflow-y: auto;
    }

    nav ul.active {
        display: flex;
    }

    .dropdown-menu {
        position: static;
        display: none;
        background: var(--bg-light);
        box-shadow: none;
        margin-top: 10px;
        padding: 10px 0;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    /* Mega Menu responsive */
    .mega-menu {
        position: static;
        min-width: auto;
        max-width: 100%;
        padding: 15px;
        margin-top: 10px;
        transform: none;
        left: auto;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mega-menu-column h4 {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .mega-menu-column a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .mega-menu-section-title {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .dropdown.active .mega-menu {
        display: block;
    }
}