/* ===== RESET Y VARIABLES ===== */
:root {
    --header-bg-color: #6b9bd8;
    --header-text-color: #ffffff;
    --bar-bg-color: #ffffff;
    --bar-text-color: #333333;
    --header-hover-color: #5a8bc4;
    --header-height: 120px;
    --top-bar-height: 45px;
    --logo-size: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== ELIMINAR SUBRAYADOS DE ENLACES ===== */
.acf-dynamic-header a,
.acf-dynamic-header a:link,
.acf-dynamic-header a:visited,
.acf-dynamic-header a:hover,
.acf-dynamic-header a:focus,
.acf-dynamic-header a:active {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ===== HEADER PRINCIPAL ===== */
.acf-dynamic-header {
    background: var(--header-bg-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== BARRA SUPERIOR ===== */
.header-top-bar {
    background: var(--header-bg-color);
    color: var(--header-text-color);
    height: var(--top-bar-height);
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-top-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-contact-info {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-contact-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--header-text-color);
    font-weight: 400;
    white-space: nowrap;
}

.header-contact-info i {
    font-size: 12px;
    opacity: 0.9;
}

/* ===== REDES SOCIALES ===== */
.header-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-social .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.15);
    color: var(--header-text-color);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.header-social .social-link:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* ===== BARRA PRINCIPAL ===== */
.header-main {
    background: var(--bar-bg-color);
    height: calc(var(--header-height) - var(--top-bar-height));
    border-bottom: 1px solid #eee;
}

.header-main .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* ===== LOGO ===== */
.header-logo {
    flex-shrink: 0;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo-img {
    height: var(--logo-size);
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.header-logo-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--header-bg-color);
    letter-spacing: -0.5px;
}

/* ===== NAVEGACIÓN PRINCIPAL ===== */
.header-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 40px;
}

.main-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
}

.menu-item {
    position: relative;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 30px 20px;
    color: var(--menu-text-color) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: none;
    outline: none;
    overflow: hidden;
}

.menu-link::before {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--menu-hover-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.menu-link:hover {
    color: var(--menu-hover-color) !important;
    transform: translateY(-2px);
}

.menu-link:hover::before {
    width: 80%;
}

/* Efecto de fondo radial */
.menu-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(107, 155, 216, 0.1) 0%, transparent 70%);
    transition: all 0.5s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.menu-link:hover::after {
    width: 200px;
    height: 200px;
}

.menu-link i {
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.menu-item:hover .menu-link i {
    transform: rotate(180deg);
}

/* ===== SUBMENÚ CON EFECTOS MODERNOS ===== */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--menu-desplegable-bg) !important;
    min-width: 220px;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.menu-item:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* Efecto de aparición con delay escalonado */
.sub-menu-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
    transition-delay: calc(var(--item-index, 0) * 0.05s);
}

.menu-item:hover .sub-menu .sub-menu-item {
    opacity: 1;
    transform: translateX(0);
}

.sub-menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.sub-menu-item:last-child {
    border-bottom: none;
}

.sub-menu-link {
    display: block;
    padding: 14px 24px;
    color: var(--menu-desplegable-text) !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    background: transparent;
}

/* Efecto de línea animada */
.sub-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--menu-desplegable-hover-bg), transparent);
    transition: width 0.3s ease;
    z-index: -1;
}

.sub-menu-link:hover {
    background: var(--menu-desplegable-hover-bg) !important;
    color: var(--menu-desplegable-hover-text) !important;
    padding-left: 30px;
    transform: translateX(5px);
}

.sub-menu-link:hover::before {
    width: 100%;
}

/* Efecto de brillo */
.sub-menu-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateY(-50%) rotate(25deg);
    transition: left 0.5s ease;
}

.sub-menu-link:hover::after {
    left: 100%;
}

/* ===== BOTONES DEL HEADER ===== */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.jtdes-header-btn-primary,
.jtdes-header-btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
    min-width: 120px;
}

.jtdes-header-btn-primary {
    background-color: var(--botones-oscuro-bg, #2c3e50);
    color: var(--botones-oscuro-text, #ffffff);
    border-color: var(--botones-oscuro-bg, #2c3e50);
}

.jtdes-header-btn-primary:hover,
.jtdes-header-btn-primary:focus {
    background-color: var(--botones-oscuro-hover-bg, #34495e);
    color: var(--botones-oscuro-hover-text, #ffffff);
    border-color: var(--botones-oscuro-hover-bg, #34495e);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.jtdes-header-btn-secondary {
    background-color: var(--botones-claro-bg, #f8f9fa);
    color: var(--botones-claro-text, #2c3e50);
    border-color: var(--botones-claro-bg, #f8f9fa);
}

.jtdes-header-btn-secondary:hover,
.jtdes-header-btn-secondary:focus {
    background-color: var(--botones-claro-hover-bg, #e9ecef);
    color: var(--botones-claro-hover-text, #2c3e50);
    border-color: var(--botones-claro-hover-bg, #e9ecef);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== MENÚ MÓVIL ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: var(--header-bg-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 10001;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--header-bg-color);
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.mobile-menu-close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-main-menu {
    list-style: none;
}

.mobile-menu-item {
    border-bottom: 1px solid #eee;
}

.mobile-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    color: var(--menu-text-color) !important;
    text-decoration: none;
    font-weight: 500;
    border: none;
    outline: none;
}

.mobile-dropdown-menu {
    display: none;
    list-style: none;
    padding-left: 0;
    background: var(--menu-desplegable-bg) !important;
    margin: 0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.mobile-dropdown-link {
    display: block;
    padding: 12px 30px;
    color: var(--menu-desplegable-text) !important;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    border: none;
    outline: none;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mobile-dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: var(--menu-desplegable-hover-bg);
    transition: height 0.3s ease;
}

.mobile-dropdown-link:hover {
    color: var(--menu-desplegable-hover-text) !important;
    background: var(--menu-desplegable-hover-bg) !important;
    padding-left: 35px;
}

.mobile-dropdown-link:hover::before {
    height: 100%;
}

.mobile-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.mobile-buttons h4 {
    margin-bottom: 15px;
    color: var(--bar-text-color);
    font-size: 16px;
}

.header-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.jtdes-header-button-primary {
    background: var(--botones-bg);
    color: var(--botones-text);
}

.jtdes-header-button-secondary {
    background: var(--botones-claro-bg);
    color: var(--botones-claro-text);
    border: 1px solid var(--botones-claro-text);
}

.mobile-contact-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.mobile-contact-title {
    margin-bottom: 15px;
    color: var(--bar-text-color);
    font-size: 16px;
}

.mobile-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--bar-text-color);
    font-size: 14px;
}

.mobile-contact-item i {
    width: 20px;
    color: var(--header-bg-color);
}

.mobile-social-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mobile-social-title {
    margin-bottom: 15px;
    color: var(--bar-text-color);
    font-size: 14px;
}

.mobile-social-icons {
    display: flex;
    gap: 10px;
}

.mobile-social-icons .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--header-bg-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mobile-social-icons .social-link:hover {
    transform: scale(1.1);
}

/* ===== EFECTOS ADICIONALES DE ANIMACIÓN ===== */

/* Animación de partículas flotantes */
@keyframes float-particle {
    0% {
        transform: translateY(0px) translateX(0px) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px) translateX(5px) scale(1);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-20px) translateX(10px) scale(0);
        opacity: 0;
    }
}

.menu-item::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 10px;
    width: 4px;
    height: 4px;
    background: var(--header-bg-color);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 2s infinite ease-in-out;
    animation-delay: 0.5s;
}

.menu-item:hover::before {
    opacity: 1;
}

/* Efecto de brillo en el submenú */
.sub-menu::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--menu-desplegable-bg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-item:hover .sub-menu::before {
    opacity: 1;
}

/* Efecto de glassmorphism para el header */
.acf-dynamic-header {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

.header-main {
    position: relative;
    overflow: visible;
}

/* Efecto de sombra dinámica */
.header-main::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.acf-dynamic-header:hover .header-main::after {
    opacity: 1;
}

/* ===== EFECTOS RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-top-bar {
        display: none;
    }
    
    .header-main {
        height: 70px;
    }
    
    :root {
        --logo-size: 50px;
    }
    
    .header-navigation,
    .header-buttons {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-content {
        padding-right: 60px; /* Space for mobile toggle */
    }
}

@media (max-width: 992px) {
    .header-contact-info {
        gap: 20px;
    }
    
    .header-contact-info span {
        font-size: 12px;
    }
    
    .main-menu {
        gap: 0;
    }
    
    .menu-link {
        padding: 30px 15px;
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .header-contact-info {
        gap: 25px;
    }
    
    .header-navigation {
        margin: 0 30px;
    }
}

/* ===== UTILIDADES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ajuste para el contenido principal para que no se oculte detrás del header fijo */
body {
    padding-top: var(--header-height);
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-menu {
    animation: fadeInDown 0.3s ease when visible;
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states para accesibilidad */
.menu-link:focus,
.jtdes-header-btn-primary:focus,
.jtdes-header-btn-secondary:focus,
.social-link:focus {
    outline: 2px solid var(--header-bg-color);
    outline-offset: 2px;
}

/* ===== MEJORAS VISUALES ===== */
.header-main {
    backdrop-filter: blur(10px);
}

.acf-dynamic-header {
    backdrop-filter: blur(10px);
}

/* Efecto de elevación en hover para elementos interactivos */
.menu-item:hover {
    position: relative;
}

.menu-item:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--header-bg-color);
    border-radius: 2px;
}