/* ============== THEME TOKENS (Kiwify vibe) ============== */
:root{
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface2: #F9FAFB;
  --text: #0B1220;
  --muted: #667085;
  --border: #EAECF0;

  --primary: #12B76A;       /* Kiwify vibe green */
  --primary-hover: #0E9F5B;
  --primary-soft: rgba(18,183,106,.12);

  --danger:#F04438;
  --warning:#F79009;

  --radius: 16px;
  --shadow: 0 18px 48px rgba(16,24,40,.08);
  --shadow-soft: 0 10px 30px rgba(16,24,40,.06);

  --container: 1120px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* DARK THEME */
html[data-theme="dark"]{
  --bg: #070A0F;
  --surface: #0B1220;
  --surface2: #0F172A;
  --text: #E6EAF2;
  --muted: #A5B0C2;
  --border: rgba(255,255,255,.08);

  --primary: #12B76A;
  --primary-hover: #0E9F5B;
  --primary-soft: rgba(18,183,106,.16);

  --shadow: 0 18px 48px rgba(0,0,0,.55);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px;
}

.hidden{display:none !important}

/* ============== TOPBAR ============== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
  letter-spacing: -.4px;
}
.brand-badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.nav{
  display:flex;
  align-items:center;
  gap: 10px;
}


/* ============== UI PRIMITIVES ============== */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.p{padding: 16px}
.p2{padding: 22px}
.mt{margin-top: 12px}
.mt2{margin-top: 18px}

.row{display:flex; gap: 10px}
.row.between{justify-content:space-between}
.row.center{align-items:center}
.wrap{flex-wrap:wrap}

.h1{font-size: 34px; line-height:1.08; margin:0}
.h2{font-size: 20px; margin:0}
.h3{font-size: 16px; margin:0}
.muted{color: var(--muted); font-size: 14px}

.grid{display:grid; gap: 12px}
.grid.two{grid-template-columns: 1fr 1fr}
.grid.three{grid-template-columns: repeat(3, 1fr)}
@media (max-width: 860px){

.grid.two{
grid-template-columns:1fr;
}

.grid.three{
grid-template-columns:1fr 1fr;
}

}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  cursor:pointer;
  transition: .15s ease;
  white-space:nowrap;
}
.btn:hover{transform: translateY(-1px)}
.btn:active{transform: translateY(0px)}
.btn-primary{
  background: var(--primary);
  border-color: transparent;
  color:#fff;
  box-shadow: 0 10px 26px rgba(18,183,106,.22);
}
.btn-primary:hover{background: var(--primary-hover)}
.btn-ghost{background: transparent}
.btn-ghost:hover{background: var(--surface2)}
.btn-danger{
  background: var(--danger);
  border-color: transparent;
  color:#fff;
}

.input, .select, .textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.textarea{min-height: 120px; resize: vertical}
.input:focus, .select:focus, .textarea:focus{
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.label{display:block; font-size: 13px; color: var(--muted); margin: 6px 0}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align:left;
  font-size: 14px;
}
.table th{color: var(--muted); font-weight: 800; background: var(--surface2)}
.table tr:hover td{background: color-mix(in srgb, var(--surface2) 65%, transparent)}

.chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.footer{padding: 26px 16px; color: var(--muted); font-size: 14px}

/* ============== AUTH (LOGIN) ============== */
.auth-wrap{
  min-height: calc(100vh - 60px);
  display:grid;
  place-items:center;
  padding: 20px 0;
}
.auth-card{
  width: 100%;
  max-width: 980px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  overflow:hidden;
}
@media (max-width: 900px){
  .auth-card{grid-template-columns: 1fr;}
}
.auth-left{
  padding: 28px;
  background: radial-gradient(1200px 380px at 20% 10%, rgba(18,183,106,.18), transparent 55%),
              radial-gradient(900px 360px at 90% 30%, rgba(18,183,106,.12), transparent 60%);
}
.auth-right{padding: 28px}
.auth-title{margin:0 0 8px; font-size: 28px; letter-spacing:-.5px}
.auth-sub{margin:0 0 16px; color: var(--muted)}
.stack{display:flex; flex-direction:column; gap: 10px}

/* ============== HOME HERO ============== */
.hero{
  padding: 22px 0 14px;
}
.hero-card{
  padding: 26px;
  background:
    radial-gradient(1100px 420px at 20% 0%, rgba(18,183,106,.18), transparent 58%),
    radial-gradient(900px 360px at 90% 30%, rgba(18,183,106,.10), transparent 60%),
    var(--surface);
}
.kpi{
  display:flex; gap: 10px; flex-wrap:wrap; margin-top: 14px;
}
.kpi .chip{font-weight:800}

/* Mobile topbar nav hidden -> use burger */
.burger{display:none}
@media (max-width: 860px){
  .nav{display:none}
  .burger{display:inline-flex}
}

/*icone tema claro/escuro */

.icon-btn{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
  padding:6px;
}
.icon-btn:hover{opacity:.7}

/* BANNER */
.store-banner img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

/* HEADER */
.store-header {
  padding: 20px 0;
}

.store-brand img {
  height: 60px;
  object-fit: contain;
}

.store-name {
  font-size: 26px;
  font-weight: 800;
}

/* CONTEÚDO */
.store-content {
  padding-top: 20px;
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .store-banner img {
    max-height: 150px;
  }

  .store-brand img {
    height: 45px;
  }

  .store-name {
    font-size: 20px;
  }
}

/* HEADER */
.store-topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-brand img {
  height: 50px;
  object-fit: contain;
}

.store-name {
  font-size: 22px;
  font-weight: 800;
}

/* BANNER */
.store-banner {
  width: 100%;
  overflow: hidden;
}

.store-banner img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* CONTEÚDO */
.store-content {
  padding-top: 30px;
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .store-banner img {
    height: 160px;
  }

  .store-brand img {
    height: 40px;
  }

  .store-name {
    font-size: 18px;
  }
}

/* ================================
   CATALOG GRID (MARKETPLACE STYLE)
================================ */

.catalog-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  gap:16px;
  margin-top:24px;
}

.product-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  transition:.15s ease;
  display:flex;
  flex-direction:column;
}

.product-card:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-soft);
}

.product-img{
  width:100%;
  aspect-ratio:1/1;
  background:var(--surface2);
  overflow:hidden;
}

.product-img img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.product-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.product-title{
  font-size:14px;
  font-weight:600;
  line-height:1.3;
  height:36px;
  overflow:hidden;
}

.price-old{
  font-size:12px;
  color:var(--muted);
  text-decoration:line-through;
}

.price-new{
  font-size:17px;
  font-weight:800;
  color:var(--primary);
}

.price-consult{
  font-size:15px;
  font-weight:700;
  color:var(--primary);
}

@media(max-width:768px){
  .catalog-grid{
    grid-template-columns:repeat(2,1fr);
    gap:12px;
  }
}

/* =========================
   PRODUCT PAGE RESPONSIVO
========================= */

.product-page{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:30px;
  margin-top:20px;
}

.product-gallery{
  width:100%;
}

.product-gallery .main-image{
  width:100%;
  aspect-ratio:1/1;
  background:var(--surface2);
  border-radius:12px;
  overflow:hidden;
}

.product-gallery .main-image img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* MINIATURAS */

.thumbs{
  display:flex;
  gap:8px;
  margin-top:10px;
  flex-wrap:wrap;
}

.thumbs img{
  width:60px;
  height:60px;
  object-fit:cover;
  border-radius:8px;
  cursor:pointer;
  border:2px solid transparent;
  transition:.15s;
}

.thumbs img:hover{
  border-color:var(--primary);
}

/* INFO PRODUTO */

.product-info h1{
  font-size:22px;
  margin-bottom:10px;
}

.product-info .price-new{
  font-size:24px;
}

.description{
  margin-top:15px;
  line-height:1.5;
  font-size:14px;
}

/* MOBILE */

@media (max-width:768px){

  .product-page{
    grid-template-columns:1fr;
    gap:20px;
  }

  .product-gallery .main-image{
    aspect-ratio:1/1;
  }

  .product-info h1{
    font-size:18px;
  }

  .product-info .price-new{
    font-size:20px;
  }

}

/* ================================
   CARRINHO
================================ */

@media(max-width:768px){
  .product-page{
    grid-template-columns:1fr;
  }
}

.toast{
  position:fixed;
  bottom:20px;
  right:20px;
  background:var(--primary);
  color:#fff;
  padding:12px 18px;
  border-radius:10px;
  box-shadow:var(--shadow);
}

.cart-drawer{
  position:fixed;
  inset:0;
  display:none;
  z-index:999;
}

.cart-drawer.open{
  display:block;
}

.cart-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.4);
}

.cart-panel{
  position:absolute;
  right:0;
  top:0;
  height:100%;
  width:380px;
  background:var(--surface);
  padding:20px;
  display:flex;
  flex-direction:column;
  box-shadow:-10px 0 30px rgba(0,0,0,.15);
  animation:slideIn .25s ease;
}

@keyframes slideIn{
  from{transform:translateX(100%)}
  to{transform:translateX(0)}
}

.cart-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.cart-items{
  flex:1;
  overflow:auto;
  margin:20px 0;
}

.cart-item{
  border-bottom:1px solid var(--border);
  padding:10px 0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cart-qty{
  display:flex;
  gap:6px;
}

.cart-qty button{
  border:1px solid var(--border);
  background:var(--surface2);
  border-radius:6px;
  width:28px;
  height:28px;
  cursor:pointer;
}

.full-btn{
  width:100%;
}

.cart-icon{
  background:none;
  border:none;
  cursor:pointer;
  font-size:18px;
}

.cart-icon span{
  background:var(--primary);
  color:#fff;
  padding:2px 6px;
  border-radius:50%;
  font-size:12px;
}

/* =========================
   BOTOES DO CARRINHO 
========================= */

.cart-item{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}

.cart-qty{
  display:flex;
  align-items:center;
  gap:6px;
}

.cart-qty button{
  width:30px;
  height:30px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--surface2);
  cursor:pointer;
  font-weight:700;
  font-size:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:.15s;
}

.cart-qty button:hover{
  background:var(--primary-soft);
  border-color:var(--primary);
}

.cart-qty span{
  min-width:20px;
  text-align:center;
  font-weight:700;
}

.cart-remove{
  color:var(--danger);
  cursor:pointer;
}

/* =========================
   PAINEL > PRODUTOS (ADMIN)
========================= */

.products-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-admin-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display:flex;
  flex-direction:column;
}

.product-admin-media{
  width:100%;
  height:160px;
  background: var(--surface2);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.product-admin-media img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.product-admin-noimg{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  font-size: 13px;
}

.product-admin-body{
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.product-admin-title{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.25;
  max-height: 36px;
  overflow:hidden;
}

.product-admin-meta{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  align-items:center;
  color: var(--muted);
  font-size: 12px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-weight: 800;
  font-size: 12px;
}

.badge-on{
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--primary-soft);
  color: var(--text);
}

.badge-off{
  opacity: .75;
}

.product-admin-price{
  font-weight: 900;
  color: var(--primary);
}

.product-admin-actions{
  display:flex;
  gap: 8px;
  flex-wrap:wrap;
  margin-top: 6px;
}

.product-admin-actions .btn{
  flex: 1;
  padding: 9px 10px;
  font-size: 12px;
}

@media (max-width:768px){

.products-grid{
  grid-template-columns: repeat(2,1fr);
}

.product-admin-media{
  height:130px;
}

}

/* =========================
   img produto no carrinho
========================= */

.cart-info{
display:flex;
flex-direction:column;
}

.cart-title{
font-size:14px;
font-weight:600;
}

.cart-variant{
font-size:12px;
color:var(--muted);
}

.cart-price{
font-weight:600;
}

/* ERROR PAGE */

.cart-product{
display:flex;
align-items:center;
gap:10px;
}

.cart-thumb{
width:44px;
height:44px;
object-fit:cover;
border-radius:8px;
flex-shrink:0;
}


/* SIDEBAR */

.sidebar-close {
  display: none;
}

/* mobile */

@media (max-width: 900px) {

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: .25s;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-close {
    display: block;
  }

}

/* GRID DOS CARDS */

.admin-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-bottom:20px;
}

/* CARD DE MÉTRICA */

.metric-card{

  padding:18px;
  border-radius:12px;

  background:var(--surface);
  color:var(--text);

  border:1px solid var(--border);

  box-shadow:var(--shadow-soft);

}
/* TÍTULO */

.metric-title{
  font-size:14px;
  color:var(--text-muted);
}

/* VALOR */

.metric-value{
  font-size:30px;
  font-weight:700;
  margin-top:6px;
}













