/* SKU photo capture: the always-visible sync status bar and the Upload Queue sheet.
   Global (linked in index.html) because the bar lives in MainLayout and the sheet is reused by the page. */

:root {
    --sync-ok: #1a7f37;
    --sync-ok-bg: rgba(26, 127, 55, 0.12);
    --sync-info: #1b6ec2;
    --sync-info-bg: rgba(27, 110, 194, 0.12);
    --sync-warn: #8a6400;
    --sync-warn-bg: rgba(138, 100, 0, 0.14);
    --sync-bad: #b42318;
    --sync-bad-bg: rgba(180, 35, 24, 0.10);
    --sync-ink: #1a1a2e;
    --sync-muted: #5b6170;
    --sync-line: #e3e5ea;
}

/* ── Status bar ─────────────────────────────────────────────────────────────────────────────── */

.sync-statusbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 16px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid var(--sync-line);
    font-size: 13px;
    color: var(--sync-ink);
    overflow-x: auto;
    white-space: nowrap;
    z-index: 30;
}

.sync-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sync-ok);
    flex-shrink: 0;
}

.sync-statusbar.is-offline .sync-dot { background: var(--sync-bad); }
.sync-label { font-weight: 600; }
.sync-sep { width: 1px; height: 16px; background: var(--sync-line); flex-shrink: 0; }

.sync-pill {
    border: 0;
    border-radius: 999px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    flex-shrink: 0;
}

.sync-pill--info { background: var(--sync-info-bg); color: var(--sync-info); }
.sync-pill--warn { background: var(--sync-warn-bg); color: var(--sync-warn); }
.sync-pill--bad { background: var(--sync-bad-bg); color: var(--sync-bad); }
.sync-pill--ok { background: var(--sync-ok-bg); color: var(--sync-ok); }

.sync-time {
    margin-left: auto;
    color: var(--sync-muted);
    font-size: 12px;
    padding-left: 8px;
}

/* ── Upload Queue sheet ─────────────────────────────────────────────────────────────────────── */

.sync-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.45);
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sync-sheet {
    width: 100%;
    max-width: 560px;
    max-height: 88dvh;
    background: #ffffff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--sync-ink);
}

@media (min-width: 768px) {
    .sync-sheet-backdrop { align-items: center; }
    .sync-sheet { border-radius: 18px; max-height: 80vh; }
}

.sync-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #d9dde5; align-self: center; }
.sync-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sync-sheet-eyebrow { font-size: 12px; font-weight: 700; color: var(--sync-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.sync-sheet-title { margin: 2px 0 0; font-size: 20px; font-weight: 700; }

.sync-sheet-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #f0f1f4;
    color: var(--sync-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.sync-sheet-notice {
    background: var(--sync-info-bg);
    color: var(--sync-info);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
}

.sync-sheet-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 60px; }

.sync-sheet-empty {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 20px 4px;
    color: var(--sync-muted);
    font-size: 14px;
}

.sync-card {
    border: 1px solid var(--sync-line);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sync-card--failed, .sync-card--stalled { border-left: 4px solid var(--sync-bad); }
.sync-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sync-card-sku { font-size: 16px; font-weight: 700; letter-spacing: 0.03em; }
.sync-card-when { font-size: 12px; color: var(--sync-muted); white-space: nowrap; }
.sync-card-desc { font-size: 14px; color: var(--sync-muted); }
.sync-card-status { font-size: 13px; font-weight: 700; }
.sync-card-status.is-warn { color: var(--sync-warn); }
.sync-card-status.is-info { color: var(--sync-info); }
.sync-card-status.is-bad { color: var(--sync-bad); }
.sync-card-attempts { font-size: 12px; color: var(--sync-muted); line-height: 1.4; }
.sync-card-error { color: var(--sync-bad); font-style: italic; }
.sync-card-actions, .sync-card-fix { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.sync-card-fix-input {
    flex: 1 1 140px;
    min-width: 0;
    height: 40px;
    border: 1.5px solid #c9cdd5;
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sync-btn {
    height: 40px;
    padding: 0 14px;
    border: 1px solid #c9cdd5;
    border-radius: 8px;
    background: #ffffff;
    color: var(--sync-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sync-btn:disabled { opacity: 0.55; cursor: default; }
.sync-btn--primary { background: var(--sync-info); border-color: var(--sync-info); color: #ffffff; }
.sync-btn--danger { color: var(--sync-bad); }
.sync-btn--grow { flex: 1 1 0; height: 48px; border-radius: 12px; font-size: 15px; }

.sync-sheet-footer { display: flex; gap: 10px; padding-top: 4px; }
.sync-sheet-hint { margin: 0; font-size: 12px; color: var(--sync-muted); line-height: 1.4; }

.sync-card-sku--new { color: var(--sync-info); }
