/**
 * Navbar Component - Dark Glassmorphism Design
 * Navbar oscuro elegante con efecto glassmorphism
 */

/* ============================================
   NAVBAR PRINCIPAL
   ============================================ */

.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(249, 115, 22, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado al hacer scroll - más opaco */
.navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    border-bottom-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* ============================================
   LOGO
   ============================================ */

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1101;
    position: relative;
}

.navbar-logo:hover {
    transform: translateY(-2px);
}

.navbar-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.navbar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 0.125rem;
}

.navbar-logo-brand {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    font-style: italic;
    color: #e5e7eb;
    letter-spacing: -0.02em;
}

.navbar-logo-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    font-style: italic;
    color: #f97316;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: rgba(10, 10, 10, 0.95) !important;
    }
    
    .navbar-container {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
    }
    
    .navbar-logo {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 40px;
        width: auto;
        z-index: 1101;
        order: 1;
    }
    
    .navbar-logo-img {
        height: 40px;
        width: auto;
        display: block !important;
    }
    
    .navbar-logo-brand {
        font-size: 1rem;
    }
    
    .navbar-logo-subtitle {
        font-size: 0.625rem;
    }
    
    .navbar-phone {
        order: 2;
        flex: 1;
        justify-content: center;
    }
    
    /* Ocultar menú desktop */
    .navbar-menu,
    .navbar-cta,
    .navbar-lang-switcher {
        display: none !important;
    }
    
    /* Mostrar botón hamburguesa */
    .navbar-toggle,
    .hamburger-btn {
        display: flex !important;
        order: 3;
    }
}

@media (max-width: 640px) {
    .navbar-logo-text {
        display: none;
    }
}

/* ============================================
   MENÚ CENTRAL
   ============================================ */

.navbar-menu {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1024px) {
    .navbar-menu {
        display: flex;
    }
}

.navbar-link {
    position: relative;
    padding: 0.75rem 1rem;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-link:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

/* Estado Activo - con subrayado naranja */
.navbar-link.active {
    color: #f97316;
}

.navbar-link.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: #f97316;
    border-radius: 2px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 30px;
        opacity: 1;
    }
}

/* ============================================
   CTA BUTTON
   ============================================ */

.navbar-cta {
    display: none;
    padding: 0.875rem 2rem;
    background: #f97316;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .navbar-cta {
        display: inline-block;
    }
}

.navbar-cta:hover {
    background: #ea6c0a !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.navbar-cta:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================
   MOBILE TOGGLE BUTTON (Hamburguesa)
   ============================================ */

.navbar-toggle,
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 2001;
    position: relative;
}

@media (min-width: 1024px) {
    .navbar-toggle,
    .hamburger-btn {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .navbar-toggle,
    .hamburger-btn {
        display: flex !important;
    }
}

.navbar-toggle span,
.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Cuando el menú está abierto, las líneas forman X */
.navbar-toggle.active span,
.hamburger-btn.active span {
    background: #f97316;
}

.navbar-toggle.active span:nth-child(1),
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.navbar-toggle.active span:nth-child(2),
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3),
.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   MOBILE MENU
   ============================================ */

/* Overlay oscuro detrás del menú */
.navbar-mobile-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - 64px);
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
    pointer-events: none;
}

.navbar-mobile-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (min-width: 1024px) {
    .navbar-mobile-overlay {
        display: none !important;
    }
}

/* Menú mobile - Fullscreen desde la derecha */
.navbar-mobile-menu,
.nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 24px 16px;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(249, 115, 22, 0.2);
}

.navbar-mobile-menu.open,
.nav-links.open {
    display: flex;
}

/* Ocultar en desktop */
@media (min-width: 1024px) {
    .navbar-mobile-menu,
    .nav-links,
    .navbar-mobile-overlay {
        display: none !important;
    }
}

/* Enlaces del menú mobile */
.navbar-mobile-link,
.nav-links a {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    text-align: left;
    width: 100%;
}

.navbar-mobile-link:hover,
.navbar-mobile-link.active,
.nav-links a:hover,
.nav-links a.active {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

/* CTA del menú mobile */
.navbar-mobile-cta,
.nav-links .btn-vender {
    margin-top: 8px;
    padding: 14px;
    background: #f97316;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.navbar-mobile-cta:hover {
    background: #ea6c0a !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.navbar-mobile-cta:active {
    transform: scale(0.98);
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
    .navbar-mobile-link {
        font-size: 1.1rem;
        padding: 14px 16px;
    }
    
    .navbar-mobile-cta {
        font-size: 1.1rem;
        padding: 14px;
    }
}

/* ============================================
   ANIMACIONES Y TRANSICIONES
   ============================================ */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar {
    animation: fadeInDown 0.6s ease-out;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Compensar el espacio del navbar fijo */
body {
    padding-top: 64px;
}

@media (max-width: 1023px) {
    .navbar {
        padding: 1rem 1.5rem;
    }
    
    body {
        padding-top: 64px;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 12px 16px;
    }
    
    body {
        padding-top: 64px;
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .navbar,
    .navbar-link,
    .navbar-cta,
    .navbar-mobile-menu,
    .navbar-toggle span {
        transition: none;
        animation: none;
    }
}

/* Focus visible para accesibilidad */
.navbar-link:focus-visible,
.navbar-cta:focus-visible,
.navbar-mobile-link:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}


/* ============================================
   PHONE NUMBER
   ============================================ */

.navbar-phone {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #e5e7eb;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-phone:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

/* Mostrar en mobile entre logo y hamburguesa */
@media (max-width: 1023px) {
    .navbar-phone {
        display: flex;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        order: 2;
    }
    
    .navbar-logo {
        order: 1;
    }
    
    .navbar-toggle,
    .hamburger-btn {
        order: 3;
    }
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */

.navbar-lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 8px;
    color: #f97316;
    font-weight: 600;
    font-size: 1.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 44px;
    height: 44px;
}

.navbar-lang-switcher:hover {
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(249, 115, 22, 0.5);
    transform: translateY(-2px);
}

.navbar-lang-switcher:active {
    transform: translateY(0);
}

.lang-combined {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.lang-globe {
    font-size: 1.5rem;
    line-height: 1;
}

.lang-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 2px;
    padding: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    overflow: hidden;
}

.lang-badge img {
    display: block;
    object-fit: cover;
}

.lang-flag {
    display: none;
}

/* Responsive - ocultar en mobile */
@media (max-width: 1023px) {
    .navbar-lang-switcher {
        display: none;
    }
}
