/* =========================================================
   Vape O Shop — Ecran de caisse
   ========================================================= */

.pos-screen { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* ── Barre du haut ─────────────────────────────────────── */
.pos-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: 10px var(--space-md); background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color); min-height: 62px; flex-shrink: 0;
}
.pos-topbar-left, .pos-topbar-right { display: flex; align-items: center; gap: var(--space-sm); }
.pos-logo { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.02em; color: var(--brand-light); }
.pos-user { display: flex; align-items: center; gap: 7px; padding: 5px 12px;
  background: var(--bg-tertiary); border-radius: var(--radius-full); font-size: var(--fs-sm); }
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green);
  animation: pulse 2.4s infinite; }
.register-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2;
  padding: 4px 12px; border-left: 1px solid var(--border-color); }
.register-chip .label { font-size: var(--fs-xs); color: var(--text-muted); }
.register-chip .value { font-family: var(--mono); font-weight: 700; color: var(--brand-light); }

.topbar-badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px;
  padding: 0 4px; border-radius: var(--radius-full); background: var(--accent-red); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 19px; text-align: center; }

/* ── Corps : catalogue | panier ────────────────────────── */
.pos-main { flex: 1; display: grid; grid-template-columns: 1fr 400px; overflow: hidden; }
@media (max-width: 1100px) { .pos-main { grid-template-columns: 1fr 340px; } }

.pos-catalog { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-primary); }

.pos-search-bar { display: flex; gap: var(--space-sm); padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color); background: var(--bg-secondary); }
.pos-search-bar .input { flex: 1; font-size: var(--fs-lg); }
/* Bouton de saisie manuelle d'un code-barres.
   Volontairement discret : la douchette fonctionne sans passer par lui.
   Il clignote en vert a chaque code reconnu, en rouge sinon. */
.scan-indicator { display: flex; align-items: center; gap: 6px; padding: 0 12px;
  min-height: var(--touch); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); background: var(--bg-tertiary); color: var(--text-muted);
  font-family: var(--font); font-size: var(--fs-xs); font-weight: 700;
  white-space: nowrap; cursor: pointer; transition: all var(--t-fast); }
.scan-indicator:hover { border-color: var(--brand-dark); color: var(--brand-light); }
.scan-indicator:active { transform: scale(.96); }
.scan-indicator.scan-ok { background: rgba(34,197,94,.22); color: #4ade80;
  border-color: var(--accent-green); }
.scan-indicator.scan-ko { background: rgba(239,68,68,.22); color: #f87171;
  border-color: var(--accent-red); animation: shake .35s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0) }
  25% { transform: translateX(-4px) }
  75% { transform: translateX(4px) }
}

.pos-categories { display: flex; gap: var(--space-sm); padding: var(--space-sm) var(--space-md);
  overflow-x: auto; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.cat-chip { display: flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 42px;
  border: 1px solid var(--border-color); border-radius: var(--radius-full);
  background: var(--bg-card); color: var(--text-secondary); font-size: var(--fs-sm);
  font-weight: 600; cursor: pointer; white-space: nowrap; transition: all var(--t-fast); }
.cat-chip:hover { border-color: var(--border-light); color: var(--text-primary); }
.cat-chip.active { background: var(--brand); border-color: var(--brand); color: #04211d; }

.pos-products { flex: 1; overflow-y: auto; padding: var(--space-md);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: var(--space-sm); align-content: start; }

.product-tile {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  min-height: 116px; padding: 10px; text-align: left; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font); transition: all var(--t-fast); overflow: hidden;
}
.product-tile:hover { border-color: var(--brand-dark); background: var(--bg-hover); }
.product-tile:active { transform: scale(.97); }
.product-tile.out-of-stock { opacity: .55; }
.product-tile .tile-brand { font-size: var(--fs-xs); color: var(--brand-light); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; }
.product-tile .tile-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-tile .tile-variant { font-size: var(--fs-xs); color: var(--text-secondary); }
.product-tile .tile-footer { margin-top: auto; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 6px; }
.product-tile .tile-price { font-size: var(--fs-lg); font-weight: 800; color: var(--brand-light);
  font-family: var(--mono); }
.product-tile .tile-stock { font-size: var(--fs-xs); font-weight: 700; padding: 1px 7px;
  border-radius: var(--radius-full); }
.stock-ok { background: rgba(34,197,94,.15); color: #4ade80; }
.stock-low { background: rgba(245,158,11,.15); color: #fbbf24; }
.stock-out { background: rgba(239,68,68,.15); color: #f87171; }
.tile-flag { position: absolute; top: 6px; right: 6px; font-size: 11px; }
.tile-variants-hint { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800;
  background: var(--accent-violet); color: #fff; border-radius: var(--radius-full); padding: 1px 6px; }

/* ── Panier ────────────────────────────────────────────── */
.pos-cart { display: flex; flex-direction: column; background: var(--bg-secondary);
  border-left: 1px solid var(--border-color); overflow: hidden; }

.cart-customer { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); }
.cart-customer-btn { width: 100%; display: flex; align-items: center; gap: var(--space-sm);
  padding: 9px 12px; min-height: 46px; background: var(--bg-tertiary); border: 1px dashed var(--border-light);
  border-radius: var(--radius-md); color: var(--text-secondary); cursor: pointer;
  font-family: var(--font); font-size: var(--fs-sm); text-align: left; }
.cart-customer-btn:hover { border-color: var(--brand-dark); color: var(--text-primary); }
.cart-customer-btn.filled { border-style: solid; border-color: var(--brand-dark);
  background: rgba(20,184,166,.09); color: var(--text-primary); }
.cart-customer-info { flex: 1; line-height: 1.25; overflow: hidden; }
.cart-customer-info .name { font-weight: 700; }
.cart-customer-info .meta { font-size: var(--fs-xs); color: var(--text-muted); }

.cart-items { flex: 1; overflow-y: auto; padding: var(--space-sm); }
.cart-empty { text-align: center; padding: var(--space-2xl) var(--space-md); color: var(--text-muted); }
.cart-empty .icon { font-size: 2.8rem; opacity: .5; margin-bottom: var(--space-sm); }

.cart-item { display: flex; gap: var(--space-sm); padding: 10px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.cart-item.discounted { border-color: var(--accent-amber); }
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; }
.cart-item-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.cart-item-price { font-family: var(--mono); font-size: var(--fs-sm); font-weight: 700; }
.cart-item-old { text-decoration: line-through; color: var(--text-muted); margin-right: 6px; font-weight: 400; }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.qty-control { display: flex; align-items: center; gap: 2px; background: var(--bg-tertiary);
  border-radius: var(--radius-sm); overflow: hidden; }
.qty-btn { width: 30px; height: 30px; border: none; background: transparent; color: var(--text-primary);
  font-size: var(--fs-lg); cursor: pointer; line-height: 1; }
.qty-btn:hover { background: var(--bg-hover); color: var(--brand-light); }
.qty-value { min-width: 30px; text-align: center; font-weight: 700; font-family: var(--mono); }
.cart-item-tools { display: flex; gap: 3px; }
.icon-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn.danger:hover { background: var(--accent-red); color: #fff; }

.cart-summary { border-top: 1px solid var(--border-color); padding: var(--space-md);
  background: var(--bg-tertiary); flex-shrink: 0; }
.summary-row { display: flex; justify-content: space-between; font-size: var(--fs-sm);
  color: var(--text-secondary); margin-bottom: 5px; }
.summary-row.total { font-size: var(--fs-2xl); font-weight: 800; color: var(--text-primary);
  border-top: 1px solid var(--border-color); padding-top: 10px; margin-top: 10px; }
.summary-row.total .amount { color: var(--brand-light); font-family: var(--mono); }
.summary-row .value { font-family: var(--mono); }

.cart-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.cart-actions .btn { min-height: 40px; padding: 4px; font-size: var(--fs-xs); flex-direction: column; gap: 2px; }
.checkout-btn { width: 100%; min-height: var(--touch-lg); font-size: var(--fs-xl); font-weight: 800; }

/* ── Pave numerique de paiement ────────────────────────── */
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
@media (max-width: 720px) { .payment-grid { grid-template-columns: 1fr; } }

.payment-total { text-align: center; padding: var(--space-md); background: var(--bg-tertiary);
  border-radius: var(--radius-lg); margin-bottom: var(--space-md); }
.payment-total .label { font-size: var(--fs-sm); color: var(--text-secondary); }
.payment-total .amount { font-size: var(--fs-3xl); font-weight: 800; color: var(--brand-light);
  font-family: var(--mono); }
.payment-remaining { font-size: var(--fs-lg); font-weight: 700; }

.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
.pay-method { display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); color: var(--text-primary); cursor: pointer;
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 600; transition: all var(--t-fast); }
.pay-method:hover { border-color: var(--brand-dark); background: var(--bg-hover); }
.pay-method .emoji { font-size: 1.5rem; }
.pay-method.selected { background: var(--brand); border-color: var(--brand); color: #04211d; }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad button { height: 56px; border: 1px solid var(--border-color); background: var(--bg-card);
  border-radius: var(--radius-md); color: var(--text-primary); font-size: var(--fs-xl);
  font-weight: 600; cursor: pointer; }
.numpad button:hover { background: var(--bg-hover); border-color: var(--brand-dark); }
.numpad button:active { transform: scale(.95); }
.numpad button.wide { grid-column: span 2; }

.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: var(--space-sm); }
.quick-cash button { height: 42px; border: 1px solid var(--border-color); background: var(--bg-card);
  border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--mono);
  font-weight: 700; cursor: pointer; font-size: var(--fs-sm); }
.quick-cash button:hover { background: var(--brand-dark); }

.payment-lines { margin-top: var(--space-sm); }
.payment-line { display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 5px;
  font-size: var(--fs-sm); }

.change-box { text-align: center; padding: var(--space-lg); background: rgba(34,197,94,.10);
  border: 1px solid var(--accent-green); border-radius: var(--radius-lg); margin: var(--space-md) 0; }
.change-box .amount { font-size: var(--fs-3xl); font-weight: 800; color: #4ade80; font-family: var(--mono); }

/* ── Controle d'age ────────────────────────────────────── */
.age-check { text-align: center; }
.age-check .big-icon { font-size: 3.4rem; margin-bottom: var(--space-sm); }
.age-warning { background: rgba(245,158,11,.10); border: 1px solid var(--accent-amber);
  border-radius: var(--radius-md); padding: var(--space-md); margin: var(--space-md) 0;
  font-size: var(--fs-sm); color: #fbbf24; }

/* ── Recherche client ──────────────────────────────────── */
.customer-result { display: flex; align-items: center; gap: var(--space-md); padding: 11px;
  border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 6px;
  cursor: pointer; background: var(--bg-card); }
.customer-result:hover { border-color: var(--brand); background: var(--bg-hover); }
.customer-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: #04211d;
  flex-shrink: 0; }
.customer-result .info { flex: 1; min-width: 0; }
.customer-result .name { font-weight: 700; }
.customer-result .meta { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Selecteur de declinaison ──────────────────────────── */
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--space-sm); }
.variant-tile { padding: 12px; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); cursor: pointer; text-align: center; color: var(--text-primary);
  font-family: var(--font); }
.variant-tile:hover { border-color: var(--brand); background: var(--bg-hover); }
.variant-tile .label { font-weight: 700; font-size: var(--fs-sm); }
.variant-tile .price { font-family: var(--mono); color: var(--brand-light); font-weight: 700; }
.variant-tile .stock { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Comptage de caisse ────────────────────────────────── */
.denom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-sm); }
.denom-row { display: flex; align-items: center; gap: var(--space-sm); background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 6px 10px; }
.denom-row .denom-label { min-width: 62px; font-family: var(--mono); font-weight: 700; }
.denom-row .input { min-height: 34px; padding: 4px 8px; text-align: right; }
.denom-row .denom-total { min-width: 68px; text-align: right; font-family: var(--mono);
  font-size: var(--fs-sm); color: var(--text-muted); }
