/* =================================================================
   _NAV.CSS - Navegación Unificada (Source: Index)
   ================================================================= */

/* -----------------------------------------------------------------
   BARRA PRINCIPAL
   ----------------------------------------------------------------- */
.main-nav-dynamic {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height-mobile);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-slow) var(--ease-out);
    background: transparent;
    border-bottom: 1px solid var(--border-on-dark);
    color: var(--text-on-dark);
}

@media (min-width: 1024px) {
    .main-nav-dynamic {
        height: var(--nav-height-desktop);
    }
}

/* Estado scrolled */
.main-nav-dynamic.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--nav-height-scrolled-mobile);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
    .main-nav-dynamic.scrolled {
        height: var(--nav-height-scrolled-desktop);
    }
}

/* -----------------------------------------------------------------
   NAV WRAPPER
   ----------------------------------------------------------------- */
.nav-wrapper {
    width: 100%;
    max-width: 1400px;
    padding: 0 var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

@media (min-width: 768px) {
    .nav-wrapper {
        padding: 0 var(--space-8);
    }
}

/* -----------------------------------------------------------------
   LOGO (Image)
   ----------------------------------------------------------------- */
.nav-logo {
    text-decoration: none;
    color: inherit;
    transition: opacity var(--duration-normal);
    padding-right: 0;
    border-right: none;
    display: flex;
    align-items: center;
    max-width: 115px;
    mix-blend-mode: exclusion;
}

.nav-logo img {
    height: 24px;
    width: auto;
}

@media (min-width: 1024px) {
    .nav-logo {
        padding-right: var(--space-8);
        border-right: 1px solid var(--border-on-dark);
    }

    .nav-logo img {
        height: 28px;
    }
}

.scrolled .nav-logo {
    border-right-color: var(--border-medium);
}

.nav-logo:hover {
    opacity: 0.7;
}

/* -----------------------------------------------------------------
   NAV LINKS
   ----------------------------------------------------------------- */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

@media (min-width: 1280px) {
    .nav-links {
        gap: var(--space-12);
    }
}

/* -----------------------------------------------------------------
   NAV ITEM
   ----------------------------------------------------------------- */
.nav-item {
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: inherit;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--space-2) 0;
    position: relative;
    opacity: 0.8;
    transition: all var(--duration-normal) ease;
}

.nav-item:hover,
.nav-item.active,
.nav-item-dropdown:hover .nav-item {
    opacity: 1;
}

/* Dot indicator */
.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    transition: transform var(--duration-normal) ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    transform: translateX(-50%) scale(1);
}

/* -----------------------------------------------------------------
   DROPDOWN
   ----------------------------------------------------------------- */
.nav-item-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: calc(100%);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text-on-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-fast) ease-in-out;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--text-on-dark);
    border-left: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.8rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: all var(--duration-fast) ease;
}

.dropdown-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

/* Estado activo para servicio actual */
.dropdown-link.active {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    font-weight: var(--font-bold);
}

/* -----------------------------------------------------------------
   CTA BUTTON
   ----------------------------------------------------------------- */
.nav-cta-btn {
    font-family: var(--font-family);
    font-size: var(--text-caption);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--duration-normal) ease;
    background: transparent;
    color: var(--text-on-dark);
    border: 1px solid var(--border-medium-on-dark);
}

@media (min-width: 1024px) {
    .nav-cta-btn {
        padding: 0.7rem 1.8rem;
    }
}

.nav-cta-btn:hover {
    background: var(--text-on-dark);
    color: var(--text-primary);
    border-color: var(--text-on-dark);
}

/* Scrolled state */
.scrolled .nav-cta-btn {
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.scrolled .nav-cta-btn:hover {
    background: var(--text-primary);
    color: var(--text-on-dark);
    border-color: var(--text-primary);
}

/* -----------------------------------------------------------------
   MOBILE TOGGLE - Hamburger to X Animation
   ----------------------------------------------------------------- */
.nav-mobile-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    z-index: 250;
    position: relative;
}

@media (min-width: 1024px) {
    .nav-mobile-toggle {
        display: none;
    }
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: absolute;
}

.hamburger-line:first-child {
    transform: translateY(-6px);
}

.hamburger-line:last-child {
    transform: translateY(6px);
}

/* Hamburger → X Animation when menu is open */
.nav-mobile-toggle.is-active .hamburger-line:first-child {
    transform: rotate(45deg);
}

.nav-mobile-toggle.is-active .hamburger-line:last-child {
    transform: rotate(-45deg);
}

/* =================================================================
   MOBILE MENU - CLEAN CSS ONLY (No Tailwind Dependencies)
   ================================================================= */
.mobile-menu {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport for mobile browsers */
    background-color: #FDFDFD;
    z-index: 200;

    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* Initially hidden */
    visibility: hidden;
    opacity: 0;
    transform: translateX(100%);

    /* Smooth transition */
    transition:
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease,
        visibility 0s linear 0.4s;
}

/* Active state - visible */
.mobile-menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition:
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease,
        visibility 0s linear 0s;
}

/* Hide on desktop */
@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}

/* -----------------------------------------------------------------
   MOBILE MENU - CLOSE BUTTON
   ----------------------------------------------------------------- */
.mobile-menu__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    padding: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #121212;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu__close:hover {
    transform: scale(1.1);
}

.mobile-menu__close svg {
    width: 24px;
    height: 24px;
}

/* -----------------------------------------------------------------
   MOBILE MENU - NAVIGATION
   ----------------------------------------------------------------- */
.mobile-menu__nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.mobile-menu__link {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.2;
}

/* Primary links - larger */
.mobile-menu__link--primary {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    color: #121212;
}

.mobile-menu__link--primary:hover {
    color: #7A7E51;
}

/* Service links - smaller */
.mobile-menu__link--service {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 700;
    color: #6B7280;
}

.mobile-menu__link--service:hover {
    color: #121212;
}

/* -----------------------------------------------------------------
   MOBILE MENU - SOCIAL LINKS
   ----------------------------------------------------------------- */
.mobile-menu__social {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 32px;
}

.mobile-menu__social a {
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4B5563;
    /* Darkened from #9CA3AF for better contrast on white background */
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-menu__social a:hover {
    color: #121212;
}

/* -----------------------------------------------------------------
   MOBILE MENU - SERVICES ACCORDION
   ----------------------------------------------------------------- */
.mobile-menu__accordion {
    width: 100%;
    text-align: center;
}

.mobile-menu__accordion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #121212;
    padding: 0;
    transition: color 0.3s ease;
}

.mobile-menu__accordion-btn:hover {
    color: #7A7E51;
}

.mobile-menu__accordion-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.mobile-menu__accordion.is-expanded .mobile-menu__accordion-icon {
    transform: rotate(180deg);
}

.mobile-menu__accordion-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0;
}

.mobile-menu__accordion.is-expanded .mobile-menu__accordion-content {
    max-height: 300px;
    padding-top: 16px;
}

.mobile-menu__accordion-content a {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #6B7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-menu__accordion-content a:hover {
    color: #121212;
}

/* =================================================================
   LEGACY SUPPORT - For existing #mobileMenu elements
   ================================================================= */
#mobileMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #FDFDFD;
    z-index: 200;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    visibility: hidden;
    opacity: 0;
    transform: translateX(100%);

    transition:
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease,
        visibility 0s linear 0.4s;
}

#mobileMenu.active,
#mobileMenu.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
    transition:
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.3s ease,
        visibility 0s linear 0s;
}

@media (min-width: 1024px) {
    #mobileMenu {
        display: none !important;
    }
}

#closeMobileMenu {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    padding: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #121212;
    transition: transform 0.2s ease;
}

#closeMobileMenu:hover {
    transform: scale(1.1);
}

#closeMobileMenu svg {
    width: 24px;
    height: 24px;
}

#mobileMenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

#mobileMenu .nav-mobile-link {
    display: block;
    font-family: 'Manrope', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.2;
}