/* ========================================================
   STOCKA PICKER MOBILE - ESTILOS MÓVILES (CSS)
   ======================================================== */

:root {
  --primary-color: #5e17eb;
  --primary-hover: #4d12c4;
  --primary-light: rgba(94, 23, 235, 0.1);
  --success-color: #00e676;
  --success-dark: #00b25c;
  --warning-color: #ff9800;
  --danger-color: #ff3d71;
  --info-color: #00bcd4;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  --header-height: 56px;
  --bottom-bar-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --shadow-fab: 0 6px 20px rgba(94, 23, 235, 0.4);
}

/* Modo Oscuro */
body.dark-mode {
  --bg-app: #0b0f19;
  --bg-card: #131b2e;
  --bg-elevated: #1a243b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border-color: #1e293b;
  --border-light: #182234;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-app);
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ========================================================
   1. PANTALLA DE AUTENTICACIÓN / LOGIN MOBILE
   ======================================================== */
.mobile-auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0b0f19 0%, #1e1b4b 50%, #0f172a 100%);
  color: #ffffff;
}

.mobile-auth-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.mobile-logo-header {
  text-align: center;
  margin-bottom: 24px;
}

.mobile-brand-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 10px rgba(94, 23, 235, 0.5));
}

.mobile-logo-header h1, .mobile-logo-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.mobile-auth-subtitle {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-top: 4px;
}

.mobile-input-field {
  margin-bottom: 16px;
  text-align: left;
}

.mobile-input-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.mobile-input-field input, .password-input-wrapper input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0 14px;
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.mobile-input-field input:focus, .password-input-wrapper input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.3);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 46px;
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
}

.input-hint {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

.btn-mobile-primary {
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #8c52ff 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(94, 23, 235, 0.4);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-mobile-primary:active {
  transform: scale(0.98);
  filter: brightness(0.9);
}

.btn-block {
  width: 100%;
}

.mobile-alert-danger {
  margin-top: 14px;
  background: rgba(255, 61, 113, 0.15);
  border: 1px solid rgba(255, 61, 113, 0.3);
  color: #ff6b8b;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-auth-footer {
  text-align: center;
  margin-top: 20px;
}

.link-desktop-switch {
  color: #94a3b8;
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-desktop-switch:hover {
  color: #ffffff;
}

/* Selección de Sucursal */
.branch-icon-header {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(94, 23, 235, 0.2);
  color: #8c52ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 12px;
}

.mobile-branch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.mobile-branch-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.mobile-branch-item:active {
  background: rgba(94, 23, 235, 0.25);
  border-color: var(--primary-color);
  transform: scale(0.98);
}

.branch-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.branch-lareina .branch-item-icon { background: rgba(0, 230, 118, 0.2); color: #00e676; }
.branch-nunoa .branch-item-icon { background: rgba(255, 152, 0, 0.2); color: #ff9800; }
.branch-virtual .branch-item-icon { background: rgba(0, 188, 212, 0.2); color: #00bcd4; }

.branch-item-info {
  flex: 1;
}

.branch-item-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.branch-item-desc {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.branch-item-arrow {
  color: #64748b;
  font-size: 0.9rem;
}

/* ========================================================
   2. APP SHELL & CABECERA MOBILE
   ======================================================== */
.mobile-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: var(--bottom-bar-height);
  background-color: var(--bg-app);
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: var(--shadow-sm);
}

.header-action-left, .header-action-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-icon-btn:active {
  background: var(--border-color);
}

.mobile-brand-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-kpi-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ========================================================
   3. MENÚ DE HAMBURGUESA (OFF-CANVAS DRAWER)
   ======================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82vw;
  max-width: 320px;
  background: var(--bg-card);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.mobile-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--border-light);
}

.drawer-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-avatar {
  font-size: 2.2rem;
  color: var(--primary-color);
}

.drawer-user-meta {
  display: flex;
  flex-direction: column;
}

.drawer-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.drawer-rut {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.drawer-branch-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.drawer-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin: 14px 6px 6px;
}

.drawer-nav-list {
  list-style: none;
}

.drawer-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease;
}

.drawer-nav-item:active {
  background: var(--border-color);
}

.drawer-nav-item i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.drawer-switch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.drawer-switch-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-main);
}

.nav-badge {
  margin-left: auto;
  background: var(--danger-color);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

/* Switch styling */
.mobile-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.mobile-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mobile-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color);
  transition: .25s;
  border-radius: 34px;
}

.mobile-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

input:checked + .mobile-slider {
  background-color: var(--primary-color);
}

input:checked + .mobile-slider:before {
  transform: translateX(20px);
}

/* ========================================================
   4. BARRA DE FILTROS DESLIZABLE (CHIPS)
   ======================================================== */
.mobile-filter-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 10px;
}

.filter-chips-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips-container::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--border-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

.chip.active i {
  color: #ffffff !important;
}

/* ========================================================
   5. BARRA DE NAVEGACIÓN ENTRE PEDIDOS
   ======================================================== */
.mobile-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-app);
}

.nav-btn-touch {
  width: 44px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.nav-btn-touch:active {
  background: var(--border-color);
  transform: scale(0.95);
}

.nav-order-counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-counter-main {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-toggle-search {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 4px 6px;
  cursor: pointer;
}

/* Drawer de búsqueda */
.mobile-search-drawer {
  padding: 0 12px 10px;
  background: var(--bg-app);
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box i.fa-search {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.search-input-box input {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.mobile-search-results {
  margin-top: 6px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.search-result-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.search-result-row:active {
  background: var(--border-light);
}

/* ========================================================
   6. CONTENIDO PRINCIPAL: TARJETA DE PEDIDO ACTIVO
   ======================================================== */
.mobile-content-area {
  flex: 1;
  padding: 10px 12px 20px;
  overflow-y: auto;
}

.mobile-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.mobile-empty-state i {
  font-size: 3.5rem;
  margin-bottom: 14px;
  color: var(--text-light);
}

/* Tarjeta del Pedido */
.order-card-mobile {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.order-card-header {
  padding: 16px;
  background: linear-gradient(180deg, var(--border-light) 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border-color);
}

.order-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-number-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary-color);
}

.order-courier-tag {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  background: #374151;
}

.courier-alpha { background: linear-gradient(135deg, #ec4899, #db2777); }
.courier-bluexpress { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.courier-starken { background: linear-gradient(135deg, #10b981, #059669); }
.courier-chilexpress { background: linear-gradient(135deg, #f59e0b, #d97706); }
.courier-falabella { background: linear-gradient(135deg, #84cc16, #65a30d); }
.courier-flex { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.order-customer-info {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
}

.customer-name {
  font-weight: 600;
}

.customer-address {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Barra de Progreso del Pedido */
.order-progress-wrapper {
  margin-top: 12px;
}

.order-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.order-progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.order-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  width: 0%;
  transition: width 0.3s ease;
}

/* Banner de Observaciones */
.order-obs-banner {
  margin: 12px 16px 0;
  padding: 10px 12px;
  background: rgba(255, 61, 113, 0.08);
  border-left: 4px solid var(--danger-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.order-obs-banner i {
  color: var(--danger-color);
  margin-top: 2px;
}

/* Lista de Ítems / Productos */
.order-items-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card-mobile {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  position: relative;
  transition: all 0.2s ease;
}

.item-card-mobile.completed-item {
  border-color: var(--success-color);
  background: rgba(0, 230, 118, 0.04);
}

.item-thumb-wrapper {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  background: var(--border-light);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}

.item-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zoom-hint-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.6rem;
  padding: 2px 4px;
  border-radius: 4px;
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-sku-pill {
  display: inline-block;
  margin-top: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

/* Badge de Ubicación en Bodega */
.item-location-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

body.dark-mode .item-location-badge {
  background: #78350f;
  color: #fef3c7;
}

.item-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}

.quantity-pill-mobile {
  font-size: 0.88rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--border-color);
  color: var(--text-main);
}

.quantity-pill-mobile.done {
  background: var(--success-color);
  color: #004d25;
}

.item-quick-actions {
  display: flex;
  gap: 6px;
}

.btn-item-action {
  background: var(--border-light);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-item-action:active {
  background: var(--border-color);
}

/* ========================================================
   7. BARRA INFERIOR FIJA CON ACCIÓN DE ESCANEO
   ======================================================== */
.mobile-sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}

.footer-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-footer-tool {
  width: 48px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--border-light);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-camera-fab {
  flex: 1;
  height: 52px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #8c52ff 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-fab);
  position: relative;
  overflow: hidden;
}

.btn-camera-fab:active {
  transform: scale(0.98);
}

.fab-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: pulseFab 2.2s infinite;
}

@keyframes pulseFab {
  0% { box-shadow: 0 0 0 0 rgba(94, 23, 235, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(94, 23, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 23, 235, 0); }
}

.btn-verify-footer {
  width: 80px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--success-color);
  color: #004d25;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-verify-footer.disabled {
  opacity: 0.35;
  pointer-events: none;
  background: var(--border-color);
  color: var(--text-muted);
}

/* Barra de ingreso manual desplegable */
.manual-sku-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.manual-sku-bar input {
  flex: 1;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0 12px;
  font-size: 0.95rem;
  background: var(--bg-elevated);
  color: var(--text-main);
  outline: none;
}

.btn-manual-submit {
  width: 44px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  font-size: 1.1rem;
}

.btn-manual-close {
  width: 44px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--border-light);
  color: var(--text-muted);
  border: none;
  font-size: 1.1rem;
}

/* ========================================================
   8. VISOR DE CÁMARA PARA ESCANEO
   ======================================================== */
.mobile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  backdrop-filter: blur(4px);
}

.camera-modal-content {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #000000;
}

.camera-modal-header {
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.8);
  color: #ffffff;
  z-index: 10;
}

.camera-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--success-color);
}

.camera-controls {
  display: flex;
  gap: 12px;
}

.btn-camera-ctrl {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-camera-ctrl.active {
  background: var(--warning-color);
  color: #000000;
}

.camera-viewport-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cameraReader {
  width: 100% !important;
  height: 100% !important;
}

#cameraReader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Recuadro de Enfoque / Aim Box */
.camera-aim-box {
  position: absolute;
  width: 72vw;
  max-width: 280px;
  height: 180px;
  pointer-events: none;
}

.aim-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--success-color);
  border-style: solid;
}

.aim-corner.top-left { top: 0; left: 0; border-width: 4px 0 0 4px; border-top-left-radius: 8px; }
.aim-corner.top-right { top: 0; right: 0; border-width: 4px 4px 0 0; border-top-right-radius: 8px; }
.aim-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 4px 4px; border-bottom-left-radius: 8px; }
.aim-corner.bottom-right { bottom: 0; right: 0; border-width: 0 4px 4px 0; border-bottom-right-radius: 8px; }

.laser-scanner-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--success-color), transparent);
  box-shadow: 0 0 10px var(--success-color);
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 10%; opacity: 0.3; }
  50% { top: 85%; opacity: 1; }
  100% { top: 10%; opacity: 0.3; }
}

.camera-modal-footer {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.85);
  text-align: center;
  color: #ffffff;
}

.camera-instruction {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.btn-subaction {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  cursor: pointer;
}

/* ========================================================
   9. MODALES TIPO BOTTOM SHEET
   ======================================================== */
.mobile-sheet-modal {
  width: 100%;
  max-height: 90dvh;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin: 0 auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-close-sheet {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.label-instruction-card {
  background: var(--primary-light);
  border-left: 4px solid var(--primary-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.sheet-divider {
  text-align: center;
  margin: 16px 0;
  position: relative;
}

.sheet-divider:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.sheet-divider span {
  position: relative;
  background: var(--bg-card);
  padding: 0 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pickup-checkbox-card {
  background: var(--border-light);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.pickup-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.pickup-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.btn-mobile-success {
  height: 50px;
  background: var(--success-color);
  color: #004d25;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

/* Modal Fullscreen */
.mobile-full-modal {
  width: 100%;
  height: 94dvh;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.full-modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.full-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Modal Zoom Imagen */
.image-zoom-card {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  margin: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.image-zoom-card img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.btn-close-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

.zoom-caption {
  padding: 10px 14px;
  background: #ffffff;
  color: #0f172a;
}

.zoom-title { display: block; font-weight: 600; font-size: 0.88rem; }
.zoom-sku { font-family: monospace; font-size: 0.8rem; color: var(--primary-color); }

/* Utilidades */
.text-orange { color: #f97316 !important; }
.text-teal { color: #14b8a6 !important; }
.text-purple { color: #a855f7 !important; }
.text-cyan { color: #06b6d4 !important; }
.text-blue { color: #3b82f6 !important; }
.text-amber { color: #f59e0b !important; }
.text-yellow { color: #eab308 !important; }
.text-pink { color: #ec4899 !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-secondary { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-3 { margin-bottom: 14px; }

/* Barra de búsqueda con botón de acción */
.search-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-action-row input {
  flex: 1;
  height: 48px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
}

.search-action-row input:focus {
  border-color: var(--primary-color);
}

.btn-mobile-secondary {
  height: 48px;
  padding: 0 16px;
  background: var(--border-light);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-mobile-secondary:active {
  background: var(--border-color);
}

.query-result-box {
  margin-top: 14px;
}
