/* ============================================
   MarketZone CI - Styles Globaux
   Design: Afro-moderne, chaud, mobile-first
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

:root {
  --orange:     #FF6B00;
  --orange-dk:  #E05A00;
  --orange-lt:  #FFF0E6;
  --green:      #00A86B;
  --green-lt:   #E6F7F1;
  --text:       #1A1A2E;
  --text-muted: #6B7280;
  --border:     #E5E7EB;
  --bg:         #F8F7F4;
  --white:      #FFFFFF;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --font-head:  'Syne', sans-serif;
  --font-body:  'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dk); }
img { max-width: 100%; height: auto; display: block; }

/* ---- NAVBAR ---- */
.navbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 20px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.navbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--orange); }
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-links a { color: var(--text); font-weight: 500; padding: 6px 12px; border-radius: var(--radius-sm); transition: background .2s, color .2s; }
.nav-links a:hover, .nav-links a.active { background: var(--orange-lt); color: var(--orange); }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: .9rem; font-weight: 600; border: none; cursor: pointer; transition: all .2s; text-decoration: none; }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dk); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,0,.35); }
.btn-secondary { background: var(--white); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }
.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #008c59; color: var(--white); }
.btn-danger { background: #EF4444; color: var(--white); }
.btn-danger:hover { background: #dc2626; color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-whatsapp { background: #25D366; color: var(--white); font-size: 1rem; padding: 12px 24px; border-radius: 50px; }
.btn-whatsapp:hover { background: #1ebe5d; color: var(--white); transform: scale(1.03); }

/* ---- CARDS ---- */
.card { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .25s, transform .25s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card-img { width: 100%; height: 200px; object-fit: cover; }

/* ---- PRODUCT CARD ---- */
.product-card { background: var(--white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: all .25s; cursor: pointer; position: relative; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.product-card .product-img { width: 100%; height: 200px; object-fit: cover; background: #f3f0eb; }
.product-card .product-img-placeholder { width: 100%; height: 200px; background: linear-gradient(135deg, #f3f0eb 0%, #ede9e0 100%); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.product-card .product-body { padding: 14px; }
.product-card .product-name { font-family: var(--font-head); font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.product-card .product-price { color: var(--orange); font-weight: 700; font-size: 1.05rem; }
.product-card .product-price-old { color: var(--text-muted); font-size: .85rem; text-decoration: line-through; margin-left: 6px; }
.product-card .badge-promo { position: absolute; top: 12px; left: 12px; background: #EF4444; color: white; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; }

/* ---- VENDOR CARD ---- */
.vendor-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: all .25s; position: relative; }
.vendor-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.vendor-card .vendor-banner { height: 100px; background: linear-gradient(135deg, var(--orange) 0%, #ff9a3c 100%); position: relative; }
.vendor-card .vendor-logo { width: 64px; height: 64px; border-radius: 50%; border: 3px solid white; object-fit: cover; position: absolute; bottom: -24px; left: 20px; background: white; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; overflow: hidden; }
.vendor-card .vendor-body { padding: 32px 20px 20px; }
.vendor-card .vendor-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.vendor-card .vendor-cat { font-size: .82rem; color: var(--text-muted); }
.vendor-card .badge-featured { position: absolute; top: 12px; right: 12px; background: linear-gradient(90deg, #FFD700, #FFA500); color: #7a4900; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.vendor-card .badge-top { display: inline-flex; align-items: center; gap: 4px; background: var(--orange-lt); color: var(--orange); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 6px; }

/* ---- GRID LAYOUTS ---- */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

/* ---- HERO ---- */
.hero { background: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%); color: white; padding: 80px 20px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FF6B00' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 16px; }
.hero h1 span { color: var(--orange); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.8); max-width: 600px; margin-bottom: 32px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 48px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--orange); }
.hero-stat .lbl { font-size: .85rem; color: rgba(255,255,255,.7); }

/* ---- SECTION ---- */
.section { padding: 60px 20px; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: 1.6rem; }
.section-head h2 span { color: var(--orange); }

/* ---- SEARCH BAR ---- */
.search-bar { background: white; border-radius: 50px; display: flex; border: 2px solid var(--border); overflow: hidden; max-width: 600px; margin: 0 auto 40px; box-shadow: var(--shadow-md); }
.search-bar input { flex: 1; padding: 14px 20px; border: none; outline: none; font-size: .95rem; font-family: var(--font-body); }
.search-bar button { padding: 12px 24px; background: var(--orange); color: white; border: none; cursor: pointer; font-weight: 700; font-size: .9rem; transition: background .2s; }
.search-bar button:hover { background: var(--orange-dk); }

/* ---- CATEGORIES BAR ---- */
.cats-bar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; margin-bottom: 32px; }
.cats-bar::-webkit-scrollbar { display: none; }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; background: white; border: 1.5px solid var(--border); border-radius: 50px; font-size: .85rem; font-weight: 500; white-space: nowrap; cursor: pointer; transition: all .2s; text-decoration: none; color: var(--text); }
.cat-pill:hover, .cat-pill.active { background: var(--orange); border-color: var(--orange); color: white; }

/* ---- CATEGORIES GRID ---- */
.cats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 12px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  min-width: 90px;
  min-height: 80px;
  flex: 0 0 auto;
}
.cat-card:hover { border-color: var(--orange); background: #FFF5EE; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,107,0,.15); color: var(--orange); }
.cat-card.active { background: var(--orange); border-color: var(--orange); color: white; box-shadow: 0 4px 16px rgba(255,107,0,.3); }
.cat-card-icon { font-size: 1.6rem; line-height: 1; }
.cat-card-name { font-size: .72rem; font-weight: 600; line-height: 1.3; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.form-control { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .95rem; font-family: var(--font-body); outline: none; transition: border-color .2s; background: white; }
.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,0,.1); }
.form-control.is-invalid { border-color: #EF4444; }
.form-text { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; display: flex; align-items: flex-start; gap: 8px; }
.alert-success { background: var(--green-lt); color: #065f46; border-left: 4px solid var(--green); }
.alert-error   { background: #FEF2F2; color: #991b1b; border-left: 4px solid #EF4444; }
.alert-warning { background: #FFFBEB; color: #92400e; border-left: 4px solid #F59E0B; }
.alert-info    { background: #EFF6FF; color: #1e40af; border-left: 4px solid #3B82F6; }

/* ---- BADGES ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-active   { background: var(--green-lt); color: var(--green); }
.badge-inactive { background: #F3F4F6; color: var(--text-muted); }
.badge-pending  { background: #FFFBEB; color: #92400e; }
.badge-expire   { background: #FEF2F2; color: #991b1b; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; background: white; }
thead th { padding: 12px 16px; text-align: left; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: #FAFAFA; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--orange-lt); }

/* ---- STATS CARDS ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: white; border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); }
.stat-card .stat-icon { font-size: 2rem; margin-bottom: 8px; }
.stat-card .stat-num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-card .stat-lbl { font-size: .82rem; color: var(--text-muted); margin-top: 4px; }
.stat-card.orange { border-top: 4px solid var(--orange); }
.stat-card.green  { border-top: 4px solid var(--green); }
.stat-card.blue   { border-top: 4px solid #3B82F6; }
.stat-card.purple { border-top: 4px solid #8B5CF6; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: white; color: var(--text); font-size: .88rem; font-weight: 600; text-decoration: none; transition: all .2s; }
.page-btn:hover, .page-btn.active { background: var(--orange); border-color: var(--orange); color: white; }

/* ---- SIDEBAR DASHBOARD ---- */
.dash-layout { display: flex; min-height: calc(100vh - 64px); }
.dash-sidebar { width: 240px; min-width: 240px; background: var(--text); padding: 24px 0; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.dash-sidebar .menu-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.4); padding: 16px 20px 6px; }
.dash-sidebar a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: rgba(255,255,255,.75); font-size: .92rem; font-weight: 500; transition: all .2s; text-decoration: none; }
.dash-sidebar a:hover, .dash-sidebar a.active { background: rgba(255,107,0,.15); color: white; border-left: 3px solid var(--orange); }
.dash-sidebar a span.icon { font-size: 1.1rem; width: 20px; text-align: center; }
.dash-content { flex: 1; padding: 32px; overflow: auto; }
.dash-header { margin-bottom: 28px; }
.dash-header h1 { font-size: 1.5rem; }
.dash-header p { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }

/* ---- FOOTER ---- */
.footer { background: var(--text); color: rgba(255,255,255,.7); padding: 48px 20px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer h4 { color: white; font-size: .95rem; margin-bottom: 14px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer ul li a { color: rgba(255,255,255,.65); font-size: .88rem; transition: color .2s; }
.footer ul li a:hover { color: var(--orange); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; font-size: .83rem; text-align: center; }

/* ---- MOBILE MENU ---- */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); max-width: 340px; margin: 0 auto 20px; }

/* ---- LOGIN PAGE ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1A1A2E 0%, #0F3460 100%); padding: 20px; }
.auth-card { background: white; border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.auth-card .auth-logo { text-align: center; margin-bottom: 28px; font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; }
.auth-card .auth-logo span { color: var(--orange); }
.auth-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-card p { color: var(--text-muted); font-size: .9rem; margin-bottom: 24px; }

/* ---- SUBSCRIPTION ALERT ---- */
.sub-alert { background: linear-gradient(90deg, #FFF0E6, #FFFBEB); border: 1.5px solid #FFD580; border-radius: var(--radius-md); padding: 16px 20px; display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: white; padding: 16px 20px; border-bottom: 1px solid var(--border); z-index: 99; box-shadow: var(--shadow-md); }
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; min-width: unset; height: auto; position: static; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; }
  .dash-sidebar a { padding: 8px 12px; font-size: .82rem; border-radius: var(--radius-sm); }
  .dash-sidebar .menu-label { display: none; }
  .dash-content { padding: 20px 16px; }
  .hero { padding: 48px 20px; }
  .section { padding: 40px 16px; }
  .grid-4, .grid-3 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product-card .product-img, .product-card .product-img-placeholder { height: 160px; }
  .hero-stats { gap: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 20px; }
  .cats-grid { gap: 8px; }
  .cat-card { padding: 12px 8px; min-width: 80px; min-height: 70px; }
  .cat-card-icon { font-size: 1.3rem; }
  .cat-card-name { font-size: .68rem; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn-lg { padding: 12px 20px; font-size: .9rem; }
  .cats-grid { gap: 6px; }
}

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }   .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.rounded { border-radius: var(--radius-md); }
.shadow { box-shadow: var(--shadow-md); }
.p-3 { padding: 24px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }