/**
 * MASTROMEC - ESTILOS DE NAVEGACIÓN
 * Consolidado de menu-fixes.css y otros archivos de navegación
 */

/* ===== HEADER Y NAVEGACIÓN PRINCIPAL ===== */

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200, #E2E8F0);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1004;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 110px;
    height: 110px;
    padding: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(13, 125, 197, 0.1);
}

@supports not (backdrop-filter: blur(10px)) {
    .header {
        background: rgba(255, 255, 255, 0.98);
    }
}

.nav {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    width: 100%;
}

/* ===== LOGO ===== */

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 16px 0;
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold, 700);
    color: var(--mastromec-blue, #1E40AF);
    text-decoration: none;
    transition: color 0.3s ease;
    z-index: 1005;
    position: relative;
}

.logo:hover {
    color: var(--mastromec-blue-light, #3B82F6);
}

.logo-svg {
    height: 64px;
    width: auto;
    margin: 8px 16px;
    display: block;
    visibility: visible;
    opacity: 1;
    filter: none;
    object-fit: contain;
}

/* ===== NAVEGACIÓN DESKTOP ===== */

.nav-links {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 1rem;
    color: var(--professional-gray, #475569);
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    background: rgba(13, 125, 197, 0.1);
    color: var(--mastromec-blue, #1E40AF);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--mastromec-blue, #1E40AF);
    transition: width 0.3s ease;
}

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

/* ===== BOTÓN MÓVIL ===== */

.mobile-menu-button {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--mastromec-blue, #1E40AF);
    background: transparent;
    border-radius: 8px;
    color: var(--mastromec-blue, #1E40AF);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1005;
    position: relative;
}

.mobile-menu-button:hover {
    background: var(--mastromec-blue, #1E40AF);
    color: white;
}

.mobile-menu-button:active {
    transform: scale(0.95);
}

.mobile-menu-button:focus {
    outline: 2px solid var(--mastromec-blue-light, #3B82F6);
    outline-offset: 2px;
}

.mobile-menu-button i {
    font-size: 1.2rem;
}

.mobile-menu-button.active {
    background: var(--mastromec-blue, #1E40AF);
    color: white;
}

/* ===== MENÚ MÓVIL ===== */

.mobile-menu {
    position: fixed;
    top: 110px;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: calc(100vh - 110px);
    background: white;
    z-index: 1003;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
}

.mobile-menu.active {
    right: 0;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.mobile-nav-links li {
    margin: 0;
}

.mobile-nav-link {
    display: block;
    color: var(--gray-800, #1E293B);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-100, #F1F5F9);
    transition: all 0.3s ease;
    text-align: right;
}

.mobile-nav-link:hover {
    color: var(--mastromec-blue, #1E40AF);
    background: var(--gray-50, #F8FAFC);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

/* ===== BOTÓN WHATSAPP EN HEADER ===== */

.header .btn-whatsapp {
    height: 44px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 22px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header .btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet y Mobile */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-button {
        display: flex;
    }
}

/* Mobile específico */
@media (max-width: 768px) {
    .header {
        min-height: 80px;
        height: 80px;
    }

    .nav {
        padding: 0 1rem;
    }

    .logo {
        padding: 12px 0;
    }

    .logo-svg {
        height: 56px;
        margin: 4px 8px;
    }

    .mobile-menu {
        top: 80px;
        height: calc(100vh - 80px);
        width: 100%;
        max-width: none;
    }
}

/* Tablet y Desktop - ocultar hamburguesa */
@media (min-width: 769px) {
    .mobile-menu-button {
        display: none !important;
    }

    .nav-links {
        display: flex;
    }

    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* ===== ANIMACIONES Y MICROINTERACCIONES ===== */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.mobile-menu.active {
    animation: slideInRight 0.3s ease-out;
}

.mobile-menu-overlay.active {
    animation: fadeIn 0.3s ease-out;
}

/* Animación de enlaces móviles */
.mobile-nav-link {
    transform: translateX(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.active .mobile-nav-link {
    transform: translateX(0);
    opacity: 1;
}

.mobile-menu.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-nav-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-nav-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-nav-link:nth-child(4) { transition-delay: 0.4s; }
.mobile-menu.active .mobile-nav-link:nth-child(5) { transition-delay: 0.5s; }

/* ===== SOPORTE PARA REDUCCIÓN DE MOVIMIENTO ===== */

@media (prefers-reduced-motion: reduce) {
    .mobile-menu,
    .mobile-menu-overlay,
    .mobile-nav-link,
    .nav-link {
        transition-duration: 0.01ms;
        animation-duration: 0.01ms;
    }
}

/* ===== MODO ALTO CONTRASTE ===== */

@media (prefers-contrast: high) {
    .mobile-menu-button {
        border: 3px solid currentColor;
    }

    .nav-link,
    .mobile-nav-link {
        border: 1px solid transparent;
    }

    .nav-link:hover,
    .mobile-nav-link:hover {
        border-color: currentColor;
    }
}