/* ========================================
   CINIA - Modern Header Styles
   Bootstrap 5 + Custom Design
   ======================================== */

:root {
    --cinia-red: #ad060e;
    --cinia-dark-red: #8a0509;
    --nav-height: 80px;
}

/* Skip to Main Content */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cinia-red);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 0 0 5px 5px;
    z-index: 10000;
    font-weight: 600;
    transition: top 0.3s;
}

.skip-to-main:focus {
    top: 0;
    outline: 2px solid #fff;
}

/* Anniversary Banner */
.anniversary-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.anniversary-banner + #mainNav {
    top: 48px;
}

/* Main Navbar */
#mainNav {
    background: transparent;
    padding: 15px 0;
    transition: all 0.3s ease;
    box-shadow: none;
}

#mainNav.scrolled {
    background: rgba(255, 255, 255, 0.98);
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

/* Logo */
.navbar-brand {
    position: relative;
    padding: 0;
    display: block;
    height: 50px;
}

.navbar-brand img {
    height: 50px;
    width: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

/* Logo blanco visible por defecto (navbar transparente) */
.logo-white {
    opacity: 1;
    z-index: 2;
}

.logo-color {
    opacity: 0;
    z-index: 1;
}

/* Al hacer scroll, intercambiar logos */
#mainNav.scrolled .logo-white {
    opacity: 0;
}

#mainNav.scrolled .logo-color {
    opacity: 1;
}

/* Nav Links */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    padding: 8px 16px !important;
    transition: all 0.3s;
    position: relative;
    font-size: 15px;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--cinia-red);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus::after {
    width: 80%;
}

#mainNav.scrolled .navbar-nav .nav-link {
    color: #333;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--cinia-red);
}

/* Megamenu */
.megamenu {
    position: static;
}

.megamenu-content {
    width: 100%;
    left: 0;
    right: 0;
    border: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 40px 0;
    margin-top: 0;
    background: white;
}

.megamenu-title {
    color: var(--cinia-red);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.megamenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.megamenu-list li {
    margin-bottom: 12px;
}

.megamenu-list a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-block;
    position: relative;
    padding-left: 20px;
}

.megamenu-list a::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--cinia-red);
    opacity: 0;
    transition: all 0.3s;
}

.megamenu-list a:hover,
.megamenu-list a:focus {
    color: var(--cinia-red);
    padding-left: 25px;
}

.megamenu-list a:hover::before,
.megamenu-list a:focus::before {
    opacity: 1;
}

/* Search & Toggle Buttons */
.btn-link {
    border: none;
    background: none;
    padding: 5px;
    transition: all 0.3s;
}

.btn-link:hover,
.btn-link:focus {
    transform: scale(1.1);
}

#mainNav.scrolled .btn-link {
    color: #333 !important;
}

.navbar-toggler {
    border: 2px solid rgba(255,255,255,0.5);
    padding: 8px 12px;
    transition: all 0.3s;
}

.navbar-toggler:hover,
.navbar-toggler:focus {
    border-color: var(--cinia-red);
    background: rgba(173, 6, 14, 0.1);
}

#mainNav.scrolled .navbar-toggler {
    border-color: var(--cinia-red);
}

/* Search Modal */
#searchModal .form-control {
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 32px;
    padding: 20px 25px;
    color: white;
}

#searchModal .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

#searchModal .form-control:focus {
    border-color: var(--cinia-red);
    box-shadow: 0 0 0 0.25rem rgba(173, 6, 14, 0.25);
    background: rgba(255,255,255,0.1);
}

#searchModal .btn-outline-light {
    font-size: 18px;
    padding: 20px 30px;
}

/* Offcanvas Mobile Menu */
.offcanvas-body .nav-link {
    color: #333;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.offcanvas-body .nav-link:hover,
.offcanvas-body .nav-link:focus {
    background: rgba(173, 6, 14, 0.1);
    color: var(--cinia-red);
}

.accordion-button {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.accordion-button:not(.collapsed) {
    background: rgba(173, 6, 14, 0.05);
    color: var(--cinia-red);
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-body a {
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.accordion-body a:hover,
.accordion-body a:focus {
    color: var(--cinia-red);
    padding-left: 10px;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    animation: slideDown 0.3s ease;
}

/* Responsive */
@media (max-width: 991px) {
    .navbar-nav {
        padding: 20px 0;
    }
    
    .navbar-nav .nav-link::after {
        display: none;
    }
}

@media (max-width: 768px) {
    #searchModal .form-control {
        font-size: 24px;
        padding: 15px 20px;
    }
    
    #searchModal .btn-outline-light {
        font-size: 16px;
        padding: 15px 20px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #mainNav.scrolled .navbar-nav .nav-link {
        color: #000;
    }
    
    .megamenu-list a {
        color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

