/* =================================================================
   TRANSFERMOBIL - HEADER DARK STYLES (Inspirado en Lemon.me)
   Prefijo: .tm- para evitar conflictos
   Versión oscura moderna y 100% responsive
   ================================================================= */

/* Reset específico para el header */
.tm-header,
.tm-header *,
.tm-header *::before,
.tm-header *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Header principal - Dark Theme */
.tm-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Inter', sans-serif;
}

.tm-header.tm-scrolled {
    background: rgba(5, 5, 5, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.tm-header.tm-hidden {
    transform: translateY(-100%);
}

/* Contenedor del header */
.tm-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo - Dark Theme */
.tm-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.tm-logo:hover {
    color: #00ff88;
    text-decoration: none;
    transform: translateY(-1px);
}

.tm-logo-img {
    height: 44px;
    width: auto;
    margin-right: 12px;
    filter: brightness(1.1);
}

/* Navegación principal - Dark Theme */
.tm-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 2.5rem;
}

.tm-nav > li {
    position: relative;
}

.tm-nav > li > a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 12px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: block;
    letter-spacing: -0.01em;
}

.tm-nav > li > a:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.tm-nav > li > a.tm-active {
    color: #00d4aa;
    text-decoration: none;
}

.tm-nav > li > a.tm-active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #00d4aa 0%, #00f5cc 100%);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.6);
}

/* Dropdown - Dark Theme */
.tm-dropdown {
    position: relative;
}

.tm-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 12px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: -0.01em;
}

.tm-dropdown-toggle:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.tm-dropdown-toggle i {
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.7;
}

.tm-dropdown:hover .tm-dropdown-toggle i {
    transform: rotate(180deg);
    opacity: 1;
}

.tm-dropdown-menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 0;
    background: rgba(12, 12, 12, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px 0;
    min-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.96);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tm-dropdown:hover .tm-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tm-dropdown-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 12px;
    margin: 2px 12px;
}

.tm-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    text-decoration: none;
    transform: translateX(4px);
}

.tm-dropdown-item.tm-active {
    background: rgba(0, 255, 136, 0.12);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.tm-dropdown-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(0, 255, 136, 0.1);
}

.tm-dropdown-item:hover .tm-dropdown-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 255, 136, 0.2) 100%);
    border-color: rgba(0, 255, 136, 0.3);
    transform: scale(1.05);
}

.tm-dropdown-icon i {
    color: #00ff88;
    font-size: 1.2rem;
}

.tm-dropdown-content h4 {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    letter-spacing: -0.01em;
}

.tm-dropdown-content p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    letter-spacing: -0.005em;
}

/* Header derecha - Botones Dark Theme */
.tm-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tm-btn-header {
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(255, 255, 255, 0.02);
    display: inline-block;
    letter-spacing: -0.01em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tm-btn-header:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.08);
}

.tm-btn-primary {
    padding: 14px 28px;
    background: linear-gradient(135deg, #00ff88 0%, #00ffaa 100%);
    color: #000000;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    display: inline-block;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.25);
}

.tm-btn-primary:hover {
    background: linear-gradient(135deg, #00ffaa 0%, #00ff88 100%);
    color: #000000;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.4);
}

/* Botón móvil hamburguesa - Dark Theme */
.tm-mobile-toggle {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    padding: 12px;
    gap: 4px;
    transition: all 0.3s ease;
}

.tm-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.tm-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tm-mobile-toggle.tm-active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: #00d4aa;
}

.tm-mobile-toggle.tm-active span:nth-child(2) {
    opacity: 0;
}

.tm-mobile-toggle.tm-active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: #00d4aa;
}

/* Menú móvil - Dark Theme */
.tm-mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: rgba(8, 8, 8, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 999;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

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

.tm-mobile-nav {
    list-style: none;
    padding: 32px 24px;
    margin: 0;
}

.tm-mobile-nav li {
    margin-bottom: 4px;
}

.tm-mobile-nav a {
    display: block;
    padding: 20px 16px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 1.1rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: -0.01em;
}

.tm-mobile-nav a:hover {
    color: #ffffff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(8px);
}

.tm-mobile-nav a.tm-active {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

/* Dropdowns en móvil - Estilo diferenciado con verde Lemon */
.tm-mobile-dropdown {
    margin-bottom: 8px;
}

.tm-mobile-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: -0.01em;
}

.tm-mobile-dropdown-header:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.tm-mobile-dropdown-header.tm-active {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.tm-mobile-dropdown-icon {
    font-size: 0.9rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.7;
}

.tm-mobile-dropdown-header.tm-active .tm-mobile-dropdown-icon {
    transform: rotate(180deg);
    opacity: 1;
}

.tm-mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 12px 12px;
    margin-top: -1px;
}

.tm-mobile-dropdown.tm-mobile-dropdown-active .tm-mobile-dropdown-content {
    max-height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
}

.tm-mobile-dropdown-item {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: -0.005em;
    margin-left: 12px;
}

.tm-mobile-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.tm-mobile-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transform: translateX(4px);
}

.tm-mobile-dropdown-item.tm-active {
    background: rgba(0, 255, 136, 0.12);
    color: #00ff88;
    border-left: 3px solid #00ff88;
    padding-left: 21px;
}

.tm-mobile-dropdown-item-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}

.tm-mobile-dropdown-item:hover .tm-mobile-dropdown-item-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(0, 255, 136, 0.15) 100%);
    border-color: rgba(0, 255, 136, 0.4);
    transform: scale(1.05);
}

.tm-mobile-dropdown-item.tm-active .tm-mobile-dropdown-item-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3) 0%, rgba(0, 255, 136, 0.2) 100%);
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.3);
}

.tm-mobile-dropdown-item-icon i {
    color: #00ff88;
    font-size: 1.2rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-mobile-dropdown-item-content {
    flex: 1;
    min-width: 0;
}

.tm-mobile-dropdown-item-content h4 {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
}

.tm-mobile-dropdown-item-content p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

/* Responsive Design - Mejorado */
@media (max-width: 1200px) {
    .tm-header-content {
        padding: 0 20px;
    }
    
    .tm-nav {
        gap: 2rem;
    }
}

@media (max-width: 1024px) {
    .tm-header-content {
        padding: 0 16px;
    }
    
    .tm-nav {
        gap: 1.5rem;
    }
    
    .tm-dropdown-menu {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .tm-header {
        height: 70px;
    }
    
    .tm-mobile-menu {
        top: 70px;
        max-height: calc(100vh - 70px);
    }
    
    .tm-nav {
        display: none;
    }
    
    .tm-mobile-toggle {
        display: flex;
    }
    
    .tm-header-right {
        gap: 12px;
    }
    
    .tm-btn-header {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .tm-btn-primary {
        padding: 12px 22px;
        font-size: 0.85rem;
    }
    
    .tm-logo {
        font-size: 1.4rem;
    }
    
    .tm-logo-img {
        height: 38px;
    }
    
    body {
        padding-top: 70px !important;
    }
}

@media (max-width: 640px) {
    .tm-header-content {
        padding: 0 12px;
    }
    
    .tm-btn-header {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .tm-btn-primary {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    
    .tm-mobile-nav {
        padding: 24px 16px;
    }
    
    .tm-mobile-nav a {
        padding: 18px 12px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .tm-btn-header {
        display: none;
    }
    
    .tm-logo {
        font-size: 1.3rem;
    }
    
    .tm-logo-img {
        height: 34px;
        margin-right: 8px;
    }
    
    .tm-btn-primary {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .tm-header-content {
        padding: 0 8px;
    }
    
    .tm-logo {
        font-size: 1.2rem;
    }
    
    .tm-logo-img {
        height: 30px;
    }
    
    .tm-btn-primary {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* Estados adicionales para JavaScript */
.tm-dropdown-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.tm-highlight {
    background: rgba(0, 255, 136, 0.15) !important;
    border-color: rgba(0, 255, 136, 0.3) !important;
    transition: all 0.5s ease;
}

/* Animaciones */
@keyframes tm-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tm-header {
    animation: tm-fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Estados de focus para accesibilidad - Dark Theme */
.tm-nav a:focus,
.tm-btn-header:focus,
.tm-btn-primary:focus,
.tm-mobile-toggle:focus,
.tm-dropdown-toggle:focus {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Asegurar padding-top del body */
body {
    padding-top: 80px;
}

/* Estado compacto opcional */
.tm-header.tm-compact {
    height: 60px;
}

.tm-header.tm-compact + body {
    padding-top: 60px;
}

/* Utilidades específicas */
.tm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .tm-header,
    .tm-mobile-menu {
        display: none;
    }
    
    body {
        padding-top: 0 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tm-header {
        background: rgba(0, 0, 0, 0.95);
        border-bottom: 2px solid #ffffff;
    }
    
    .tm-nav > li > a {
        color: #ffffff;
    }
    
    .tm-btn-header {
        border-color: #ffffff;
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tm-header,
    .tm-header *,
    .tm-dropdown-menu,
    .tm-mobile-menu {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}