/* ── Carte produit ── */
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card__img {
    height: 140px;
    object-fit: cover;
    width: 100%;
    background: #f1f5f9;
}

.product-card__img-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 2.5rem;
}

.product-card__body {
    padding: .875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.product-card__name {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.3;
}

.product-card__brand { font-size: .8rem; color: var(--muted); }
.product-card__category {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    font-size: .75rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    width: fit-content;
}

.product-card__meta {
    display: flex;
    gap: .75rem;
    font-size: .8rem;
    color: var(--muted);
    margin-top: .25rem;
}

.product-card__qty {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .5rem;
}

.product-card__qty .qty-val {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 2rem;
    text-align: center;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.qty-btn:hover { background: #f1f5f9; }

.badge-low {
    background: #fef3c7;
    color: var(--warning);
    font-size: .72rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-weight: 600;
}

.badge-out {
    background: #fef2f2;
    color: var(--danger);
    font-size: .72rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-weight: 600;
}

.product-card__actions {
    display: flex;
    gap: .5rem;
    padding: .75rem .875rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

/* ── Scanner ── */
.scan-container {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

#scanner-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#scanner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0%   { top: 20%; }
    50%  { top: 80%; }
    100% { top: 20%; }
}

.scan-controls { display: flex; gap: .75rem; justify-content: center; }

.scan-manual { text-align: center; }
.scan-manual p { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }

.scan-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

/* ── Liste de courses ── */
.shopping-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 600px;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    box-shadow: var(--shadow);
    transition: opacity .2s;
}

.shopping-item.checked {
    opacity: .5;
}

.shopping-item input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.shopping-item__info { flex: 1; }
.shopping-item__name {
    font-weight: 500;
    font-size: .95rem;
}

.shopping-item.checked .shopping-item__name {
    text-decoration: line-through;
}

.shopping-item__brand { font-size: .8rem; color: var(--muted); }

.shopping-item__qty {
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.shopping-item__del {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.1rem;
    padding: .2rem;
    border-radius: 4px;
    transition: color .15s;
}

.shopping-item__del:hover { color: var(--danger); }
