/* Catalogo Revendedoras - 290 Digital */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --secondary: #8b5cf6;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ======= HEADER ======= */
.header { background: var(--primary); color: #fff; padding: 0 20px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.header-inner { max-width: 1100px; margin: 0 auto; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-logo { display: flex; align-items: center; gap: 10px; }
.header-logo img { height: 40px; width: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
.header-nome { font-size: 1.1rem; font-weight: 700; color: #fff; }
.header-subtitle { font-size: 0.7rem; opacity: 0.8; }
.header-cart { position: relative; background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; gap: 6px; transition: background .2s; }
.header-cart:hover { background: rgba(255,255,255,0.3); }
.cart-badge { position: absolute; top: -6px; right: -6px; background: #ef4444; color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ======= HOME (FORNECEDORES) ======= */
.hero { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; text-align: center; padding: 60px 20px 40px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { opacity: 0.9; font-size: 1rem; }
.info-bar { background: var(--card); border-bottom: 1px solid var(--border); padding: 10px 20px; font-size: 13px; color: var(--text-muted); display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.info-bar span { display: flex; align-items: center; gap: 4px; }
.fornecedor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; max-width: 1100px; margin: 32px auto; padding: 0 20px; }
.fornecedor-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: all .2s; border: 2px solid transparent; text-align: center; padding: 32px 20px; }
.fornecedor-card:hover { border-color: var(--primary); transform: translateY(-4px); }
.fornecedor-logo { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 16px; border-radius: 12px; }
.fornecedor-nome { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.fornecedor-btn { margin-top: 16px; background: var(--primary); color: #fff; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: background .2s; }
.fornecedor-btn:hover { background: var(--primary-hover); }

/* ======= CATALOGO ======= */
.cat-nav { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 64px; z-index: 90; overflow-x: auto; }
.cat-nav-inner { display: flex; gap: 4px; padding: 8px 20px; max-width: 1100px; margin: 0 auto; }
.cat-pill { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 6px 16px; border-radius: 20px; cursor: pointer; font-size: 0.85rem; white-space: nowrap; transition: all .15s; }
.cat-pill.active, .cat-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.busca-bar { max-width: 1100px; margin: 20px auto 0; padding: 0 20px; }
.busca-bar input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; font-size: 1rem; background: var(--card); outline: none; transition: border .15s; }
.busca-bar input:focus { border-color: var(--primary); }
.produto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; max-width: 1100px; margin: 20px auto 120px; padding: 0 20px; }
.produto-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: all .2s; }
.produto-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.produto-foto { width: 100%; height: 160px; object-fit: cover; background: #f1f5f9; }
.produto-foto-placeholder { width: 100%; height: 160px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.produto-info { padding: 12px; }
.produto-nome { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.produto-cat { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.produto-preco { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.produto-add { width: 100%; background: var(--primary); color: #fff; border: none; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: background .2s; }
.produto-add:hover { background: var(--primary-hover); }
.produto-qty { display: flex; align-items: center; gap: 6px; justify-content: center; }
.qty-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.qty-val { font-size: 1rem; font-weight: 700; min-width: 24px; text-align: center; }

/* ======= CARRINHO DRAWER ======= */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; display: none; }
.cart-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; background: var(--card); z-index: 201; box-shadow: -4px 0 24px rgba(0,0,0,0.15); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s; }
.cart-drawer.open { transform: translateX(0); }
.cart-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 { font-size: 1.1rem; font-weight: 700; }
.cart-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item-info { flex: 1; }
.cart-item-nome { font-size: 0.9rem; font-weight: 600; }
.cart-item-preco { font-size: 0.85rem; color: var(--text-muted); }
.cart-item-sub { font-size: 0.9rem; font-weight: 700; color: var(--primary); }
.cart-item-remove { background: none; border: none; cursor: pointer; color: #ef4444; font-size: 1.1rem; }
.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.cart-obs { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; resize: none; }
.cart-cliente { margin-bottom: 12px; }
.cart-cliente input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 0.9rem; }
.btn-wapp { width: 100%; background: #25D366; color: #fff; border: none; padding: 14px; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s; }
.btn-wapp:hover { background: #20bd5a; }
.cart-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.95rem; }

/* ======= ADMIN ======= */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--primary); color: #fff; padding: 0; position: fixed; top: 0; left: 0; bottom: 0; width: 220px; display: flex; flex-direction: column; }
.admin-brand { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.admin-brand h2 { font-size: 1rem; font-weight: 700; }
.admin-brand p { font-size: 0.7rem; opacity: 0.75; }
.admin-nav { padding: 12px 0; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: rgba(255,255,255,0.85); font-size: 0.9rem; transition: all .15s; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.15); color: #fff; }
.admin-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.15); }
.admin-footer button { width: 100%; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); border: none; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; }
.admin-main { margin-left: 220px; padding: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-title { font-size: 1.4rem; font-weight: 700; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card-val { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card-lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; padding: 10px 12px; background: #f8fafc; border-bottom: 2px solid var(--border); font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-recebido { background: #fef9c3; color: #854d0e; }
.badge-em_andamento { background: #dbeafe; color: #1e40af; }
.badge-entregue { background: #dcfce7; color: #166534; }
.badge-ativo { background: #dcfce7; color: #166534; }
.badge-inativo { background: #f1f5f9; color: #64748b; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; outline: none; background: var(--card); transition: border .15s; }
.form-control:focus { border-color: var(--primary); }
.btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; color: var(--text); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #ef4444; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #dcfce7; color: #166534; }
.btn-success:hover { background: #bbf7d0; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* Pedidos Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kanban-col { background: #f8fafc; border-radius: var(--radius); padding: 16px; }
.kanban-col-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.pedido-card { background: var(--card); border-radius: 10px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-left: 3px solid var(--primary); }
.pedido-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.pedido-num { font-size: 0.75rem; color: var(--text-muted); }
.pedido-total { font-weight: 700; color: var(--primary); }
.pedido-cliente { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.pedido-tel { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.pedido-itens { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.pedido-actions { display: flex; gap: 6px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.login-card { background: var(--card); border-radius: 16px; padding: 40px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h2 { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.login-logo p { font-size: 0.85rem; color: var(--text-muted); }
.login-btn { width: 100%; background: var(--primary); color: #fff; border: none; padding: 13px; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 8px; transition: background .2s; }
.login-btn:hover { background: var(--primary-hover); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card); border-radius: var(--radius); padding: 0; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; color: #fff; font-size: 0.9rem; font-weight: 500; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,0.2); animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-info { background: #6366f1; }

/* Promo Banner 290 Digital */
.promo-290 { background: linear-gradient(135deg,#1e293b,#334155); color: #fff; text-align: center; padding: 20px; margin-top: 40px; font-size: 0.85rem; }
.promo-290 a { color: #818cf8; font-weight: 600; }

@media (max-width: 768px) {
  .fornecedor-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .produto-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .cart-drawer { width: 100%; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .kanban { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
}
