/* ============================================================
   Carpyx — Persistent Map Header (CLEAN)
   ============================================================ */
:root {
    --carpyx-header-h: 96px;
    /* desktop : ajuste si besoin */
}

@media (max-width: 768px) {
    :root {
        --carpyx-header-h: 110px;
        /* mobile : ajuste si besoin */
    }
}

.carpyx-header {
    position: fixed;
    top: 10px;
    left: 12px;
    right: 84px;
    z-index: 2100;
    /* réserve boutons carte */

    z-index: 2100;

    display: flex;
    align-items: center;
    gap: 16px;

    padding: 12px 16px;

    background: rgba(30, 30, 30, 0.72);
    color: #f5f7fa;

    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ------------------------------------------------------------
   Logo
   ------------------------------------------------------------ */

.carpyx-header-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   Title + slogan
   ------------------------------------------------------------ */

.carpyx-header-center {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.carpyx-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
}

.carpyx-slogan {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
}

/* ------------------------------------------------------------
   Right infos
   ------------------------------------------------------------ */

.carpyx-header-right {
    margin-left: auto;

    display: flex;
    flex-direction: column;
    gap: 4px;

    text-align: right;
    font-size: 13px;
    white-space: nowrap;
}

.header-info-row {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
}

.header-info-row.sub {
    font-size: 13px;
    opacity: 0.9;
}

/* ============================================================
   Mobile adjustments
   ============================================================ */

@media (max-width: 768px) {

    .carpyx-header {
        top: 6px;
        left: 8px;
        right: 72px;
        padding: 10px 12px;

        flex-wrap: wrap;
        gap: 10px;
    }

    /* Logo + title SAME LINE */
    .carpyx-header-logo {
        width: 44px;
        height: 44px;
    }

    .carpyx-header-center {
        flex: 1;
    }

    .carpyx-title {
        font-size: 16px;
    }

    .carpyx-slogan {
        font-size: 12px;
    }

    /* Infos go UNDER, not giant */
    .carpyx-header-right {
        width: 100%;
        text-align: left;
    }

    .header-info-row {
        justify-content: flex-start;
        gap: 12px;
    }
}

/* ============================================================
   Push carto buttons under header
   ============================================================ */

.carto-controls {
    top: 10px;
}

/* ============================================================
   Desktop — tighten logo padding to allow bigger logo
   ============================================================ */

@media (min-width: 769px) {

    .carpyx-header {
        padding-top: 1px;
        padding-bottom: 1px;
        padding-left: 0;
        /* moins de marge à gauche */
    }

    .carpyx-header-logo {
        width: 128px;
        /* + gros */
        height: 128px;
        margin: -15px 0;
        /* ⬅️ clé : mange l’espace vertical */
    }
}

/* ============================================================
   Mobile — tighten header & enlarge logo (same logic as desktop)
   ============================================================ */

@media (max-width: 768px) {

    .carpyx-header {
        padding-top: 4px;
        padding-bottom: 4px;
        padding-left: 6px;
        padding-right: 10px;
        gap: 10px;
    }

    /* Logo bigger without increasing header height */
    .carpyx-header-logo {
        width: 72px;
        height: 72px;
        margin: 0px 0;
        /* mange l’espace vertical */
    }

    /* Keep logo + title aligned horizontally */
    .carpyx-header-left {
        align-items: center;
    }

    .carpyx-header-center {
        gap: 1px;
    }

    .carpyx-title {
        font-size: 15px;
        line-height: 1.1;
    }

    .carpyx-slogan {
        font-size: 12px;
        line-height: 1.2;
    }

    /* Right infos stay compact, no stacking explosion */
    .carpyx-header-right {
        font-size: 12px;
        gap: 2px;
    }
}

:root {
    --carpyx-header-height: 90px;
}

.baselayers-content {
    margin-top: 0;
    position: absolute;
    top: calc(var(--carpyx-header-height) + 12px);
}