/* ═══════════════════════════════════════════════
   LAYOUT — App shell, Topbar, Nav, Grilles
═══════════════════════════════════════════════ */

#root { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-shell { display: flex; flex-direction: column; height: 100%; background: #f0f4f8; }

/* ── TOPBAR ───────────────────────────────── */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 0 1px 4px #0000000a;
}

.topbar-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 8px;
  min-height: 52px;
}

.topbar-row2 {
  display: flex;
  align-items: center;
  padding: 0 8px 6px;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topbar-row2::-webkit-scrollbar { display: none; }

.topbar-left  { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.topbar-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 2px 8px #2563eb30;
}

.topbar-store { font-family: 'Playfair Display', serif; font-size: 15px; color: #1e293b; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.topbar-info  { font-size: 10px; color: #94a3b8; margin-top: 1px; font-family: 'DM Mono', monospace; }
.topbar-clock { font-family: 'DM Mono', monospace; font-size: 12px; color: #2563eb; font-weight: 600; background: #eff6ff; padding: 4px 9px; border-radius: 7px; border: 1px solid #bfdbfe; white-space: nowrap; }
.topbar-cur   { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 4px 9px; font-family: 'DM Mono', monospace; font-size: 12px; color: #16a34a; font-weight: 700; white-space: nowrap; }

/* ── NAV BTN ──────────────────────────────── */
.nav-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  border-radius: 8px; border: none;
  background: transparent; color: #64748b;
  font-weight: 500; font-size: 12px;
  cursor: pointer; white-space: nowrap;
  font-family: 'Lato', sans-serif;
  transition: all .15s;
}
.nav-btn.active { background: #eff6ff; color: #2563eb; font-weight: 700; }
.nav-btn:hover  { background: #f1f5f9; }

.nav-badge {
  background: #ef4444; color: #fff;
  border-radius: 9px; font-size: 9px;
  padding: 2px 6px; font-weight: 700;
  font-family: 'DM Mono', monospace;
}

/* ── SCREEN ───────────────────────────────── */
.screen { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.screen-scroll { flex: 1; overflow-y: auto; padding: 18px; }

/* ── CAISSE GRID ──────────────────────────── */
.caisse-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 390px;
  overflow: hidden;
  min-height: 0;
}

.caisse-left {
  display: flex; flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
}

.caisse-right {
  display: flex; flex-direction: column;
  overflow-y: auto;
  background: #ffffff;
}

/* ── SCANNER BAR ──────────────────────────── */
.scanner-bar {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.scanner-input-wrap { display: flex; gap: 10px; align-items: center; }
.scanner-hint { font-size: 10px; color: #94a3b8; margin-top: 6px; font-family: 'DM Mono', monospace; }

/* ── QUICK BAR ────────────────────────────── */
.quick-bar { padding: 10px 16px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; overflow-x: auto; background: #ffffff; }
.quick-bar-inner { display: flex; gap: 9px; width: max-content; }

/* ── PANIER ───────────────────────────────── */
.cart-container { flex: 1; overflow-y: auto; padding: 14px 16px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; opacity: .35; gap: 12px; }

/* ── BOTTOM BAR ───────────────────────────── */
.bottom-bar {
  border-top: 1px solid #e2e8f0;
  padding: 12px 16px;
  background: #ffffff;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  box-shadow: 0 -2px 8px #0000000a;
}

/* ── CATALOGUE ────────────────────────────── */
.catalogue-header { display: flex; align-items: center; border-bottom: 1px solid #e2e8f0; background: #ffffff; padding-right: 16px; }
.catalogue-search { padding: 12px 16px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; background: #ffffff; }

/* ── PARAMÈTRES ───────────────────────────── */
.params-wrap { max-width: 860px; margin: 0 auto; padding: 22px 22px 40px; }
.params-tabs { display: flex; border-bottom: 2px solid #e2e8f0; gap: 2px; margin-bottom: 22px; overflow-x: auto; }

/* ── GRILLES ──────────────────────────────── */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-cur { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }

/* ── FLEX UTILS ───────────────────────────── */
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-14 { gap: 14px; }
.flex-1 { flex: 1; } .flex-shrink-0 { flex-shrink: 0; } .wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; } .text-right { text-align: right; } .text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mb-14 { margin-bottom: 14px; }

/* ══════════════════════════════════════════
   RESPONSIVE MOBILE
══════════════════════════════════════════ */
@media (max-width: 768px) {

  /* App shell devient scrollable sur mobile */
  #root { height: auto; min-height: 100vh; overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .screen { overflow: visible; flex: none; }

  /* Caisse en colonne */
  .caisse-grid {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
  }
  .caisse-left {
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    border-right: none !important;
    border-bottom: 2px solid #e2e8f0;
  }
  .caisse-right {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    height: auto !important;
    padding-bottom: 80px;
  }
  .caisse-right .screen-scroll {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    padding-bottom: 20px;
  }

  /* Grilles */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }

  /* Topbar */
  .topbar-store { max-width: 130px; font-size: 13px; }
  .topbar-clock { font-size: 11px; padding: 3px 7px; }
  .topbar-cur   { font-size: 11px; padding: 3px 7px; }

  /* Quick bar */
  .quick-bar { padding: 8px 10px; }
  .quick-card { min-width: 75px; padding: 8px; }

  /* Inputs */
  input, select, textarea { font-size: 16px !important; }

  /* Params */
  .params-wrap { padding: 12px 12px 60px; }

  /* Screen scroll */
  .screen-scroll { padding: 12px; }
}

@media (max-width: 480px) {
  .topbar-row1 { padding: 6px 10px; }
  .topbar-store { max-width: 100px; font-size: 12px; }
  .nav-btn { font-size: 11px; padding: 6px 10px; }
}
