:root{
  --bg:#0b0f14;
  --surface:#111826;
  --surface2:#0f1624;
  --text:#e8eef7;
  --muted:#a9b4c2;
  --border:rgba(255,255,255,.08);
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --primary:#2dd4bf;
  --primary-2:#14b8a6;
  --danger:#ef4444;
  --warning:#f59e0b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:radial-gradient(1000px 500px at 20% -10%, rgba(45,212,191,.18), transparent 60%),
             radial-gradient(800px 600px at 110% 0%, rgba(59,130,246,.12), transparent 55%),
             var(--bg);
  color:var(--text);
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing:antialiased;
  line-height:1.25;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
button, input, textarea, select{font:inherit}

.container{max-width:980px; margin:0 auto; padding:16px}

.app-header{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:rgba(10,14,20,.65);
  backdrop-filter: blur(10px);
}

.brand{display:flex; align-items:center; gap:12px; min-width:0}
.brand.compact{gap:10px}
.brand-logo{
  width:44px; height:44px;
  border-radius:14px;
  background:linear-gradient(135deg, rgba(45,212,191,.28), rgba(59,130,246,.16));
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  display:grid; place-items:center;
  overflow:hidden;
}
.brand-logo img{width:100%; height:100%; object-fit:cover; display:none}
.brand-logo-fallback{font-weight:800; letter-spacing:.5px; color:rgba(232,238,247,.92)}
.brand-meta{min-width:0}
.brand-app{font-size:12px; color:var(--muted)}
.brand-store{font-size:14px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.icon-btn{
  position:relative;
  border:1px solid var(--border);
  background:rgba(17,24,38,.75);
  color:var(--text);
  border-radius:14px;
  padding:10px 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  cursor:pointer;
}
.icon-btn:active{transform:translateY(1px)}
.icon{font-size:18px}
.badge{
  position:absolute;
  top:-6px; right:-6px;
  background:var(--primary);
  color:#00201b;
  border-radius:999px;
  font-size:12px;
  padding:2px 6px;
  font-weight:800;
  border:1px solid rgba(0,0,0,.25);
}

.search-row{display:flex; gap:10px; align-items:center; margin-top:4px}

.input{
  width:100%;
  background:rgba(17,24,38,.8);
  border:1px solid var(--border);
  color:var(--text);
  border-radius:14px;
  padding:12px 12px;
  outline:none;
}
.input:focus{border-color:rgba(45,212,191,.6); box-shadow:0 0 0 3px rgba(45,212,191,.12)}

.btn{
  border:1px solid var(--border);
  background:rgba(17,24,38,.8);
  color:var(--text);
  border-radius:14px;
  padding:6px 40px;
  cursor:pointer;
  font-weight:700;
}
.btn:active{transform:translateY(1px)}
.btn-small{padding:8px 10px; border-radius:12px; font-size:12px}
.btn-primary{background:linear-gradient(135deg, var(--primary), var(--primary-2)); color:#00201b; border-color:rgba(0,0,0,.2)}
.btn-ghost{background:transparent}

.categories{margin-top:12px}
.categories-scroll{display:flex; gap:10px; overflow:auto; padding:4px 2px 8px}
.chip{
  flex:0 0 auto;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(17,24,38,.55);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
}
.chip.active{border-color:rgba(45,212,191,.55); background:rgba(45,212,191,.14)}

.grid{margin-top:8px}
.grid-products{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (min-width:720px){
  .grid-products{grid-template-columns:repeat(4, minmax(0,1fr))}
}

.card-product{
  border:1px solid var(--border);
  background:rgba(17,24,38,.65);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
  min-height:240px;
  transition:transform .12s ease, border-color .12s ease;
}
.card-product:hover{border-color:rgba(255,255,255,.12)}
.card-product.pulse{animation:cardPulse .28s ease-out}
.card-media{height:auto; aspect-ratio:1/1; background:rgba(255,255,255,.04); display:grid; place-items:center; overflow:hidden}
.card-media img{width:100%; height:100%; object-fit:cover}
.card-body{padding:12px; display:flex; flex-direction:column; gap:8px; flex:1}
.card-title{font-weight:800; font-size:14px; line-height:1.1}
.card-price{color:rgba(232,238,247,.92); font-weight:900}
.card-actions{margin-top:auto}

.btn{transition:transform .12s ease, filter .12s ease}
.btn.pulse{animation:btnPulse .28s ease-out}

@keyframes btnPulse{
  0%{transform:scale(1)}
  35%{transform:scale(1.03)}
  100%{transform:scale(1)}
}

@keyframes cardPulse{
  0%{transform:translateY(0)}
  35%{transform:translateY(-2px)}
  100%{transform:translateY(0)}
}

.row{display:flex; align-items:center; justify-content:space-between; gap:10px}

.fab{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:25;
  border:none;
  border-radius:999px;
  padding:12px 14px;
  background:linear-gradient(135deg, #25D366, #12a64f);
  color:#032012;
  font-weight:900;
  box-shadow:0 16px 40px rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  transition:transform .12s ease, filter .12s ease;
}
.fab:active{transform:translateY(1px)}
.fab-icon{font-size:18px}

.toast{
  position:fixed;
  left:50%;
  bottom:86px;
  transform:translateX(-50%);
  background:rgba(17,24,38,.92);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  box-shadow:var(--shadow);
  z-index:30;
  max-width:92vw;
}
.toast.show{animation:pop .18s ease-out}
@keyframes pop{from{transform:translateX(-50%) scale(.96); opacity:.6}to{transform:translateX(-50%) scale(1); opacity:1}}

.empty-state{
  border:1px dashed rgba(255,255,255,.18);
  background:rgba(17,24,38,.4);
  border-radius:var(--radius);
  padding:18px;
  margin-top:14px;
}
.empty-title{font-weight:900; margin-bottom:6px}
.empty-sub{color:var(--muted); font-size:13px; margin-bottom:12px}

.product-view{display:grid; gap:12px}
@media (min-width:860px){
  .product-view{grid-template-columns:1.2fr 1fr; align-items:start}
}
.product-hero{
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:rgba(255,255,255,.04);
  height:320px;
}
.product-hero img{width:100%; height:100%; object-fit:cover}
.product-hero{aspect-ratio:4/3}
@media (max-width:520px){
  .product-hero{height:auto}
  .product-hero img{object-fit:contain}
}
.product-gallery{display:flex; gap:10px; margin-top:10px; overflow:auto; padding:2px 2px 6px}
.product-thumb{
  width:74px;
  height:74px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  overflow:hidden;
  flex:0 0 auto;
  cursor:pointer;
}
.product-thumb img{width:100%; height:100%; object-fit:cover}
.product-thumb.active{border-color:rgba(45,212,191,.55); box-shadow:0 0 0 3px rgba(45,212,191,.12)}
.product-body{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:rgba(17,24,38,.62);
  padding:14px;
}
.product-title{font-weight:900; font-size:20px; margin-bottom:6px}
.product-price{font-weight:900; font-size:18px; color:rgba(232,238,247,.92)}
.product-desc{color:var(--muted); font-size:13px; margin-top:10px; white-space:pre-wrap}
.product-actions{display:flex; gap:10px; margin-top:14px}
@media (max-width:520px){
  .product-actions{flex-direction:column}
  .product-actions .btn{padding:10px 12px; font-size:14px}
}

.card{
  border:1px solid var(--border);
  background:rgba(17,24,38,.62);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.15);
}

.cart-list{display:flex; flex-direction:column; gap:10px; margin-top:12px}
.cart-item{
  display:grid;
  grid-template-columns:56px 1fr;
  gap:30px;
  padding:10px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
}
.cart-thumb{width:80px; height:80px; border-radius:14px; overflow:hidden; background:rgba(255,255,255,.04)}
.cart-thumb img{width:100%; height:100%; object-fit:cover}
.cart-name{font-weight:900; font-size:14px}
.cart-meta{color:var(--muted); font-size:12px; margin-top:3px}
.cart-controls{display:flex; align-items:center; gap:8px; margin-top:10px}
.qty{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:999px;
  padding:6px 8px;
}
.qty button{border:none; background:transparent; color:var(--text); cursor:pointer; font-weight:900; width:22px; height:22px; border-radius:999px}
.qty button:hover{background:rgba(255,255,255,.06)}
.qty span{min-width:20px; text-align:center; font-weight:900}

.cart-summary{margin-top:12px; border-top:1px solid rgba(255,255,255,.08); padding-top:12px}
.cart-total-row{display:flex; align-items:center; justify-content:space-between}
.actions-row{display:flex; gap:10px; margin-top:12px}
.actions-row .btn{flex:1}

.stepper{display:flex; gap:10px; align-items:center; justify-content:space-between; margin:10px 0 12px}
.step{display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; font-weight:800}
.step-dot{width:10px; height:10px; border-radius:999px; background:rgba(255,255,255,.14)}
.step.active{color:var(--text)}
.step.active .step-dot{background:var(--primary)}

.radio-group{display:flex; gap:12px; margin-top:8px}
.radio{display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid rgba(255,255,255,.1); border-radius:14px; background:rgba(255,255,255,.04); cursor:pointer}
.radio input{accent-color:var(--primary)}

.field{margin-top:10px}
.label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px; font-weight:800}

.payment-options{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.pay-item{padding:12px; border-radius:14px; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04); display:flex; gap:10px; align-items:center; cursor:pointer}
.pay-item input{accent-color:var(--primary)}

.pix-box{margin-top:12px; border:1px dashed rgba(255,255,255,.18); border-radius:var(--radius); padding:12px}
.pix-title{font-weight:900; margin-bottom:8px}
.pix-key-row{display:flex; gap:10px; align-items:center}
.pix-key{flex:1; padding:10px 12px; border:1px solid rgba(255,255,255,.1); border-radius:14px; background:rgba(255,255,255,.04); word-break:break-word}
.pix-qr{margin-top:12px; border-radius:14px; overflow:hidden; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04)}

.preview-title{font-weight:900; margin-bottom:8px}
.preview-box{
  margin:0;
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.1);
  border-radius:14px;
  padding:12px;
  color:rgba(232,238,247,.92);
  white-space:pre-wrap;
}

.tabs{display:flex; gap:8px; overflow:auto; padding:2px 0 10px}
.tab{flex:0 0 auto; padding:10px 12px; border-radius:999px; border:1px solid var(--border); background:rgba(17,24,38,.5); color:var(--text); cursor:pointer; font-weight:900}
.tab.active{border-color:rgba(45,212,191,.55); background:rgba(45,212,191,.14)}

.hint{margin-top:10px; color:var(--muted); font-size:12px}

.table{display:flex; flex-direction:column; gap:10px; margin-top:12px}
.trow{display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.04); border-radius:14px; padding:10px}
.trow-title{font-weight:900}
.trow-sub{color:var(--muted); font-size:12px; margin-top:2px}
.trow-actions{display:flex; gap:8px}

.modal{position:fixed; inset:0; background:rgba(0,0,0,.55); display:none; place-items:center; padding:16px; z-index:40}
.modal:not([hidden]){display:grid}
.modal[hidden]{display:none !important}
.modal-content{width:min(560px, 100%); max-height:calc(100vh - 48px); overflow:auto; -webkit-overflow-scrolling:touch; background:rgba(17,24,38,.96); border:1px solid rgba(255,255,255,.12); border-radius:18px; padding:14px; box-shadow:var(--shadow)}
.modal-header{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px}
.modal-title{font-weight:900}

.image-preview{margin-top:10px; border-radius:14px; overflow:hidden; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04)}
.image-preview img{width:100%; height:180px; object-fit:cover}

.checklist{display:flex; flex-direction:column; gap:10px; margin-top:8px}
.check{display:flex; gap:10px; align-items:center; padding:10px 12px; border-radius:14px; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04)}
.check input{accent-color:var(--primary)}

.stats{display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; margin-top:10px}
.stat{border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.04); border-radius:14px; padding:12px}
.stat-label{color:var(--muted); font-size:12px; font-weight:800}
.stat-value{font-size:22px; font-weight:1000; margin-top:6px}

@media (max-width:420px){
  .actions-row{flex-direction:column}
  .radio-group{flex-direction:column}
  .stats{grid-template-columns:1fr}
}
