/**
 * APB Site Header widget — CSS scoped .apb-site-header*
 * Cloné depuis apb-admin-mockup.css règles .atop* + .logo + .lang-switch + boutons.
 * Variables CSS overridables via controls Bricks (style tab).
 */

.apb-site-header {
    --apb-sh-bg:        #FFFFFF;
    --apb-sh-text:      #334155;
    --apb-sh-text-on:   #0F172A;
    --apb-sh-line:      #E7E3D9;
    --apb-sh-brand:     #0B2A4A;
    --apb-sh-brand-soft:#EBF3FB;
    --apb-sh-accent:    #F59E0B;
    --apb-sh-accent-2:  #E88B05;
    --apb-sh-bg-soft:   #F4F2EC;
    --apb-sh-danger:    #DC2626;
    --apb-sh-danger-bg: #FCA5A5;
    --apb-sh-height:    auto;
    --apb-sh-max-w:     1240px;

    background: var(--apb-sh-bg);
    border-bottom: 1px solid var(--apb-sh-line);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--apb-sh-text);
    width: 100%;
    box-sizing: border-box;
}

.apb-site-header.is-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
}

.apb-site-header__inner {
    max-width: var(--apb-sh-max-w);
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.apb-site-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--apb-sh-text-on);
    font-weight: 900;
    letter-spacing: 0.02em;
    font-size: 18px;
    flex-shrink: 0;
}

.apb-site-header__logo:hover {
    color: var(--apb-sh-text-on);
}

.apb-site-header__logo img {
    display: block;
    max-height: 40px;
    width: auto;
}

.apb-site-header__logo-text .dot {
    color: var(--apb-sh-accent);
    margin: 0 1px;
}

.apb-site-header__nav {
    display: flex;
    gap: 22px;
    font-size: 14px;
    color: var(--apb-sh-text);
    margin-left: auto;
}

.apb-site-header__nav a {
    color: var(--apb-sh-text);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.12s;
}

.apb-site-header__nav a:hover {
    color: var(--apb-sh-text-on);
}

.apb-site-header__nav a.is-current {
    color: var(--apb-sh-text-on);
    font-weight: 600;
}

.apb-site-header__actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.apb-site-header__lang {
    display: inline-flex;
    border: 1px solid var(--apb-sh-line);
    border-radius: 999px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
}

.apb-site-header__lang a {
    padding: 6px 10px;
    color: #64748B;
    background: transparent;
    text-decoration: none;
    line-height: 1;
    display: inline-block;
    transition: background 0.12s;
}

.apb-site-header__lang a.on,
.apb-site-header__lang a.is-current {
    background: var(--apb-sh-brand);
    color: #FFFFFF;
}

/* ───── Boutons ───── */
.apb-site-header__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.apb-site-header__btn--ghost {
    background: transparent;
    color: var(--apb-sh-text);
}

.apb-site-header__btn--ghost:hover {
    background: var(--apb-sh-bg-soft);
    color: var(--apb-sh-text-on);
}

.apb-site-header__btn--outline {
    background: #FFFFFF;
    border-color: var(--apb-sh-line);
    color: var(--apb-sh-text);
}

.apb-site-header__btn--outline:hover {
    border-color: #94A3B8;
    color: var(--apb-sh-text-on);
}

.apb-site-header__btn--primary {
    background: linear-gradient(135deg, var(--apb-sh-accent), var(--apb-sh-accent-2));
    color: #1A1204;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.apb-site-header__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    color: #1A1204;
}

.apb-site-header__btn--danger {
    background: #FFFFFF;
    border-color: var(--apb-sh-danger-bg);
    color: var(--apb-sh-danger);
}

.apb-site-header__btn--danger:hover {
    background: #FEF2F2;
    color: var(--apb-sh-danger);
}

/* ───── Mobile hamburger ───── */
.apb-site-header__mobile {
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--apb-sh-line);
    background: #FFFFFF;
    color: var(--apb-sh-text-on);
    cursor: pointer;
    flex-shrink: 0;
}

.apb-site-header__mobile svg {
    width: 18px;
    height: 18px;
}

/* ───── Drawer mobile ───── */
.apb-site-header__drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
}

.apb-site-header__drawer.is-open {
    display: block;
}

.apb-site-header__drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.apb-site-header__drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: min(80vw, 320px);
    background: #FFFFFF;
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.18);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}

.apb-site-header__drawer.is-open .apb-site-header__drawer-panel {
    transform: translateX(0);
}

.apb-site-header__drawer-close {
    align-self: flex-end;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--apb-sh-line);
    background: #FFFFFF;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.apb-site-header__drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.apb-site-header__drawer-nav a {
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--apb-sh-text-on);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.apb-site-header__drawer-nav a:hover {
    background: var(--apb-sh-bg-soft);
}

.apb-site-header__drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--apb-sh-line);
}

.apb-site-header__drawer-actions .apb-site-header__btn {
    justify-content: center;
}

/* ───── Responsive 980px ───── */
@media (max-width: 980px) {
    .apb-site-header__nav {
        display: none;
    }
    .apb-site-header__mobile {
        display: grid;
    }
    .apb-site-header__inner {
        padding: 12px 16px;
        gap: 12px;
    }
    .apb-site-header__actions .apb-site-header__btn {
        display: none;
    }
    /* Garde les pills lang + 1 CTA primary visible sur mobile, le reste va dans drawer */
    .apb-site-header__actions .apb-site-header__btn--primary {
        display: inline-flex;
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 540px) {
    .apb-site-header__lang {
        font-size: 11px;
    }
    .apb-site-header__lang a {
        padding: 5px 7px;
    }
    .apb-site-header__logo {
        font-size: 16px;
    }
}
