/* almacen.css — Warehouse redesign styles (2026-05) */

:root {
  --alm-purple: #9b5cf6;
}
html[data-theme="light"] {
  --alm-purple: #6d28d9;
}

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes almPulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--red) 40%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in oklab, var(--red) 0%, transparent); }
}
@keyframes almFadeIn  { from { opacity: 0 }                           to { opacity: 1 } }
@keyframes almSlideUp { from { transform: translateY(24px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes almToastIn { from { transform: translate(-50%,14px); opacity: 0 } to { transform: translate(-50%,0); opacity: 1 } }

/* ── Bottom-sheet modal ──────────────────────────────────────────────── */
.alm-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: almFadeIn .18s ease;
}
.alm-sheet {
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 540px;
  padding: 18px 18px max(24px, env(safe-area-inset-bottom, 24px));
  animation: almSlideUp .22s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,.28);
}
.alm-sheet-hdl {
  width: 36px; height: 4px; background: var(--border);
  border-radius: 99px; margin: 0 auto 14px;
}
.alm-sheet-ttl {
  font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 14px;
}
.alm-sheet-sub {
  font-size: 12px; color: var(--muted); margin: -10px 0 12px;
}

/* ── Toast ───────────────────────────────────────────────────────────── */
.alm-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 9px 16px; border-radius: 99px;
  font-size: 13px; font-weight: 500; z-index: 300;
  display: flex; align-items: center; gap: 8px;
  animation: almToastIn .25s cubic-bezier(.2,.8,.2,1);
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.28);
}

/* ── Swipe card wrapper ──────────────────────────────────────────────── */
.alm-swipe-wrap  { position: relative; user-select: none; touch-action: pan-y; }
.alm-swipe-reveal {
  position: absolute; inset: 0; border-radius: 12px;
  display: flex; align-items: center; padding-left: 18px; gap: 8px;
  font-weight: 600; font-size: 13px; pointer-events: none; opacity: 0;
}
.alm-swipe-card {
  position: relative;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .15s ease;
}

/* ── KPI card ─────────────────────────────────────────────────────────── */
.alm-kpi {
  all: unset; cursor: pointer; position: relative; border-radius: 12px;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-tap-highlight-color: transparent; transition: transform .14s ease;
  box-sizing: border-box; width: 100%;
}
.alm-kpi:active { transform: scale(.97); }

/* ── Urgency pulse dot ────────────────────────────────────────────────── */
.alm-pulse {
  width: 8px; height: 8px; border-radius: 99px; display: inline-block;
  background: var(--red); flex-shrink: 0;
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--red) 25%, transparent);
  animation: almPulse 1.6s infinite;
}

/* ── Status pill ──────────────────────────────────────────────────────── */
.alm-pill-new {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}

/* ── Detail view ──────────────────────────────────────────────────────── */
.alm-det-hdr {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
}
.alm-det-sec {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.alm-det-row { display: flex; gap: 10px; align-items: center; }
.alm-det-row + .alm-det-row { margin-top: 9px; }

/* ── Product rows (detail) ───────────────────────────────────────────── */
.alm-prod-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.alm-prod-row:last-child { border-bottom: none; }
.alm-prod-cb {
  all: unset; cursor: pointer; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.alm-qty-btn {
  all: unset; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--s2); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.alm-qty-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Detail sticky CTA ────────────────────────────────────────────────── */
.alm-det-cta {
  position: sticky; bottom: 0; padding: 12px 14px;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}
.alm-det-cta-btn {
  all: unset; box-sizing: border-box; display: flex;
  align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all .2s ease;
}
.alm-det-cta-btn:disabled { cursor: not-allowed; }

/* ── Action sheet items ───────────────────────────────────────────────── */
.alm-action-item {
  all: unset; cursor: pointer; display: flex; align-items: center;
  gap: 12px; padding: 12px 6px; border-radius: 8px; width: 100%;
  box-sizing: border-box; font-size: 15px; font-weight: 500;
  color: var(--text); -webkit-tap-highlight-color: transparent;
}
.alm-action-item:active { background: var(--s2); }

/* ── Light theme overrides ────────────────────────────────────────────── */
html[data-theme="light"] .alm-toast { box-shadow: 0 4px 20px rgba(0,0,0,.14); }
html[data-theme="light"] .alm-sheet { box-shadow: 0 -4px 20px rgba(0,0,0,.1); }
html[data-theme="light"] .alm-det-hdr { background: color-mix(in oklab, var(--bg) 90%, transparent); }
