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

/* ======================================
   VIDELMA - Design System
   ====================================== */
:root {
  --green: #375920;
  --green-dark: #264015;
  --green-light: #4a7a2a;
  --green-bg: #f0f7ec;
  --orange: #c25200;
  --orange-dark: #9e4200;
  --orange-light: #e06010;
  --orange-bg: #fff3ec;
  --bg: #f9f7f4;
  --bg-white: #ffffff;
  --text: #1c1c1c;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e0d8;
  --border-light: #f0ede8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-head: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ======================================
   UTILITIES
   ====================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: var(--radius-sm); font-family: var(--font-head); font-size: 14px; font-weight: 600; border: 2px solid transparent; transition: var(--transition); white-space: nowrap; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-orange { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-orange:hover { background: var(--orange-dark); border-color: var(--orange-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover { background: #1ebe5d; border-color: #1ebe5d; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,211,102,.3); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-gray { background: #f3f4f6; color: var(--text-muted); }
.badge-pending { background: #fef9c3; color: #a16207; }
.badge-rejected { background: #fee2e2; color: #dc2626; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.form-control { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 15px; background: #fff; color: var(--text); transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(55,89,32,.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Cards */
.card { background: #fff; border-radius: var(--radius); border: 1.5px solid var(--border-light); box-shadow: var(--shadow-sm); overflow: hidden; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-body { padding: 20px; }

/* Alert */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }

/* Spinner */
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================
   NAVBAR
   ====================================== */
.navbar { background: var(--green); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 20px; max-width: 1200px; margin: 0 auto; }
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.navbar-logo { width: 36px; height: 36px; background: var(--orange); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 16px; letter-spacing: -.5px; }
.navbar-title { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #fff; }
.navbar-title span { color: var(--orange-light); }
.navbar-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: var(--radius-sm); transition: var(--transition); }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.navbar-actions { display: flex; align-items: center; gap: 10px; }
.navbar-user { color: rgba(255,255,255,.9); font-size: 14px; font-weight: 500; }
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 22px; padding: 6px; }

@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .hamburger { display: block; }
  .mobile-menu { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--green-dark); border-top: 1px solid rgba(255,255,255,.1); }
  .mobile-menu .nav-link { padding: 10px 14px; }
  .mobile-menu.hidden { display: none !important; }
}

/* ======================================
   HERO
   ====================================== */
.hero { background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, var(--green-light) 100%); padding: 72px 20px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; right: -10%; width: 600px; height: 600px; border-radius: 50%; background: rgba(255,255,255,.04); pointer-events: none; }
.hero::after { content: ''; position: absolute; bottom: -30%; left: -5%; width: 400px; height: 400px; border-radius: 50%; background: rgba(194,82,0,.12); pointer-events: none; }
.hero-content { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.9); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 100px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,.2); }
.hero h1 { font-family: var(--font-head); font-size: clamp(28px, 5vw, 48px); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 16px; }
.hero h1 em { color: var(--orange-light); font-style: normal; }
.hero p { color: rgba(255,255,255,.8); font-size: 17px; max-width: 520px; margin-bottom: 32px; }
.hero-search { display: flex; gap: 10px; max-width: 560px; background: #fff; border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow-lg); }
.hero-search input { flex: 1; border: none; outline: none; font-family: var(--font-body); font-size: 15px; padding: 8px 12px; color: var(--text); background: transparent; }
.hero-search button { background: var(--orange); color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px 20px; font-family: var(--font-head); font-weight: 600; font-size: 14px; transition: var(--transition); }
.hero-search button:hover { background: var(--orange-dark); }
.hero-stats { display: flex; gap: 32px; margin-top: 36px; }
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-family: var(--font-head); font-size: 24px; font-weight: 800; color: #fff; }
.hero-stat span { font-size: 13px; color: rgba(255,255,255,.7); }

/* ======================================
   CATEGORIES BAR
   ====================================== */
.categories-bar { background: #fff; border-bottom: 1.5px solid var(--border); padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.categories-bar::-webkit-scrollbar { display: none; }
.categories-inner { display: flex; gap: 0; max-width: 1200px; margin: 0 auto; }
.cat-btn { display: flex; align-items: center; gap: 8px; padding: 16px 18px; font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--text-muted); background: none; border: none; border-bottom: 3px solid transparent; white-space: nowrap; transition: var(--transition); }
.cat-btn:hover { color: var(--green); }
.cat-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.cat-btn .cat-icon { font-size: 18px; }

/* ======================================
   PRODUCTS GRID
   ====================================== */
.section { padding: 40px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

.product-card { background: #fff; border-radius: var(--radius); border: 1.5px solid var(--border-light); overflow: hidden; transition: var(--transition); cursor: pointer; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--border); }
.product-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--border-light); }
.product-img-placeholder { width: 100%; aspect-ratio: 4/3; background: linear-gradient(135deg, var(--green-bg), #fff); display: flex; align-items: center; justify-content: center; font-size: 48px; }
.product-info { padding: 14px; }
.product-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 5px; }
.product-title { font-family: var(--font-head); font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--orange); }
.product-price .negotiable { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.product-location { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.product-condition { font-size: 11px; padding: 2px 8px; border-radius: 100px; background: var(--green-bg); color: var(--green); font-weight: 600; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.page-btn { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: #fff; font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.page-btn:hover, .page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Empty state */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); }

/* ======================================
   PRODUCT DETAIL
   ====================================== */
.product-detail { padding: 32px 0 60px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 400px; gap: 40px; }
@media (max-width: 900px) { .product-detail-grid { grid-template-columns: 1fr; } }

.gallery { border-radius: var(--radius); overflow: hidden; }
.gallery-main { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--border-light); border-radius: var(--radius); }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; border: 2.5px solid transparent; transition: var(--transition); opacity: .7; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--green); opacity: 1; }

.product-sidebar { }
.product-sidebar .product-title-big { font-family: var(--font-head); font-size: 24px; font-weight: 700; line-height: 1.3; margin-bottom: 14px; }
.product-sidebar .price-big { font-family: var(--font-head); font-size: 30px; font-weight: 800; color: var(--orange); margin-bottom: 20px; }
.info-list { list-style: none; margin: 20px 0; border-top: 1px solid var(--border-light); }
.info-list li { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.info-list li span:first-child { color: var(--text-muted); }
.info-list li span:last-child { font-weight: 600; }
.vendor-card { background: var(--bg); border-radius: var(--radius); padding: 16px; margin-top: 20px; border: 1.5px solid var(--border); }
.vendor-card h4 { font-family: var(--font-head); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.vendor-card p { font-size: 13px; color: var(--text-muted); }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb span { color: var(--text-light); }

/* ======================================
   AUTH PAGE
   ====================================== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%); }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-icon { width: 56px; height: 56px; background: var(--green); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; font-size: 24px; color: #fff; margin: 0 auto 12px; }
.auth-logo h1 { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.auth-logo h1 span { color: var(--orange); }
.auth-logo p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-tabs { display: flex; gap: 0; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 28px; }
.auth-tab { flex: 1; padding: 9px; text-align: center; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-muted); background: none; border: none; transition: var(--transition); }
.auth-tab.active { background: #fff; color: var(--green); box-shadow: var(--shadow-sm); }

/* ======================================
   DASHBOARD VENDEUR
   ====================================== */
.dashboard-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
@media (max-width: 900px) { .dashboard-layout { grid-template-columns: 1fr; } }
.sidebar { background: #fff; border-right: 1.5px solid var(--border); padding: 24px 0; }
.sidebar-section { padding: 8px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-light); margin: 16px 0 6px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 20px; font-size: 14px; font-weight: 500; color: var(--text-muted); transition: var(--transition); border-left: 3px solid transparent; margin: 2px 0; }
.sidebar-link:hover { color: var(--text); background: var(--bg); }
.sidebar-link.active { color: var(--green); background: var(--green-bg); border-left-color: var(--green); font-weight: 600; }
.sidebar-link .icon { font-size: 18px; }
.dashboard-content { padding: 32px; overflow: auto; }
@media (max-width: 900px) { .sidebar { display: none; } .dashboard-content { padding: 20px; } }

.dashboard-header { margin-bottom: 28px; }
.dashboard-header h2 { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.dashboard-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; border: 1.5px solid var(--border-light); }
.stat-card .stat-val { font-family: var(--font-head); font-size: 28px; font-weight: 800; color: var(--green); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.table-wrap { background: #fff; border-radius: var(--radius); border: 1.5px solid var(--border-light); overflow: hidden; }
.table-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-header h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); background: var(--bg); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }
.product-thumb-sm { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); background: var(--border-light); }

/* Image upload */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; cursor: pointer; transition: var(--transition); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--green); background: var(--green-bg); }
.upload-zone .upload-icon { font-size: 36px; margin-bottom: 12px; }
.upload-zone p { font-size: 14px; color: var(--text-muted); }
.upload-zone small { font-size: 12px; color: var(--text-light); }
.image-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.img-preview { position: relative; width: 90px; height: 90px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.img-preview .remove-img { position: absolute; top: -6px; right: -6px; background: #ef4444; color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; line-height: 22px; text-align: center; cursor: pointer; }

/* ======================================
   FOOTER
   ====================================== */
.footer { background: var(--green-dark); color: rgba(255,255,255,.7); padding: 48px 20px 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto 40px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand .logo-box { width: 38px; height: 38px; background: var(--orange); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800; color: #fff; }
.footer-brand h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: #fff; }
.footer-brand p { font-size: 14px; line-height: 1.7; }
.footer-col h4 { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 14px; color: rgba(255,255,255,.65); transition: var(--transition); }
.footer-col ul li a:hover { color: var(--orange-light); }
.footer-bottom { max-width: 1200px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.footer-bottom a { color: var(--orange-light); }
.whatsapp-float { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(37,211,102,.4); z-index: 99; transition: var(--transition); }
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 28px; height: 28px; fill: #fff; }

/* ======================================
   LOADING OVERLAY
   ====================================== */
.page-loader { position: fixed; inset: 0; background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center; z-index: 999; }
.page-loader .loader-inner { text-align: center; }
.loader-ring { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
.loader-text { font-size: 14px; color: var(--text-muted); font-family: var(--font-head); font-weight: 600; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius-lg); padding: 32px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; padding: 4px; }

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-width: 640px) {
  .hero { padding: 48px 20px; }
  .hero-stats { gap: 20px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .product-detail-grid { grid-template-columns: 1fr; }
  .section { padding: 28px 0; }
}
