:root{
  --bg: #0b1220;
  --surface: #111827;
  --surface2: #0f172a;
  --border: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --primary: #22c55e;
  --danger: #ef4444;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius: 18px;
  --radius2: 14px;
  --container: 1120px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, rgba(34,197,94,.12), transparent 60%),
              radial-gradient(900px 600px at 90% 0%, rgba(59,130,246,.10), transparent 55%),
              var(--bg);
}
a{color:inherit;text-decoration:none}
button{font:inherit}

.container{max-width:var(--container);margin:0 auto;padding:0 16px}
.topbar{
  position:sticky;top:0;z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.72);
  border-bottom:1px solid var(--border);
}
.topbar-inner{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 0}
.brand{display:flex;align-items:center;gap:10px}
.brand-badge{
  width:36px;height:36px;border-radius:12px;
  background: linear-gradient(135deg, rgba(34,197,94,.35), rgba(34,197,94,.08));
  border:1px solid var(--border);
  display:grid;place-items:center;font-weight:800;
}
.brand h1{font-size:clamp(16px, 2.2vw, 20px);margin:0;letter-spacing:.2px}
.brand small{display:block;color:var(--muted);font-size:12px;margin-top:2px}

.search{
  display:flex;align-items:center;gap:10px;flex:1;max-width:560px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  padding:10px 12px;border-radius:999px;
}
.search input{
  flex:1;border:0;outline:0;background:transparent;color:var(--text);
}
.pill{
  padding:8px 12px;border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size:12px;
}
.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 12px;
  padding:10px 12px;
  cursor:pointer;
}
.btn.primary{background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.35)}
.btn.danger{background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.35)}
.btn:active{transform: translateY(1px)}

.hero{padding:18px 0 10px}
.hero-card{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.hero-top{
  padding:18px 16px;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between
}
.hero-top .meta{color:var(--muted);font-size:13px}
.chips{display:flex;gap:8px;overflow:auto;padding:10px 12px 12px}
.chip{
  white-space:nowrap;
  padding:10px 12px;border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
}
.chip[aria-current="true"]{border-color: rgba(34,197,94,.65); background: rgba(34,197,94,.14)}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  padding: 16px 0 96px;
}
.card{
  grid-column: span 12;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius2);
  overflow:hidden;
  display:flex;
  min-height: 112px;
}
@media (min-width: 640px){ .card{grid-column: span 6} }
@media (min-width: 980px){ .card{grid-column: span 4} }

.card img{width:120px;object-fit:cover;background:#0b1220}
.card-body{padding:12px;display:flex;flex-direction:column;gap:8px;flex:1}
.card-title{font-weight:800;line-height:1.2}
.card-desc{color:var(--muted);font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto}
.price{font-weight:900}
.price small{color:var(--muted);font-weight:700;margin-left:6px;text-decoration:line-through}

.bottomnav{
  position:fixed;left:0;right:0;bottom:0;z-index:60;
  background: rgba(11,18,32,.84);
  border-top:1px solid var(--border);
  backdrop-filter: blur(12px);
}
.bottomnav-inner{
  max-width:var(--container);margin:0 auto;padding:10px 16px calc(10px + env(safe-area-inset-bottom));
  display:flex;justify-content:space-between;gap:8px;
}
.navitem{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;
  color: var(--muted);font-size:11px;min-height:48px;padding:8px 10px;border-radius:14px;justify-content:center;
}
.navitem[aria-current="true"]{color:var(--text);background: rgba(255,255,255,.04);border:1px solid var(--border)}
.badge{
  display:inline-grid;place-items:center;
  min-width:18px;height:18px;padding:0 6px;border-radius:999px;
  background: rgba(34,197,94,.18);
  border:1px solid rgba(34,197,94,.35);
  color: var(--text);
  font-size:11px;font-weight:800;
}

.modal{
  position:fixed;inset:0;display:none;place-items:center;z-index:80;
  background: rgba(0,0,0,.55);
  padding:16px;
}
.modal[open]{display:grid}
.modal-card{
  width:min(720px, 100%);
  max-height:min(88vh, 900px);
  overflow:auto;
  border:1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 14px;border-bottom:1px solid var(--border)}
.modal-head h2{margin:0;font-size:16px}
.modal-body{padding:14px}
.field{display:flex;flex-direction:column;gap:6px;margin:12px 0}
.field label{font-size:12px;color:var(--muted)}
.input, select, textarea{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
  outline: none;
}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row > *{flex:1}
.hint{font-size:12px;color:var(--muted)}
.toast{
  position:fixed;left:50%;bottom:90px;transform:translateX(-50%);
  background: rgba(17,24,39,.94);
  border:1px solid var(--border);
  padding:10px 12px;border-radius:999px;
  color:var(--text);display:none;z-index:100;
}
.toast[show]{display:block}

/* --- Admin: Editor avançado de produto --- */
.editor-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 980px){
  .editor-grid{ grid-template-columns: 1.6fr .9fr; align-items:start; }
  .editor-grid aside{ position: sticky; top: 92px; }
}

.side-card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius2);
  padding: 12px;
}

.tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top: 12px;
}
.tab{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  cursor:pointer;
}
.tab.is-active,
.tab[aria-selected="true"]{
  border-color: rgba(34,197,94,.65);
  background: rgba(34,197,94,.14);
}
.tabpane{ margin-top: 12px; }

.switch{
  position: relative;
  display:inline-block;
  width: 46px;
  height: 28px;
}
.switch input{ opacity:0; width:0; height:0; }
.switch .slider{
  position:absolute; inset:0;
  cursor:pointer;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  transition: .18s ease;
}
.switch .slider:before{
  content:"";
  position:absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 16px rgba(0,0,0,.25);
  transition: .18s ease;
}
.switch input:checked + .slider{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.45);
}
.switch input:checked + .slider:before{ transform: translateX(18px); }

.dropzone{
  margin-top: 10px;
  border:1px dashed rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.02);
}
.dropzone.is-drag{ border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.08); }
.dropzone img{
  width:100%;
  height: 190px;
  object-fit: cover;
  border-radius: 14px;
  border:1px solid var(--border);
  background:#0b1220;
}
.dropzone .dz-actions{ margin-top: 10px; }

.mini-table{
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
}
.mini-head{
  display:grid;
  grid-template-columns: 1.2fr .8fr .7fr .6fr;
  gap:10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border-bottom:1px solid var(--border);
  font-size:12px;
  color: var(--muted);
}
.mini-body{ display:flex; flex-direction:column; }
.mini-row{
  display:grid;
  grid-template-columns: 1.2fr .8fr .7fr .6fr;
  gap:10px;
  padding: 10px 12px;
  border-top:1px solid var(--border);
}
.mini-row:first-child{ border-top:0; }

.groups-wrap{ display:grid; gap:10px; }
.group-card{
  border:1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  overflow:hidden;
}
.group-card > summary{
  list-style:none;
  cursor:pointer;
  padding: 12px;
}
.group-card > summary::-webkit-details-marker{ display:none; }
.group-sum{ display:flex; gap:10px; justify-content:space-between; align-items:center; }
.group-actions{ display:flex; gap:8px; align-items:center; }
.group-body{ padding: 0 12px 12px; }
