/* ════════════════════════════════════════════════════════════════════
   Editenix — Catalogue libraires (front public)
   Présentation EN RANGÉES, sur le modèle de la page Catalogue du module.
   Couvertures papier : portrait 2:3, jamais rognées.
   ════════════════════════════════════════════════════════════════════ */

.bnb-lib-catalogue {
    --bnb-nuit: #132739;
    --bnb-cyan: #34a4c6;
    --bnb-bleu: #3b5998;
    --bnb-titre: #6b2d5b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #212121;
    max-width: 1100px;
    margin: 0 auto;
}

.bnb-lib-intro { color: #555; font-size: .95rem; margin: 0 0 1.5rem; }
.bnb-lib-intro--libraire {
    padding: .7rem 1rem;
    background: #eef7fa;
    border-left: 3px solid var(--bnb-cyan);
    border-radius: 0 6px 6px 0;
    color: #234;
}
.bnb-lib-empty { color: #777; font-style: italic; }

/* ── Barre de recherche et de filtre ─────────────────────────────── */
.bnb-lib-filters {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    margin: 0 0 1.5rem; padding: .9rem 1rem;
    background: #f5f7f8; border: 1px solid #e6e6e6; border-radius: 10px;
}
.bnb-lib-filters__search {
    flex: 1 1 240px; min-width: 180px; padding: .55rem .8rem;
    border: 1px solid #ccc; border-radius: 7px; font-size: .9rem;
}
.bnb-lib-filters__maison {
    flex: 0 1 240px; padding: .55rem .8rem;
    border: 1px solid #ccc; border-radius: 7px; font-size: .9rem; background: #fff;
}
.bnb-lib-filters__submit {
    padding: .55rem 1.2rem; background: var(--bnb-nuit); color: #fff;
    border: none; border-radius: 7px; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.bnb-lib-filters__submit:hover { filter: brightness(1.15); }
.bnb-lib-filters__reset { font-size: .85rem; color: #777; text-decoration: underline; }

/* ── Liste en rangées ────────────────────────────────────────────── */
.bnb-lib-list {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; overflow: hidden;
}
.bnb-lib-row {
    display: flex; align-items: stretch; gap: 18px; padding: 14px 18px;
    border-bottom: 1px solid #e8e8e8;
}
.bnb-lib-row:last-child { border-bottom: none; }
.bnb-lib-row:hover { background: #fafafa; }

.bnb-lib-row__thumb { flex: 0 0 70px; display: flex; align-items: flex-start; }
.bnb-lib-cover {
    display: block; width: 70px; aspect-ratio: 2 / 3; height: auto;
    object-fit: contain; object-position: center; border-radius: 3px;
    background: #f0f0f1; box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
@supports not (aspect-ratio: 1) { .bnb-lib-cover { height: 105px; } }
.bnb-lib-cover--empty { box-shadow: none; border: 1px dashed #d0d0d0; }

.bnb-lib-row__info { flex: 1 1 45%; min-width: 0; }
.bnb-lib-row__title {
    font-size: 15px; font-weight: 700; color: var(--bnb-titre);
    letter-spacing: .02em; text-transform: uppercase; margin-bottom: 6px;
}
.bnb-lib-row__meta {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 13px; color: #3c434a; line-height: 1.5;
}
.bnb-lib-row__meta strong { color: #1d2327; }

.bnb-lib-row__details {
    flex: 0 0 230px; display: flex; flex-direction: column; gap: 6px;
    font-size: 13px; color: #3c434a; align-items: flex-start;
}
.bnb-lib-row__price { font-size: 15px; font-weight: 700; color: var(--bnb-bleu); }
.bnb-lib-row__price-note { display: block; font-size: 11px; font-weight: 400; color: #999; }
.bnb-lib-row__parution strong { color: #1d2327; }

.bnb-lib-row__action { margin-top: 4px; display: flex; gap: .5rem; align-items: center; }
.bnb-lib-qty__input {
    width: 3.5rem; padding: .4rem .5rem; border: 1px solid #ccc; border-radius: 6px; font-size: .9rem;
}
.bnb-lib-add {
    padding: .5rem 1rem; background: var(--bnb-cyan); color: #fff; border: none;
    border-radius: 7px; font-size: .85rem; font-weight: 600; cursor: pointer; transition: filter .15s;
}
.bnb-lib-add:hover { filter: brightness(1.07); }

@media (max-width: 640px) {
    .bnb-lib-row { flex-wrap: wrap; }
    .bnb-lib-row__details { flex-basis: 100%; }
}

/* ── Panier (Ma commande) ────────────────────────────────────────── */
.bnb-lib-flash {
    margin: 0 0 1.2rem;
    padding: .7rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
}
.bnb-lib-flash--ok {
    background: #eaf7ee;
    border: 1px solid #b8e0c4;
    color: #1e6b39;
}
.bnb-lib-flash a { margin-left: .5rem; font-weight: 600; }

.bnb-lib-intro__lien {
    margin-left: .5rem;
    font-weight: 600;
    white-space: nowrap;
}

.bnb-lib-panier__titre {
    font-size: 1.4rem;
    color: var(--bnb-nuit);
    margin: 0 0 1rem;
}
.bnb-lib-qty__label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}
.bnb-lib-panier__pied {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 1rem 0;
}
.bnb-lib-panier__total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bnb-nuit);
}
.bnb-lib-btn {
    padding: .55rem 1.1rem;
    border: none;
    border-radius: 7px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
}
.bnb-lib-btn--secondaire { background: var(--bnb-bleu); color: #fff; }
.bnb-lib-btn--secondaire:hover { filter: brightness(1.08); }
.bnb-lib-btn--discret {
    background: transparent;
    color: #a33;
    text-decoration: underline;
    padding: .55rem .3rem;
}

.bnb-lib-panier__sous-actions {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: .5rem 0 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #e0e0e0;
}
.bnb-lib-row__remove {
    background: none;
    border: none;
    color: #a33;
    font-size: .82rem;
    text-decoration: underline;
    cursor: pointer;
    padding: .2rem 0;
    text-align: left;
}
.bnb-lib-remove-form { margin: 0; }
.bnb-lib-clear-form { margin-top: .4rem; }

.bnb-lib-panier__note {
    font-size: .85rem;
    color: #888;
    font-style: italic;
}

/* ── Barre libraire avec bouton Finaliser ────────────────────────── */
.bnb-lib-barre {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.bnb-lib-barre .bnb-lib-intro--libraire { margin: 0; flex: 1 1 320px; }
.bnb-lib-finaliser {
    display: inline-block;
    padding: .7rem 1.4rem;
    background: var(--bnb-bleu);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 2px 8px -2px rgba(59,89,152,.5);
}
.bnb-lib-finaliser:hover { filter: brightness(1.08); }

/* ── Validation de commande ──────────────────────────────────────── */
.bnb-lib-flash--valide {
    background: #e7f3ff;
    border: 1px solid #b3d4f5;
    color: #1c4e80;
    font-weight: 600;
}
.bnb-lib-panier__valider {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e0e0e0;
}
.bnb-lib-btn--valider {
    background: var(--bnb-cyan);
    color: #fff;
    font-size: 1rem;
    padding: .8rem 1.8rem;
}
.bnb-lib-btn--valider:hover { filter: brightness(1.08); }

/* ── Historique des commandes (libraire) ─────────────────────────── */
.bnb-lib-commande {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.bnb-lib-commande__entete {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    align-items: center;
    margin-bottom: .6rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid #eee;
}
.bnb-lib-commande__num { font-weight: 700; color: var(--bnb-nuit); }
.bnb-lib-commande__date { color: #777; font-size: .9rem; }
.bnb-lib-statut {
    margin-left: auto;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 600;
}
.bnb-lib-statut--recue { background: #eef1f4; color: #555; }
.bnb-lib-statut--encours { background: #dff0d8; color: #2e6b2e; }
.bnb-lib-commande__lignes {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .92rem;
}
.bnb-lib-commande__lignes li { padding: .25rem 0; }
.bnb-lib-commande__qty { font-weight: 700; color: var(--bnb-bleu); margin-right: .3rem; }
.bnb-lib-commande__isbn { color: #999; font-size: .82rem; }
.bnb-lib-commande__pied {
    margin-top: .6rem;
    padding-top: .5rem;
    border-top: 1px dashed #eee;
    font-weight: 600;
    color: var(--bnb-nuit);
    font-size: .9rem;
}

/* ── Page d'accueil libraire (tuiles) ────────────────────────────── */
.bnb-lib-accueil {
    --bnb-nuit: #132739;
    --bnb-cyan: #34a4c6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
}
.bnb-lib-accueil__entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.2rem;
    background: var(--bnb-nuit);
    color: #fff;
    border-radius: 10px;
}
.bnb-lib-accueil__marque { font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; }
.bnb-lib-accueil__marque span { color: var(--bnb-cyan); }
.bnb-lib-accueil__compte { display: flex; gap: 1rem; align-items: center; font-size: .9rem; }
.bnb-lib-accueil__compte a { color: var(--bnb-cyan) !important; text-decoration: none; }
.bnb-lib-accueil__titre { margin: 1.6rem 0 .2rem; color: var(--bnb-nuit); font-size: 1.7rem; }
.bnb-lib-accueil__sous-titre { margin: 0 0 1.8rem; color: #666; }

.bnb-lib-tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}
.bnb-lib-tuile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.6rem 1.4rem;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 14px;
    text-decoration: none !important;
    color: var(--bnb-nuit) !important;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.bnb-lib-tuile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -12px rgba(19,39,57,.4);
    border-color: var(--bnb-cyan);
}
.bnb-lib-tuile__icone {
    font-size: 34px;
    width: 34px;
    height: 34px;
    color: var(--bnb-cyan);
}
.bnb-lib-tuile__titre { font-weight: 700; font-size: 1.1rem; }
.bnb-lib-tuile__desc { font-size: .88rem; color: #667; line-height: 1.45; }
.bnb-lib-tuile__badge {
    position: absolute;
    top: 1.1rem;
    right: 1.2rem;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--bnb-cyan);
    color: #fff;
    border-radius: 11px;
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Mon compte (adresses) ───────────────────────────────────────── */
.bnb-lib-compte__cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.bnb-lib-compte__bloc {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem 1.2rem 1.2rem;
}
.bnb-lib-compte__bloc legend { font-weight: 700; color: var(--bnb-nuit); padding: 0 .4rem; }
.bnb-lib-champ { display: flex; flex-direction: column; gap: .2rem; margin: .6rem 0; }
.bnb-lib-champ label { font-size: .82rem; color: #555; font-weight: 600; }
.bnb-lib-champ input[type=text], .bnb-lib-champ select {
    padding: .5rem .6rem; border: 1px solid #ccc; border-radius: 6px; font-size: .92rem;
}
.bnb-lib-champ--check { flex-direction: row; align-items: center; }
.bnb-lib-champ--check label { font-size: .9rem; }
.bnb-lib-compte__submit { margin-top: 1.2rem; }
