/* ============================================
   SelectionActionBar.css
   Barre fixe en bas — slide-up à la sélection
   Préfixe .sab- partout
   ============================================ */

/* ── Variables locales ────────────────────── */
:root {
    --sab-bg:        #ffffff;
    --sab-border:    #e2e8f0;
    --sab-shadow:    0 8px 32px rgba(15,23,42,.13), 0 2px 8px rgba(15,23,42,.07);
    --sab-shadow-up: 0 -8px 24px rgba(15,23,42,.10);
    --sab-blue:      #3b82f6;
    --sab-blue-dark: #2563eb;
    --sab-blue-bg:   #eff6ff;
    --sab-blue-bd:   #bfdbfe;
    --sab-slate:     #64748b;
    --sab-slate-bg:  #f1f5f9;
    --sab-red:       #ef4444;
    --sab-red-bg:    #fef2f2;
    --sab-green:     #22c55e;
    --sab-green-bg:  #f0fdf4;
    --sab-green-bd:  #bbf7d0;
    --sab-radius:    18px;
    --sab-radius-sm: 10px;
    --sab-font:      'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --sab-mono:      'DM Mono', ui-monospace, monospace;
}

/* ── Barre principale ─────────────────────── */
.sab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 400;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 0 0 20px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 20px));
    transition: transform .38s cubic-bezier(.34, 1.4, .64, 1),
                opacity .25s ease;
}

.sab-bar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* ── Container interne ───────────────────── */
.sab-inner {
    display: flex;
    align-items: center;
    background: var(--sab-bg);
    border: 1.5px solid var(--sab-border);
    border-radius: var(--sab-radius);
    padding: 8px 12px;
    gap: 4px;
    max-width: 600px;
    box-shadow: var(--sab-shadow);
    font-family: var(--sab-font);
}

/* ── Pill compteur ────────────────────────── */
.sab-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 8px;
    background: var(--sab-blue-bg);
    border: 1.5px solid var(--sab-blue-bd);
    border-radius: 12px;
    flex-shrink: 0;
    margin-right: 4px;
}

.sab-pill-num {
    min-width: 28px;
    height: 28px;
    background: var(--sab-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sab-mono);
    font-size: .8rem;
    font-weight: 500;
    color: white;
    padding: 0 6px;
    transition: transform .2s cubic-bezier(.34, 1.5, .64, 1);
}

.sab-pill-num.bump {
    transform: scale(1.28);
}

.sab-pill-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--sab-blue-dark);
    white-space: nowrap;
}

/* ── Séparateur ───────────────────────────── */
.sab-sep {
    width: 1.5px;
    height: 28px;
    background: var(--sab-border);
    flex-shrink: 0;
    margin: 0 4px;
}

/* ── Boutons action ───────────────────────── */
.sab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 11px;
    border-radius: var(--sab-radius-sm);
    border: none;
    cursor: pointer;
    background: transparent;
    font-family: var(--sab-font);
    font-size: .68rem;
    font-weight: 600;
    color: var(--sab-slate);
    flex-shrink: 0;
    white-space: nowrap;
    transition: background .13s ease, color .13s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
}

.sab-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
}

.sab-btn:hover {
    background: var(--sab-slate-bg);
    color: #334155;
    transform: translateY(-1px);
}

/* Variante primaire (bleu) */
.sab-btn--primary {
    background: var(--sab-blue-bg);
    color: var(--sab-blue-dark);
    border: 1.5px solid var(--sab-blue-bd);
}

.sab-btn--primary:hover {
    background: #dbeafe;
    color: var(--sab-blue-dark);
}

/* Variante succès (vert) */
.sab-btn--success {
    background: var(--sab-green-bg);
    color: #15803d;
    border: 1.5px solid var(--sab-green-bd);
}

.sab-btn--success:hover {
    background: #dcfce7;
    color: #166534;
}

/* Variante Plus */
.sab-btn--more {
    background: var(--sab-slate-bg);
    border: 1.5px solid var(--sab-border);
}

.sab-btn--more.active,
.sab-btn--more:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #334155;
}

/* ── Bouton fermer ────────────────────────── */
.sab-close {
    width: 34px;
    height: 34px;
    border-radius: var(--sab-radius-sm);
    border: 1.5px solid var(--sab-border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 2px;
    transition: border-color .13s ease, color .13s ease, background .13s ease;
}

.sab-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.sab-close:hover {
    border-color: #94a3b8;
    color: #475569;
    background: var(--sab-slate-bg);
}

/* ── Backdrop overflow ────────────────────── */
.sab-ov-backdrop {
    position: fixed;
    inset: 0;
    z-index: 398;
}

/* ── Menu overflow ────────────────────────── */
.sab-ov-menu {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) scale(.94) translateY(8px);
    transform-origin: bottom center;
    background: white;
    border: 1.5px solid var(--sab-border);
    border-radius: 16px;
    padding: 6px;
    min-width: 260px;
    box-shadow: 0 16px 48px rgba(15,23,42,.15), 0 4px 16px rgba(15,23,42,.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease,
                transform .22s cubic-bezier(.34, 1.4, .64, 1);
    z-index: 399;
}

.sab-ov-menu.open {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) scale(1) translateY(0);
}

.sab-ov-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background .12s ease;
}

.sab-ov-item:hover {
    background: #f8fafc;
}

.sab-ov-ico {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sab-ov-ico svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.sab-ov-blue  { background: #eff6ff;  color: #3b82f6; }
.sab-ov-slate { background: #f1f5f9;  color: #64748b; }
.sab-ov-red   { background: #fef2f2;  color: #ef4444; }
.sab-ov-green { background: #f0fdf4;  color: #22c55e; }

.sab-ov-title {
    font-size: .83rem;
    font-weight: 600;
    color: #334155;
    font-family: var(--sab-font);
}

.sab-ov-title.red { color: var(--sab-red); }

.sab-ov-desc {
    font-size: .68rem;
    color: #94a3b8;
    font-family: var(--sab-mono);
    margin-top: 1px;
}

.sab-ov-divider {
    height: 1.5px;
    background: #f1f5f9;
    margin: 4px 8px;
}

/* ── Responsive mobile ────────────────────── */
@media (max-width: 600px) {
    .sab-bar {
        padding: 0;
    }

    .sab-inner {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 1.5px solid var(--sab-border);
        box-shadow: var(--sab-shadow-up);
        padding: 10px 14px;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
        overflow-x: auto;
    }

    .sab-pill-label {
        display: none;
    }

    .sab-pill {
        padding: 6px;
        gap: 0;
        margin-right: 4px;
    }

    .sab-ov-menu {
        left: 14px;
        right: 14px;
        transform: scale(.94) translateY(8px);
        transform-origin: bottom center;
    }

    .sab-ov-menu.open {
        transform: scale(1) translateY(0);
    }
}

/* ── Print ────────────────────────────────── */
@media print {
    .sab-bar,
    .sab-ov-menu,
    .sab-ov-backdrop { display: none !important; }
}
