/* =====================================================
   VIBE Carolina — Driver Packing Interface Styles
   Mobile-first, large touch targets, high contrast
   ===================================================== */

.packing-body {
  background: #f0f2f5;
  min-height: 100vh;
  padding-bottom: 120px; /* space for pinned fulfill button */
}

/* ── Header ─────────────────────────────────────────── */
.pack-header {
  position: sticky; top: 0; z-index: 50;
  background: #1a1d2e; color: #fff;
  height: 56px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.pack-back-btn {
  background: none; border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.pack-back-btn:hover { background: rgba(255,255,255,.12); }
.pack-header-title {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.pack-logo { height: 26px; width: auto; filter: brightness(10); }
#pack-header-label {
  font-size: 1rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pack-icon-btn {
  background: none; border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.pack-icon-btn:hover { background: rgba(255,255,255,.12); }

/* ── Guard / Loading ─────────────────────────────────── */
.pack-guard {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px; gap: 12px;
  color: #6b7280;
}
.pack-guard h3 { font-size: 1.1rem; color: #1a1d2e; }
.pack-guard p  { font-size: .88rem; }

.pack-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 24px;
  font-size: .9rem; color: #6b7280;
}
.pack-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Order list ─────────────────────────────────────── */
.pack-list-header {
  padding: 16px 16px 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pack-list-title {
  font-size: 1rem; font-weight: 700; color: #1a1d2e;
  display: flex; align-items: center; gap: 8px;
}
.pack-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; border-radius: 12px;
  background: #3b82f6; color: #fff;
  font-size: .78rem; font-weight: 700; padding: 0 6px;
}
.pack-list-filters {
  display: flex; gap: 6px;
}
.pack-filter-btn {
  padding: 5px 12px; border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff; color: #6b7280;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.pack-filter-btn.active {
  background: #1a1d2e; border-color: #1a1d2e; color: #fff;
}

.pack-order-list {
  padding: 0 12px; display: flex; flex-direction: column; gap: 10px;
}

.pack-order-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: box-shadow .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.pack-order-card:active { transform: scale(.985); box-shadow: none; }
.pack-order-card.pack-order-fulfilled { opacity: .65; }

.pack-order-card-left { flex: 1; min-width: 0; }
.pack-order-client {
  font-size: 1rem; font-weight: 700; color: #1a1d2e;
  margin-bottom: 2px;
}
.pack-order-company {
  font-size: .8rem; color: #6b7280; margin-bottom: 4px;
}
.pack-order-details {
  font-size: .8rem; color: #6b7280;
}
.pack-order-date {
  font-size: .75rem; color: #9ca3af; margin-top: 4px;
}

/* ── Packing progress on order list cards ────────────── */
.pack-card-progress {
  display: flex; align-items: center; gap: 7px;
  margin-top: 6px;
}
.pack-card-mini-bar {
  width: 64px; height: 5px; border-radius: 3px;
  background: #e5e7eb; overflow: hidden; flex-shrink: 0;
}
.pack-card-mini-fill {
  height: 100%; border-radius: 3px;
  background: #f59e0b;       /* amber while in progress */
  transition: width .3s ease;
}
.pack-card-mini-fill.all-packed { background: #22c55e; }   /* green when done */
.pack-card-progress-label {
  font-size: .72rem; font-weight: 600; color: #b45309;
  white-space: nowrap;
}
.pack-card-progress-label.all-packed { color: #16a34a; }
.pack-card-remaining {
  font-size: .72rem; color: #9ca3af;
  margin-top: 3px; line-height: 1.4;
}
.pack-order-card-right {
  display: flex; flex-direction: column; align-items: flex-end;
  flex-shrink: 0;
}

.pack-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px; gap: 12px;
  color: #6b7280;
}
.pack-empty h3 { font-size: 1.1rem; color: #1a1d2e; }
.pack-empty p  { font-size: .88rem; }

/* ── Detail: sticky top section ──────────────────────── */
.pack-detail-sticky {
  position: sticky; top: 56px; z-index: 40;
  background: #fff;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.pack-order-meta {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.pack-client-name {
  font-size: 1rem; font-weight: 700; color: #1a1d2e; line-height: 1.3;
}
.pack-order-info {
  font-size: .75rem; color: #9ca3af; margin-top: 2px;
}

/* Progress bar */
.pack-progress-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.pack-progress-bar {
  flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; overflow: hidden;
}
.pack-progress-fill {
  height: 100%; background: #22c55e; border-radius: 4px;
  transition: width .3s ease;
}
.pack-progress-label {
  font-size: .75rem; font-weight: 600; color: #6b7280;
  white-space: nowrap; flex-shrink: 0;
}

/* Action buttons row */
.pack-action-row {
  display: flex; gap: 8px;
}
.pack-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border-radius: 9px;
  font-size: .83rem; font-weight: 600; cursor: pointer;
  transition: all .15s; border: 1.5px solid;
}
.pack-btn-secondary {
  background: #f8fafc; border-color: #e2e8f0; color: #374151;
}
.pack-btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* ── Notes ───────────────────────────────────────────── */
.pack-notes-wrap {
  margin: 0 12px;
  padding: 10px 14px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; margin-top: 10px;
}
.pack-note {
  font-size: .82rem; color: #78350f; line-height: 1.5;
}
.pack-note + .pack-note { margin-top: 6px; }
.pack-note-admin { color: #1e40af; }

/* ── Item checklist ───────────────────────────────────── */
.pack-item-list {
  padding: 10px 12px 160px; /* ensures last item scrolls clear of the pinned fulfill button */
}

.pack-store-group { margin-bottom: 6px; }
.pack-store-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #9ca3af;
  padding: 10px 4px 6px;
}

.pack-item-row {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 12px;
  padding: 16px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pack-item-row:active { background: #f8fafc; }

/* Check circle */
.pack-item-check {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid #d1d5db; background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  color: transparent;
}

/* Packed state */
.pack-item-row.packed {
  background: #f0fdf4;
  box-shadow: none;
}
.pack-item-row.packed .pack-item-check {
  background: #22c55e; border-color: #22c55e; color: #fff;
}
.pack-item-row.packed .pack-item-name {
  text-decoration: line-through; color: #9ca3af;
}

.pack-item-body { flex: 1; min-width: 0; }
.pack-preorder-tag {
  display: inline-block;
  font-size: .65rem; font-weight: 700;
  background: #f3e8ff; color: #7e22ce;
  border-radius: 20px; padding: 1px 7px;
  margin-left: 6px; vertical-align: middle;
  white-space: nowrap;
}
.pack-item-name {
  font-size: .95rem; font-weight: 600; color: #1a1d2e;
  line-height: 1.3; transition: color .15s;
}
.pack-item-sub {
  font-size: .75rem; color: #9ca3af; margin-top: 2px;
}

/* Qty badge */
.pack-item-qty { flex-shrink: 0; }
.pack-qty-badge {
  display: inline-flex; align-items: baseline; gap: 2px;
  min-width: 52px; padding: 6px 10px;
  background: #eff6ff; border: 2px solid #bfdbfe;
  border-radius: 10px; color: #1d4ed8;
  font-size: 1.3rem; font-weight: 800;
  line-height: 1; justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
}
.pack-qty-unit {
  font-size: .65rem; font-weight: 600;
  color: #60a5fa; letter-spacing: .02em;
  align-self: flex-end; margin-bottom: 1px;
}
.pack-item-row.packed .pack-qty-badge {
  background: #dcfce7; border-color: #86efac; color: #15803d;
}
.pack-item-row.packed .pack-qty-unit { color: #4ade80; }

/* ── Packed qty adjustment controls ─────────────────── */
.pack-qty-ctrl-wrap {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end;
}
.pack-qty-adj {
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid #86efac; background: #dcfce7;
  color: #15803d; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.pack-qty-adj:hover:not(:disabled) { background: #bbf7d0; border-color: #4ade80; }
.pack-qty-adj:disabled { opacity: .35; cursor: default; }

.pack-qty-badge.partial-qty {
  background: #fef3c7; border-color: #fcd34d; color: #92400e;
}
.pack-qty-ordered {
  font-size: .65rem; font-weight: 600; color: #9ca3af;
  width: 100%; text-align: center; margin-top: 1px;
}

/* Partial packed row tint */
.pack-item-row.packed.partial {
  background: #fffbeb;
}
.pack-item-row.packed.partial .pack-item-check {
  background: #f59e0b; border-color: #f59e0b;
}

/* ── Pinned fulfill button ────────────────────────────── */
.pack-fulfill-wrap {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 16px 24px;
  background: linear-gradient(to top, #f0f2f5 60%, transparent);
  z-index: 50;
}
.pack-partial-warn {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: #b45309;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 7px 10px;
  margin-bottom: 8px;
}
.pack-fulfill-btn {
  width: 100%; padding: 16px;
  border: none; border-radius: 14px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .2s;
  background: #1a1d2e; color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.pack-fulfill-btn:disabled {
  cursor: default; box-shadow: none;
}
.pack-fulfill-btn.pack-fulfill-ready {
  background: #16a34a;
  box-shadow: 0 4px 20px rgba(22,163,74,.35);
}
.pack-fulfill-btn.pack-fulfill-done {
  background: #86efac; color: #166534;
  box-shadow: none;
}

/* ── Re-use site order-status badges ─────────────────── */
/* (already defined in style.css, no need to redefine) */
