/* LibraDesk — Modern Header */
.ld-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    float: none !important;
    clear: both;
}

.ld-header.is-scrolled {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: #e2e8f0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.ld-header .container.ld-header-inner {
    float: none !important;
    width: 100%;
    max-width: 1170px;
    margin-left: auto;
    margin-right: auto;
}

.ld-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding-top: 10px;
    padding-bottom: 10px;
    position: relative;
}

/* Logo */
.ld-header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none !important;
    z-index: 2;
    float: none !important;
    width: auto !important;
    padding: 0 !important;
    text-align: left !important;
}

.ld-header-logo img {
    height: 44px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

/* Desktop navigation */
.ld-header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ld-header-nav > ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    float: none !important;
}

.ld-header-nav > ul > li {
    list-style: none;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ld-header-nav > ul > li > a {
    display: block;
    padding: 10px 14px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #475569 !important;
    text-decoration: none !important;
    text-transform: capitalize;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
    float: none !important;
    width: auto !important;
    line-height: 1.4 !important;
}

.ld-header-nav > ul > li > a::before {
    display: none !important;
}

.ld-header-nav > ul > li > a:hover {
    color: #00aff0 !important;
    background: #e8f7fd;
}

.ld-header-nav > ul > li.active > a {
    color: #00aff0 !important;
    background: #e8f7fd;
}

.ld-header-nav > ul > li.active > a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 100px;
    background: #00aff0;
}

/* CTA buttons */
.ld-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ld-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 100px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    cursor: pointer;
    float: none !important;
}

.ld-header-btn--ghost {
    background: #fff;
    color: #1e293b !important;
    border-color: #e2e8f0;
}

.ld-header-btn--ghost:hover {
    border-color: #1e293b;
    background: #f8fafc;
}

.ld-header-btn--primary {
    background: linear-gradient(135deg, #00aff0 0%, #0077b6 100%);
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(0, 175, 240, 0.35);
}

.ld-header-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 175, 240, 0.45);
}

/* Mobile toggle */
.ld-header-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    z-index: 1042;
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.ld-header-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #334155;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ld-header-toggle.is-open {
    position: relative;
    z-index: 10055;
    border-color: #00aff0;
}

.ld-header-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ld-header-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.ld-header-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu — rendered outside header */
.ld-header-mobile {
    position: fixed;
    inset: 0;
    z-index: 10050;
    pointer-events: none;
    visibility: hidden;
}

.ld-header-mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ld-header-mobile-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(300px, 85vw);
    height: 100%;
    height: 100dvh;
    background: #fff;
    box-shadow: -8px 0 40px rgba(15, 23, 42, 0.2);
    padding: 20px 20px 32px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ld-header-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.ld-header-mobile-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.ld-header-mobile-close {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ld-header-mobile-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.ld-header-mobile.is-open {
    pointer-events: auto;
    visibility: visible;
}

.ld-header-mobile.is-open .ld-header-mobile-backdrop {
    opacity: 1;
}

.ld-header-mobile.is-open .ld-header-mobile-panel {
    transform: translateX(0);
}

.ld-header-mobile-nav {
    flex: 1;
}

.ld-header-mobile-nav ul {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.ld-header-mobile-nav ul li {
    border-bottom: 1px solid #f1f5f9;
}

.ld-header-mobile-nav ul li a {
    display: block;
    padding: 15px 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #334155 !important;
    text-decoration: none !important;
}

.ld-header-mobile-nav ul li.active a,
.ld-header-mobile-nav ul li a:active {
    color: #00aff0 !important;
}

.ld-header-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.ld-header-mobile-actions .ld-header-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
}

body.ld-menu-open {
    overflow: hidden;
    touch-action: none;
}

/* Responsive */
@media (max-width: 991px) {
    .ld-header-nav,
    .ld-header-actions {
        display: none !important;
    }

    .ld-header-toggle {
        display: flex !important;
    }

    .ld-header-inner {
        min-height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .ld-header .container.ld-header-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ld-header-logo {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 52px);
    }

    .ld-header-logo img {
        height: 36px;
        max-width: 100%;
    }
}

@media (min-width: 992px) {
    .ld-header-mobile {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ld-header-mobile-panel,
    .ld-header-mobile-backdrop,
    .ld-header-toggle span {
        transition: none;
    }
}
