/* STYLEE PDV Prototype v2 — tablet-first split + overlays + customer display */
:root{
  --bg:#f5f6f8;
  --panel:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --accent:#f97316;  /* CTA */
  --primary:#3b5ccc; /* header */
  --danger:#ef4444;
  --ok:#22c55e;
  --shadow: 0 10px 25px rgba(2,8,23,.08);
  --r:16px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; overflow:hidden; }
body{ margin:0; overflow:hidden; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background:var(--bg); color:var(--ink); }
button,input,select{ font:inherit; }
button{ cursor:pointer; }
a{ color:inherit; }

.topbar{
  height:56px;
  background:var(--primary);
  color:#fff;
  display:flex;
  align-items:center;
  padding:0 16px;
  gap:12px;
}
.brand{ font-weight:800; letter-spacing:.2px; }
.spacer{ flex:1; }
.iconbtn{
  height:40px; min-width:40px;
  border:none; border-radius:12px;
  background:rgba(255,255,255,.14);
  color:#fff;
  display:inline-flex; align-items:center; justify-content:center;
}
.iconbtn.badgeDot{ position:relative; }
.iconbtn.badgeDot::after{
  content:'';
  width:8px;height:8px;border-radius:999px;
  background: var(--ok);
  position:absolute; top:8px; right:8px;
  display:none;
}
.iconbtn.badgeDot.online::after{ display:block; }

.shell{
  height: calc(100dvh - 56px);
  height: calc(100vh - 56px);
  display:flex;
  gap:12px;
  padding:12px;
}

.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-width:0;
}
.panel.catalog{ flex: 0 0 60%; }
.panel.cart{ flex: 0 0 40%; }

.panelHeader{
  padding:12px;
  border-bottom:1px solid var(--line);
  display:flex;
  gap:10px;
  align-items:center;
}
.search{
  flex:1;
  display:flex;
  gap:10px;
  align-items:center;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:10px 12px;
}
.search input{
  border:none; outline:none;
  background:transparent;
  width:100%;
}
.pill{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:8px 10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.segment{
  display:flex;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}
.segment button{
  height:40px;
  min-width:48px;
  border:none;
  background:#fff;
}
.segment button.active{
  background:#eef2ff;
  color:#1e3a8a;
  font-weight:800;
}
.content{ flex:1; min-height:0; overflow:auto; -webkit-overflow-scrolling: touch; }

.grid{
  padding:12px;
  display:grid;
  gap:12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1100px){
  .panel.catalog{ flex-basis:55%; }
  .panel.cart{ flex-basis:45%; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px){
  .shell{ flex-direction:column; }
  .panel.catalog,.panel.cart{ flex-basis:auto; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card{
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  display:flex;
  flex-direction:column;
  box-shadow: 0 6px 18px rgba(2,8,23,.06);
}
.card img{
  width:100%;
  height:140px;
  object-fit:cover;
  background:#e2e8f0;
}
.cardBody{
  padding:10px 10px 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.cardTitle{
  font-weight:800;
  line-height:1.15;
  font-size:15px;
  min-height: 34px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.price{
  font-size:18px;
  font-weight:900;
  letter-spacing:.2px;
}
.micro{
  font-size:12px;
  color:var(--muted);
}

.list{ padding:6px 0; }
.row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}
.row img{
  width:48px; height:48px;
  border-radius:12px;
  object-fit:cover;
  background:#e2e8f0;
}
.rowMain{ flex:1; min-width:0; }
.rowMain .t{
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.rowMain .s{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.rowPrice{ font-weight:900; color:#1e3a8a; }

.cartTop{
  padding:12px;
  border-bottom:1px solid var(--line);
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.totalBox{ flex:1; }
.totalLabel{ color:var(--muted); font-size:12px; }
.totalValue{ font-size:26px; font-weight:900; }
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:#0f172a;
  font-size:12px;
}
.cartList{ flex:1; min-height:0; padding:6px 0; overflow:auto; }
.cartItem{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:12px 12px;
  border-bottom:1px solid var(--line);
}
.cartItem .ciTop{ display:flex; gap:10px; align-items:flex-start; }
.cartItem .ciName{ font-weight:900; font-size:16px; line-height:1.15; word-break:break-word; }
.cartItem .ciSub{ margin-top:4px; font-size:12px; color:var(--muted); word-break:break-word; }
.cartItem .ciBottom{ display:flex; gap:10px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.cartItem .ciPrice{ font-weight:900; color:#1e3a8a; }

.cartItem .name{ flex:1; min-width:0; font-weight:900; }
.cartItem .sub{ font-size:12px; color:var(--muted); }
.qtyCtl{ flex:0 0 auto; 
  display:flex;
  align-items:center;
  gap:8px;
}
.qtyCtl button{
  width:44px; height:44px;
  border:none;
  border-radius:14px;
  background:#eef2ff;
  color:#1e3a8a;
  font-weight:900;
}
.qty{
  width:44px;
  text-align:center;
  font-weight:900;
}
.trash{
  width:44px; height:44px;
  border:none;
  border-radius:14px;
  background:#fee2e2;
  color:#7f1d1d;
  font-weight:900;
}

.cartFooter{
  position: sticky;
  bottom: 0;
  background: var(--panel);
  flex:0 0 auto;
padding:12px;
  border-top:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:10px;

}

.cta{
  height:56px;
  border:none;
  border-radius:16px;
  background:var(--accent);
  color:#fff;
  font-weight:900;
  font-size:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.actions{
  display:flex;
  gap:10px;
}
.actions button{
  flex:1;
  height:52px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
}
.actions button.danger{
  border-color:#fecaca;
  background:#fff1f2;
  color:#7f1d1d;
}

.toast{
  position: fixed;
  left: 12px;
  bottom: 12px;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  box-shadow: var(--shadow);
  display:flex;
  gap:10px;
  align-items:center;
  max-width: 92vw;
  z-index: 50;
  opacity: 0;
  transform: translateY(10px);
  transition: .18s ease;
}
.toast.show{ opacity:1; transform: translateY(0); }
.toast .dot{ width:10px; height:10px; border-radius:999px; background: var(--ok); }

/* Overlay / modal */
.overlay{
  position:fixed;
  inset:0;
  background: rgba(2,8,23,.45);
  display:none;
  align-items:flex-end;
  justify-content:center;
  z-index: 60;
}
.overlay.show{ display:flex; }
.sheet{
  width: min(920px, 100%);
  background:#fff;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  border:1px solid var(--line);
  overflow:hidden;
}
.sheetHeader{
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:10px;
}
.sheetHeader .h{ font-weight:900; }
.sheetBody{ padding:14px 16px; }
.sheetActions{
  padding:14px 16px;
  border-top:1px solid var(--line);
  display:flex;
  gap:10px;
}
.sheetActions button{
  flex:1;
  height:56px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
}
.sheetActions button.primary{
  background:var(--accent);
  border:none;
  color:#fff;
}
.kbd{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.kbd button{
  height:64px;
  border-radius:18px;
  border:1px solid var(--line);
  background:#fff;
  font-size:22px;
  font-weight:900;
}
.kbd button.secondary{ background:#f1f5f9; }
.kbdDisplay{
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:12px 14px;
  font-size:22px;
  font-weight:900;
  text-align:right;
  margin-bottom:12px;
}

/* Payment grid */
.payGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
.payTile{
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  height:110px;
  background:#fff;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
  font-weight:900;
}
.payTile .sub{ font-size:12px; color:var(--muted); font-weight:700; }

/* Scanner view */
.scanWrap{
  display:flex;
  gap:12px;
  align-items:flex-start;
  flex-wrap:wrap;
}
.videoBox{
  flex: 0 0 380px;
  height:280px;
  background:#0b1220;
  border-radius:18px;
  overflow:hidden;
  position:relative;
}
.videoBox video{
  width:100%;
  height:100%;
  object-fit:cover;
  transform: rotate(-90deg); /* câmera 270° => -90° */
  transform-origin:center;
}
.videoHint{
  position:absolute;
  left:12px;
  bottom:12px;
  padding:8px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.12);
  color:#fff;
  font-size:12px;
  border:1px solid rgba(255,255,255,.18);
}
.scanActions{ display:flex; gap:10px; flex-wrap:wrap; }
.scanActions button{
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
}

/* Customer display */
body.customer{ background:#0b1220; }
.customerShell{
  height:100vh;
  display:flex;
  padding:18px;
  gap:18px;
}
.customerLeft{
  flex: 0 0 62%;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:22px;
  padding:18px;
  color:#fff;
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
}
.customerRight{
  flex: 1;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:22px;
  padding:18px;
  color:#fff;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.cTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.cTitle .big{ font-weight:900; font-size:20px; letter-spacing:.2px; }
.cTotal{ font-weight:900; font-size:44px; }
.cList{
  overflow:auto;
  border-top:1px solid rgba(255,255,255,.10);
  padding-top:12px;
}
.cItem{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.cItem img{
  width:60px; height:60px;
  border-radius:16px;
  object-fit:cover;
  background:#0f172a;
}
.cItem .n{ font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cItem .m{ font-size:12px; opacity:.85; }
.cItem .p{ font-weight:900; margin-left:auto; }
.cHighlight{
  outline: 2px solid rgba(34,197,94,.9);
  outline-offset: 3px;
  border-radius:18px;
}
.cHero{
  display:flex;
  gap:14px;
  align-items:center;
}
.cHero img{
  width:120px; height:120px;
  border-radius:22px;
  object-fit:cover;
  background:#0f172a;
}
.cHero .h1{ font-weight:900; font-size:28px; line-height:1.05; }
.cHero .h2{ font-weight:900; font-size:18px; opacity:.9; }
.cHero .h3{ font-size:13px; opacity:.8; }

.smallNote{
  font-size:12px;
  color:rgba(255,255,255,.75);
}

/* Settings form */
.form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.field label{ font-weight:900; }
.field input{
  height:46px;
  border-radius:14px;
  border:1px solid var(--line);
  padding:0 12px;
  outline:none;
}
.hint{ font-size:12px; color:var(--muted); }


.catalogContent{ flex:1; min-height:0; overflow:auto; padding:10px 12px 12px; }

.cartItem.pulse{ animation: pop .25s ease-out; }
@keyframes pop{ from{ transform:scale(.98); background:#fff7ed; } to{ transform:scale(1); background:#fff; } }
