.ecla-header {
    background : var(--header-bg, #2e7d32);
    border-bottom : 3px solid var(--primary-color);
    padding : 12px 16px;
    margin-bottom : 18px;
    border-radius : 8px;
    box-shadow : 0 2px 12px rgba(0, 0, 0, 0.18);
}
/* Bannière du vendeur connecté en arrière-plan du header (appliquée par connexion.js
   via un style inline `background-image`). En l'absence de bannière, le fond vert
   ci-dessus reste le fallback. Le voile sombre du dégradé préserve la lisibilité du
   texte et des boutons blancs, dont le style propre reste inchangé. */
.ecla-header--has-banner {
    background-size : cover;
    background-position : center;
    background-repeat : no-repeat;
}
/* Option « Header fixe au défilement » (réglage backend ecla_stop_header) : quand elle est
   active, le header ET la navigation rapide (enrobés dans .ecla-sticky-top) restent collés en
   haut du catalogue pendant le défilement. Le z-index passe au-dessus des cartes (z-index:5)
   mais reste sous les feuilles de filtres mobiles et les modales (z-index >= 99997). Le fond
   opaque évite toute transparence sous la nav rapide (fond translucide sur mobile). */
.ecla-sticky-top {
    position : sticky;
    top : 0;
    z-index : 1000;
    background : var(--bg-color, #e3f2fd);
}
.ecla-header-inner {
    display : flex;
    align-items : center;
    gap : 16px;
    flex-wrap : wrap;
}
.ecla-header-brand {
    display : flex;
    align-items : center;
    gap : 8px;
    flex : 0 1 auto;
    min-width : 0;
    order : 1;
}
.ecla-logo-link {
    display : inline-flex;
    align-items : center;
    gap : 10px;
    min-width : 0;
    text-decoration : none;
}
.ecla-logo-img {
    max-height : 52px; /* agrandi pour s'aligner sur la taille du nom « BusyBook » */
    max-width : 175px;
    width : auto;
    height : auto;
    object-fit : contain;
    display : block;
    filter : drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}
.ecla-brand-name {
    color : var(--primary-color, #e07800); /* orange de la marque (s'adapte au thème sombre) */
    font-size : 1.9rem; /* +2 crans par rapport à 1.45rem */
    font-weight : 900;
    white-space : nowrap;
    letter-spacing : -0.01em;
    text-shadow : 0 1px 3px rgba(0,0,0,0.20);
    /* Le nom occupe l'espace disponible à côté du logo et n'est JAMAIS tronqué :
       le script d'ajustement du header réduit automatiquement la police pour tout afficher. */
    flex : 0 1 auto;
    min-width : 0;
    overflow : hidden;
    /* Étirement vertical demandé (les lettres s'allongent vers le haut ET le bas) : la
       largeur ne change pas, donc la mesure d'ajustement anti-troncature n'est pas
       affectée (les transforms sont hors du flux de layout). */
    transform : scaleY(1.5);
    transform-origin : center;
}
.ecla-logo-text,
.ecla-header-brand h1 {
    color : var(--header-text, #fff);
    font-size : 1.4rem;
    font-weight : 800;
    margin : 0;
    white-space : nowrap;
}
.ecla-logo {
    font-size : 28px;
    line-height : 1;
}
.ecla-header-controls {
    display : flex;
    align-items : center;
    gap : 10px;
    flex : 1;
    min-width : 0;
    order : 2;
}
#ecla-connexion-btn-container {
    order : 3;
    flex-shrink : 0;
}
.ecla-search-container {
    position : relative;
    flex-grow : 1;
    min-width : 0;
}
#ecla-search-input {
    width : 100%;
    padding : 6px 34px 6px 12px;
    border : 1.5px solid rgba(255,255,255,0.5);
    border-radius : 16px;
    font-size : 14px;
    outline : none;
    transition : border-color 0.2s, box-shadow 0.2s;
    box-sizing : border-box;
    background : rgba(255,255,255,0.95);
    color : #333;
}
#ecla-search-input::-webkit-search-cancel-button,
#ecla-search-input::-webkit-search-decoration {
    -webkit-appearance : none;
    appearance : none;
}
.ecla-search-clear {
    position : absolute;
    top : 50%;
    right : 8px;
    transform : translateY(-50%);
    display : none;
    align-items : center;
    justify-content : center;
    width : 20px;
    height : 20px;
    padding : 0;
    border : none;
    border-radius : 50%;
    background : rgba(0,0,0,0.18);
    color : #fff;
    font-size : 16px;
    line-height : 1;
    cursor : pointer;
    z-index : 1011;
    transition : background 0.2s;
}
.ecla-search-clear:hover {
    background : rgba(0,0,0,0.34);
}
#ecla-search-input:not(:placeholder-shown) ~ .ecla-search-clear {
    display : flex;
}
#ecla-search-input::placeholder {
    color : #888;
}
#ecla-search-input:focus {
    border-color : var(--primary-color);
    box-shadow : 0 0 0 3px rgba(255,153,0,0.25);
    background : #fff;
}
#ecla-search-suggestions {
    position : absolute;
    top : calc(100% + 4px);
    left : 0;
    right : 0;
    background : #fff;
    border : 1px solid #ddd;
    border-radius : 8px;
    z-index : 1010;
    max-height : 250px;
    overflow-y : auto;
    display : none;
    box-shadow : 0 4px 12px rgba(0, 0, 0, 0.1);
}
#ecla-search-suggestions div {
    padding : 10px 14px;
    cursor : pointer;
    font-size : 14px;
}
#ecla-search-suggestions div:hover {
    background : #f5f5f5;
}
#ecla-theme-toggle {
    flex-shrink : 0;
    background : rgba(255,255,255,0.15);
    border : 1px solid rgba(255,255,255,0.4);
    border-radius : 50%;
    width : 38px;
    height : 38px;
    font-size : 18px;
    cursor : pointer;
    display : flex;
    align-items : center;
    justify-content: center;
    transition : background 0.2s;
    color : #fff;
}
#ecla-theme-toggle:hover {
    background : rgba(255,255,255,0.28);
}
#ecla-wishlist-toggle {
    flex-shrink : 0;
    background : rgba(255,255,255,0.15);
    border : 1px solid rgba(255,255,255,0.4);
    border-radius : 20px;
    padding : 5px 10px;
    font-size : 16px;
    cursor : pointer;
    display : flex;
    align-items : center;
    gap : 4px;
    transition : background 0.2s;
    position : relative;
    white-space : nowrap;
    color : #fff;
}
#ecla-wishlist-toggle:hover {
    background : rgba(255,255,255,0.28);
}
#ecla-refresh-catalog {
    flex-shrink : 0;
    background : rgba(255,255,255,0.15);
    border : 1px solid rgba(255,255,255,0.4);
    border-radius : 50%;
    width : 38px;
    height : 38px;
    font-size : 18px;
    cursor : pointer;
    display : flex;
    align-items : center;
    justify-content : center;
    transition : background 0.2s;
    color : #fff;
}
#ecla-refresh-catalog:hover {
    background : rgba(255,255,255,0.28);
}
#ecla-refresh-catalog:disabled {
    cursor : not-allowed;
    opacity : 0.75;
}
#ecla-refresh-catalog.is-refreshing svg {
    animation : ecla-refresh-spin 0.8s linear infinite;
}
#ecla-pwa-install-btn {
    flex-shrink : 0;
    display : none;
    background : rgba(255,255,255,0.15);
    border : 1px solid rgba(255,255,255,0.4);
    border-radius : 20px;
    width : auto;
    height : 38px;
    padding : 0 14px 0 12px;
    font-size : 13px;
    font-weight : 700;
    cursor : pointer;
    align-items : center;
    justify-content : center;
    transition : background 0.2s;
    color : #fff;
    white-space : nowrap;
}
#ecla-pwa-install-btn.is-visible {
    display : flex;
}
#ecla-pwa-install-btn:hover {
    background : rgba(255,255,255,0.28);
}
#ecla-pwa-btn-install {
    display : flex;
    align-items : center;
    justify-content : center;
    gap : 6px;
}
#ecla-pwa-btn-install svg {
    flex-shrink : 0;
    pointer-events : none;
}
#ecla-pwa-btn-text {
    line-height : 1;
    pointer-events : none;
}
@keyframes ecla-refresh-spin {
    from { transform : rotate(0deg); }
    to   { transform : rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    #ecla-refresh-catalog.is-refreshing svg {
        animation : none;
    }
}
.ecla-wishlist-count {
    background : var(--primary-color);
    color : #fff;
    font-size : 11px;
    font-weight : 700;
    border-radius : 10px;
    padding : 1px 5px;
    min-width : 18px;
    text-align : center;
    line-height : 1.4;
}
.ecla-quicknav {
    display : none;
}
@media (max-width: 768px) {
    .ecla-quicknav {
        display : flex;
        justify-content : space-around;
        align-items : center;
        background : rgba(46, 125, 50, 0.08);
        border-bottom : 1px solid rgba(46,125,50,0.15);
        padding : 6px 8px;
        margin-bottom : 10px;
        overflow-x : auto;
        scrollbar-width : none;
        gap : 2px;
    }
    .ecla-quicknav::-webkit-scrollbar { display: none; }
    .ecla-quicknav-item {
        display : flex;
        flex-direction : column;
        align-items : center;
        gap : 2px;
        text-decoration : none;
        color : var(--header-bg, #2e7d32);
        padding : 4px 8px;
        border-radius : 8px;
        transition : background 0.15s;
        flex-shrink : 0;
        min-width : 52px;
    }
    .ecla-quicknav-item:hover { background: rgba(46,125,50,0.12); }
    .ecla-quicknav-icon svg { width: 20px; height: 20px; fill: var(--header-bg, #2e7d32); }
    .ecla-quicknav-label {
        font-size : 9px;
        font-weight : 700;
        text-align : center;
        color : var(--header-bg, #2e7d32);
        white-space : nowrap;
    }
}
#ecla-connexion-btn-container {
    min-width : 110px;
    min-height : 38px;
    display : flex;
    align-items: center;
}
#ecla-connexion-btn-container .ecla-account-btn {
    background : rgba(255,255,255,0.15);
    border-color : rgba(255,255,255,0.5);
    color : #fff;
    font-weight : 700;
}
#ecla-connexion-btn-container .ecla-account-btn:hover {
    background : rgba(255,255,255,0.28);
    color : #fff;
}
#ecla-account-presence.ecla-account-btn {
    border : none;
    padding : 0;
    background : none;
    min-width : 0;
}
#ecla-account-presence.ecla-account-btn:hover {
    background : none;
}
#ecla-account-initials-btn {
    position : relative;
    flex-shrink : 1;
    min-width : 0;
    /* Le bouton s'élargit pour utiliser l'espace disponible et afficher le nom complet ;
       au-delà, c'est la police qui est réduite (jamais de troncature). */
    max-width : 240px;
    height : 38px;
    padding : 0 14px 0 10px;
    border-radius : 20px;
    border : 1px solid rgba(255,255,255,0.45);
    background : rgba(255,255,255,0.15);
    color : #fff;
    font-size : 13px;
    font-weight : 700;
    letter-spacing : 0.01em;
    cursor : pointer;
    display : flex;
    align-items : center;
    gap : 6px;
    transition : background 0.2s, transform 0.15s;
}
#ecla-account-initials-btn:hover {
    background : rgba(255,255,255,0.28);
    transform : translateY(-1px);
}
#ecla-account-initials-btn:focus-visible {
    outline : 2px solid #fff;
    outline-offset : 2px;
}
.ecla-presence-dot {
    position : static;
    flex-shrink : 0;
    width : 9px;
    height : 9px;
    border-radius : 50%;
    background : #2ecc71;
    border : 1.5px solid rgba(255,255,255,0.7);
    box-shadow : 0 0 0 1px rgba(0,0,0,0.15);
}
.ecla-presence-name {
    line-height : 1.15;
    pointer-events : none;
    overflow : hidden;
    white-space : nowrap;
    /* Le nom du compte connecté s'affiche toujours en ENTIER, jamais tronqué ni « … » :
       le script d'ajustement du header réduit la police pour tout afficher. */
    flex : 0 1 auto;
    min-width : 0;
}
@media (max-width: 768px) {
    #ecla-account-initials-btn {
        max-width : 150px;
        height : 34px;
        padding : 0 10px 0 8px;
        font-size : 11.5px;
        gap : 5px;
    }
    .ecla-presence-dot {
        width : 8px;
        height : 8px;
    }
}
@media (max-width: 768px) {
    .ecla-header {
        padding : 8px 10px 8px;
        margin-bottom : 8px;
        border-radius : 0 0 10px 10px;
    }
    .ecla-header-inner {
        flex-wrap : wrap;
        gap : 6px;
        align-items : center;
    }
    .ecla-header-brand {
        flex : 1 1 auto;
        min-width : 0;
        /* overflow visible : ne pas rogner le nom étiré verticalement (scaleY). Le clipping
           horizontal reste assuré par .ecla-brand-name (overflow:hidden + ajustement JS). */
        overflow : visible;
        order : 1;
    }
    .ecla-brand-name {
        font-size : 1.25rem;
        white-space : nowrap;
        overflow : hidden;
    }
    .ecla-logo-img {
        max-height : 40px;
        max-width : 110px;
    }
    .ecla-logo { font-size: 18px; }
    #ecla-connexion-btn-container {
        order : 2;
        flex-shrink : 0;
        min-width : 0;
        min-height : 0;
    }
    .ecla-header-controls {
        order : 3;
        flex : 1 1 100%;
        gap : 6px;
        flex-wrap : wrap;
        display : flex;
        align-items : center;
    }
    .ecla-search-container {
        order : 1;
        flex : 1 1 100%;
        min-width : 0;
    }
    #ecla-wishlist-toggle,
    #ecla-theme-toggle,
    #ecla-refresh-catalog,
    #ecla-pwa-install-btn {
        order : 2;
    }
    #ecla-search-input {
        width : 100%;
        font-size : 13px;
        padding : 4px 32px 4px 10px;
        height : 28px;
        border-radius : 14px;
        box-sizing : border-box;
    }
    #ecla-theme-toggle,
    #ecla-refresh-catalog {
        width : 30px;
        height : 30px;
    }
    #ecla-pwa-install-btn {
        height : 28px;
        padding : 0 9px 0 7px;
        font-size : 11px;
        gap : 5px;
    }
    #ecla-pwa-btn-install {
        gap : 4px;
    }
    #ecla-pwa-btn-install svg {
        width : 14px;
        height : 14px;
    }
    #ecla-wishlist-toggle {
        padding : 4px 8px;
        font-size : 14px;
        height : 28px;
        box-sizing : border-box;
    }
}
@media (max-width: 360px) {
    /* Le nom de la marque reste affiché (jamais masqué) : le script d'ajustement réduit
       la police pour qu'il tienne intégralement à côté du logo, même sur très petit écran. */
    .ecla-brand-name { font-size: 1.05rem; }
    .ecla-logo-img { max-height: 34px; }
}
