/* =========================================================
   Navbar Component — EGL Global Header
   Classes use BEM: egl-navbar__*
   ========================================================= */

.egl-navbar {
    background: white;
    border-bottom: 1px solid var(--color-grey-20);
    position: sticky;
    top: 0;
    z-index: 50;
}

.egl-navbar__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.egl-navbar__logo {
    height: 32px;
    width: auto;
}

.egl-navbar__logo-link {
    flex-shrink: 0;
}

/* ── Desktop Nav ── */
.egl-navbar__desktop-nav {
    display: none;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

@media (min-width: 1024px) {
    .egl-navbar__desktop-nav {
        display: flex;
    }
}

.egl-navbar__link {
    text-decoration: none;
    color: var(--color-grey-50);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.egl-navbar__link:hover {
    color: var(--color-grey-80);
}

/* ── Right Actions ── */
.egl-navbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Language Toggle ── */
.egl-navbar__lang-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-grey-50);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
    border-radius: 0.5rem;
}

.egl-navbar__lang-toggle:hover {
    color: var(--color-grey-80);
    background: var(--color-grey-5);
}

@media (min-width: 1024px) {
    .egl-navbar__lang-toggle {
        display: flex;
    }
}

/* ── CTA Button ── */
/* Use .egl-navbar ancestor for higher specificity than base.css `body a { color: inherit }` */
.egl-navbar .egl-navbar__cta {
    display: none;
    padding: 0.5rem 1.125rem;
    background-color: #00724f;
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5rem;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    opacity: 1;
}

.egl-navbar .egl-navbar__cta:hover {
    background-color: #005c3f;
    color: #fff;
    opacity: 1;
}

@media (min-width: 1024px) {
    .egl-navbar .egl-navbar__cta {
        display: inline-flex;
        align-items: center;
    }
}

/* ── Hamburger ── */
.egl-navbar__mobile-toggle {
    background: var(--color-grey-10);
    border: none;
    color: var(--color-grey-80);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.egl-navbar__mobile-toggle:hover {
    background: var(--color-grey-20);
}

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

/* ── Mobile Slide-over Panel ── */
.egl-navbar__mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 60;
    visibility: hidden;
    transition: visibility 0s 0.3s;
}

.egl-navbar__mobile-panel.active {
    visibility: visible;
    transition: visibility 0s 0s;
}

/* Backdrop */
.egl-navbar__mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.egl-navbar__mobile-panel.active .egl-navbar__mobile-backdrop {
    background: rgba(0, 0, 0, 0.3);
}

/* Panel content — slides from right */
.egl-navbar__mobile-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(24rem, 85vw);
    background: #fff;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.egl-navbar__mobile-panel.active .egl-navbar__mobile-panel-content {
    transform: translateX(0);
}

/* RTL: slide from left */
[dir="rtl"] .egl-navbar__mobile-panel-content {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .egl-navbar__mobile-panel.active .egl-navbar__mobile-panel-content {
    transform: translateX(0);
}

/* Panel header */
.egl-navbar__mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.egl-navbar__mobile-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-grey-50);
    border-radius: 0.5rem;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
}

.egl-navbar__mobile-close:hover {
    background: var(--color-grey-5);
    color: var(--color-grey-80);
}

/* CTA in mobile panel */
.egl-navbar__cta--mobile {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

/* Mobile nav links */
.egl-navbar__mobile-nav {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-grey-20);
}

.egl-navbar__mobile-link {
    display: block;
    padding: 0.75rem 0;
    color: var(--color-grey-80);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid var(--color-grey-10);
    transition: color 0.2s;
}

.egl-navbar__mobile-link:hover {
    color: #00724f;
}

/* Lang toggle inside mobile panel */
.egl-navbar__lang-toggle--mobile {
    display: flex;
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-grey-20);
    margin-top: 1.25rem;
}