/*
 * Panneau latéral de la fiche carte (T43) — valeurs du prototype (export L984–1001).
 *
 * Le panneau passe au-dessus des deux couches du tiroir de navigation (`rb-shell__overlay` à 65,
 * `rb-shell__sidebar` à 70) : le prototype le posait à 50, mais il ne connaissait pas ce tiroir.
 *
 * Breakpoints repris de `layout/_shell.css` — 760px et 1180px, pas de troisième palier.
 * `prefers-reduced-motion` est neutralisé globalement dans `base/_reset.css` : rien à ajouter ici.
 */
.rb-card-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    justify-content: flex-end;
}

.rb-shell[data-card-panel="open"] .rb-card-panel {
    display: flex;
}

.rb-card-panel__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 0;
    background-color: rgb(3 6 12 / 70%);
    backdrop-filter: blur(3px);
    border: 0;
    cursor: pointer;
}

.rb-card-panel__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: var(--rb-bg-panel);
    border-left: 1px solid var(--rb-border-strong);
    animation: rbSlide 0.28s ease both;
}

/*
 * Barre collante : identité compacte, « Fiche complète », Cardmarket, fermeture (maquette 2026-10).
 * L'identité et la bordure n'apparaissent qu'une fois l'en-tête de la fiche passé dessous
 * (`data-card-panel-scrolled`, posé par `card-panel.js`).
 */
.rb-card-panel__header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px 12px 24px;
    background-color: rgb(8 13 24 / 92%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.rb-card-panel[data-card-panel-scrolled="true"] .rb-card-panel__header {
    border-bottom-color: var(--rb-border-default);
}

.rb-card-panel__identity-slot {
    flex: 1;
    min-width: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.rb-card-panel[data-card-panel-scrolled="true"] .rb-card-panel__identity-slot {
    opacity: 1;
}

.rb-card-panel__identity {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 0;
}

.rb-card-panel__identity-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rb-card-panel__identity-name {
    overflow: hidden;
    color: var(--rb-text-heading);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rb-card-panel__identity-price {
    color: var(--rb-text-subdued);
    font-family: var(--rb-font-mono);
    font-size: 11px;
    white-space: nowrap;
}

.rb-card-panel__view-full,
.rb-card-panel__cardmarket {
    display: flex;
    flex: none;
    align-items: center;
    height: 34px;
    font-size: 12.5px;
    white-space: nowrap;
    border-radius: var(--rb-radius-md);
}

.rb-card-panel__view-full {
    padding: 0 13px;
    color: var(--rb-accent-cyan);
    font-weight: 700;
    background-color: rgb(95 227 245 / 7%);
    border: 1px solid #24405A;
}

.rb-card-panel__view-full:hover {
    background-color: rgb(95 227 245 / 14%);
}

.rb-card-panel__cardmarket {
    padding: 0 11px;
    color: #B9CADE;
    font-weight: 600;
    background-color: var(--rb-bg-inset);
    border: 1px solid var(--rb-border-chip);
}

.rb-card-panel__cardmarket:hover {
    color: var(--rb-text-heading);
    border-color: #2C3E5E;
}

/* Le créneau vide ne doit pas compter dans l'espacement de la barre. */
.rb-card-panel__cardmarket-slot:empty {
    display: none;
}

.rb-card-panel__close {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--rb-text-muted);
    font-size: 18px;
    line-height: 1;
    background-color: var(--rb-bg-inset);
    border: 1px solid var(--rb-border-muted);
    border-radius: var(--rb-radius-md);
    cursor: pointer;
}

.rb-card-panel__close:hover {
    color: var(--rb-text-heading);
    border-color: #2C3E5E;
}

/*
 * Aucune gouttière ici : l'en-tête de la fiche est à fond perdu dans le panneau, ce sont les
 * blocs qui s'encartent, par `--rb-card-detail-inset` (cf. `components/_card-detail.css`).
 */
.rb-card-panel__body {
    padding-bottom: 60px;
}

.rb-card-panel__body .rb-card-detail {
    --rb-card-detail-inset: 24px;
}

/* Pendant le `fetch`, le corps est vide : le message d'attente tient lieu de contenu. */
.rb-card-panel__message {
    padding: 20px 24px;
    color: var(--rb-text-muted);
    font-size: 13px;
}

@media (min-width: 760px) {
    .rb-card-panel__dialog {
        width: 480px;
    }
}

@media (min-width: 1180px) {
    .rb-card-panel__dialog {
        width: 560px;
    }
}
