/* =============================================
   FONDOS TECH — Header Styles
   ============================================= */

/* ---- Main Header ---- */
.ft-header {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 4rem);
    max-width: 1320px;
    z-index: 1050;
    transition: transform var(--transition-base), top var(--transition-base), padding var(--transition-base), opacity var(--transition-base);
}

/* ---- Hidden State (Hide on Scroll Down) ---- */
.ft-header.header-hidden {
    transform: translate(-50%, -150%);
    opacity: 0;
    pointer-events: none;
}

.ft-navbar {
    background: var(--white);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

/* ---- Logo ---- */
.ft-navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ft-navbar-brand img {
    height: 2.5rem;
    width: auto;
    transition: height var(--transition-base);
}

/* ---- Navigation Links ---- */
.ft-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.ft-nav-item {
    position: relative;
}

.ft-nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--secondary-color);
    border-radius: 6.5rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-family);
}

.ft-nav-link:hover {
    color: var(--primary-color);
    background: rgba(8, 106, 216, 0.04);
}

.ft-nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--bg-light);
}

.ft-nav-link .dropdown-icon {
    width: 1.125rem;
    height: 1.125rem;
    transition: transform var(--transition-fast);
}

.ft-nav-item.ft-has-dropdown:hover .dropdown-icon,
.ft-nav-item.ft-has-dropdown.dropdown-open .dropdown-icon {
    transform: rotate(180deg);
}

/* ---- Dropdown Menus ---- */
.ft-nav-item.ft-has-dropdown {
    position: relative;
}

.ft-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    margin-top: 0.25rem;
    background: #ffffff;
    border-radius: 1rem;
    padding: 0.75rem 0.5rem;
    min-width: 220px;
    box-shadow: 0 0.75rem 2rem rgba(33, 37, 41, 0.12);
    border: 1px solid #cee4fd;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
}

/* Invisible bridge element connecting nav link to dropdown menu */
.ft-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 16px;
}

.ft-nav-item.ft-has-dropdown:hover .ft-dropdown-menu,
.ft-nav-item.ft-has-dropdown.dropdown-open .ft-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.ft-dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #394047;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ft-dropdown-item:hover {
    color: var(--primary-color);
    background: #f0f7ff;
    padding-left: 1.25rem;
}

.ft-dropdown-item.d-none,
.ft-mobile-sub-menu a.d-none,
.ft-nav-item.d-none,
.ft-mobile-accordion-item.d-none {
    display: none !important;
}

/* Scroll Lock when Mobile Navigation is active */
body.mobile-nav-active {
    overflow: hidden !important;
}

/* ---- CTA Button ---- */
.ft-header-cta {
    flex-shrink: 0;
}

/* ---- Scrolled State ---- */
.ft-header.header-scrolled {
    top: 0.75rem;
}

.ft-header.header-scrolled .ft-navbar {
    /* padding: 0.5rem 1.25rem; */
    box-shadow: var(--shadow-lg);
}

.ft-header.header-scrolled .ft-navbar-brand img {
    height: 2rem;
}

.ft-header.header-scrolled .ft-nav-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.ft-header.header-scrolled .btn-demo-outline {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* ---- Mobile Toggle ---- */
.ft-navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.ft-navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary-color);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.ft-navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.ft-navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Mobile Nav ---- */
@media (max-width: 991.98px) {
    .ft-header {
        top: 0.75rem;
        width: calc(100% - 0.1rem);
        padding: 0 1rem;
    }

    .ft-navbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        border-radius: 1.5rem;
        padding: 0.625rem 1rem;
    }

    .ft-navbar-brand {
        order: 1;
        margin-right: auto;
    }

    .ft-header-cta {
        display: none !important;
    }

    .ft-navbar-toggle {
        order: 2;
        display: flex;
        margin-left: auto;
    }

    .ft-nav {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .ft-header {
        top: 0.5rem;
        width: calc(100% - 1rem);
        padding: 0;
    }

    .ft-navbar {
        padding: 0.5rem 0.75rem;
    }

    .ft-navbar-brand img {
        height: 1.875rem;
    }

    .ft-header-cta .btn-demo-outline {
        padding: 0.35rem 0.625rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .ft-header-cta .btn-demo-outline svg {
        width: 6px;
        height: 10px;
    }
}

/* Backdrop overlay when mobile menu is active */
body.mobile-nav-active .ft-header {
    z-index: 10000 !important;
}

/* ---- Bootstrap 5 Offcanvas Mobile Drawer Styling ---- */
.ft-mobile-offcanvas {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    z-index: 1051;
}

.ft-mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.ft-mobile-menu-link:hover,
.ft-mobile-menu-link.active {
    color: #086ad8;
    background: #f0f7ff;
}

.ft-mobile-menu-link.active {
    border-left: 3px solid #086ad8;
    border-radius: 0 0.75rem 0.75rem 0;
}

.ft-mobile-sub-menu {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0 0.5rem 1rem;
    border-left: 2px solid #e0eefe;
    margin-left: 1rem;
    gap: 0.25rem;
}

.ft-mobile-sub-menu a {
    padding: 0.5rem 0.75rem;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.ft-mobile-sub-menu a:hover {
    color: #086ad8;
    background: #f8fafc;
}