/* Header mejorado */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    background: var(--kinetic-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--kinetic-border);
    transition: var(--transition);
    will-change: transform, background-color;
}

[data-theme="dark"] header {
    border-bottom-color: rgba(239, 83, 80, 0.2);
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(20px);
}

header.scrolled {
    padding: 15px 0;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
}

.logo-text {
    font-family: 'Krona One', sans-serif;
    font-size: 1.7rem;
    color: var(--kinetic-dark);
    letter-spacing: -0.03em;
    font-weight: 700;
    transition: var(--transition);
}

.logo-text::first-letter {
    color: var(--primary-color);
}

/* NAVEGACIÓN MEJORADA - SIN BUGS */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--kinetic-gray);
    padding: 8px 0;
    transition: var(--transition);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Indicador activo - SOLO PARA EL ENLACE ACTIVO */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left;
}

.nav-link:hover::after {
    width: 100%;
}

/* SOLO el enlace activo debe mostrar la línea */
.nav-link.active::after {
    width: 100% !important;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light)) !important;
}

.nav-link:hover {
    color: var(--kinetic-dark);
}

/* ESTILOS ESPECÍFICOS PARA ENLACE ACTIVO */
.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}

/* RESET: Asegurar que NUNCA dos enlaces estén activos a la vez */
.nav-links .nav-link:not(.active) {
    color: var(--kinetic-gray) !important;
    font-weight: 500 !important;
}

.theme-toggle {
    background: rgba(198, 40, 40, 0.1);
    border: 1px solid var(--kinetic-border);
    color: var(--kinetic-dark);
    font-size: 1.1rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px) rotate(15deg);
}

.mobile-menu-btn {
    display: none;
    background: rgba(198, 40, 40, 0.1);
    border: 1px solid var(--kinetic-border);
    color: var(--kinetic-dark);
    font-size: 1.3rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background: var(--kinetic-surface);
    padding: 100px 0 60px;
    border-top: 1px solid var(--kinetic-border);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-info {
    color: var(--kinetic-gray);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--kinetic-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kinetic-dark);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-4px);
}

.footer-heading {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--kinetic-dark);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    padding-bottom: 12px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--kinetic-gray);
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid var(--kinetic-border);
    color: var(--kinetic-gray);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Barra lateral de redes sociales MEJORADA - SOLO PARA FOOTER EN MÓVIL */
.social-sidebar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 998;
    background: var(--kinetic-light);
    border-left: 1px solid var(--kinetic-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    overflow: visible;
    padding: 12px 4px;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.6s ease;
    width: 60px;
    opacity: 1;
}

.social-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kinetic-gray);
    font-size: 1.1rem;
    transition: var(--transition);
    text-decoration: none;
    background: var(--kinetic-surface);
    position: relative;
    border-radius: 10px;
    border: 1px solid var(--kinetic-border);
    margin: 0 auto;
}

.social-icon:hover {
    background: rgba(198, 40, 40, 0.05);
    color: var(--primary-color);
    transform: translateX(-8px);
}

/* WhatsApp */
.social-icon.whatsapp {
    background: linear-gradient(135deg, #25d366, #128C7E);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
    margin: 8px auto;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    position: relative;
    border: 3px solid var(--kinetic-light);
    left: -15px;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

[data-theme="dark"] .social-icon.whatsapp {
    border-color: #1e293b;
    background: linear-gradient(135deg, #128C7E, #25d366);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.social-icon.whatsapp:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
    background: linear-gradient(135deg, #128C7E, #25d366);
}

[data-theme="dark"] .social-icon.whatsapp:hover {
    background: linear-gradient(135deg, #25d366, #0da65c);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.social-icon.tiktok:hover { color: #000000; background: rgba(0, 0, 0, 0.05); }
.social-icon.instagram:hover { color: #E1306C; background: rgba(225, 48, 108, 0.05); }
.social-icon.facebook:hover { color: #1877F2; background: rgba(24, 119, 242, 0.05); }
.social-icon.x-twitter:hover { color: #000000; background: rgba(0, 0, 0, 0.05); }

.social-tooltip {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--kinetic-surface);
    color: var(--kinetic-dark);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: 1px solid var(--kinetic-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-right: 12px;
    font-weight: 500;
}

.social-icon:hover .social-tooltip {
    opacity: 1;
    visibility: visible;
}

.social-icon.whatsapp .social-tooltip {
    background: #25d366;
    color: white;
    border-color: #25d366;
}