/* ============================================
   BANTUGO — Styles principaux
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary:       #16A34A;
  --primary-dark:  #15803D;
  --primary-light: #F0FDF4;
  --secondary:     #0F172A;
  --bantu-orange:  #F97316;
  --success:       #22C55E;
  --danger:        #EF4444;
  --warning:       #F59E0B;
  --shadow:        0 2px 15px rgba(0,0,0,0.07);
  --shadow-hover:  0 8px 30px rgba(22,163,74,0.18);
  --radius:        16px;
  --radius-sm:     10px;
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: #F7F7F7;
  color: #1A1A2E;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F1F1F1; }
::-webkit-scrollbar-thumb { background: #CCC; border-radius: 3px; }

/* ── Buttons ── */
.btn-primary  { background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ── Inputs ── */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(22,163,74,0.15);
}
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ── Navbar ── */
.sana-nav {
  background: white;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}
.sana-nav .brand-logo { font-size: 1.3rem; font-weight: 800; color: var(--secondary); display:inline-flex; align-items:center; gap:6px; }
/* Logo speed lines */
.logo-lines { display:inline-flex; flex-direction:column; gap:3px; margin:0 6px; align-self:center; }
.logo-lines span { display:block; height:3px; background:#0F172A; border-radius:2px; }
.logo-lines span:nth-child(1) { width:14px; }
.logo-lines span:nth-child(2) { width:11px; }
.logo-lines span:nth-child(3) { width:8px;  }
.sana-nav .brand-logo span { color: var(--primary); }
.sana-nav .brand-logo .brand-truck { color: var(--primary); font-size: 1.1em; }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--primary); color: white;
  border-radius: 50%; width: 20px; height: 20px;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Hero ── */
.hero-section {
  background:
    linear-gradient(135deg, rgba(26,26,46,0.88) 0%, rgba(15,52,96,0.88) 100%),
    url('https://images.unsplash.com/photo-1476224203421-9ac39bcb3327?w=1200&h=500&fit=crop&q=80') center/cover no-repeat;
  color: white;
  padding: 52px 0 36px;
  position: relative; overflow: hidden;
}
.hero-section::after {
  content: '🛵';
  position: absolute; right: 4%; bottom: -30px;
  font-size: 200px; opacity: 0.12;
  pointer-events: none;
  overflow: hidden;
}
.search-bar {
  background: white;
  border-radius: 50px;
  padding: 6px 6px 6px 20px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  max-width: 560px;
}
.search-bar input {
  border: none; outline: none; flex: 1;
  font-size: 15px; background: transparent;
}
.search-bar .btn { border-radius: 50px; padding: 10px 24px; font-weight: 600; }

/* ── Category chips ── */
.categories-scroll {
  overflow-x: auto; scrollbar-width: none;
  display: flex; gap: 10px; padding: 4px 0;
}
.categories-scroll::-webkit-scrollbar { display: none; }
.chip {
  border-radius: 50px; padding: 8px 18px;
  border: 2px solid #E9ECEF; background: white;
  cursor: pointer; transition: all 0.2s;
  font-weight: 500; white-space: nowrap; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover, .chip.active {
  border-color: var(--primary);
  color: var(--primary); background: var(--primary-light);
}

/* ── Restaurant card ── */
.restaurant-card {
  background: white; border: none;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer; text-decoration: none; color: inherit;
  display: block;
}
.restaurant-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}
.restaurant-cover {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px; position: relative;
}
.restaurant-cover .closed-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 18px;
  border-radius: 0;
}

/* ── Menu item ── */
.menu-item {
  background: white; border-radius: var(--radius-sm);
  padding: 16px; display: flex;
  align-items: center; gap: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow); transition: box-shadow 0.2s;
}
.menu-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.menu-emoji { font-size: 52px; width: 70px; text-align: center; flex-shrink: 0; }

/* ── Quantity ── */
.qty-wrap { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--primary); background: transparent;
  color: var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all 0.15s; line-height: 1;
}
.qty-btn:hover { background: var(--primary); color: white; }
.qty-val { font-weight: 700; font-size: 16px; min-width: 20px; text-align: center; }

/* ── Cart float ── */
.cart-float {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%); z-index: 1040;
  background: var(--primary); color: white;
  padding: 14px 20px; border-radius: 50px;
  box-shadow: 0 8px 30px rgba(22,163,74,0.35);
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - 32px); max-width: 400px;
  justify-content: space-between;
  text-decoration: none; font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cart-float:hover { color: white; transform: translateX(-50%) scale(1.02); }

/* ── Sidebar (dashboards) ── */
.sidebar {
  width: 240px; min-height: 100vh;
  background: var(--secondary);
  position: fixed; left: 0; top: 0; z-index: 200;
  display: flex; flex-direction: column;
  transition: transform 0.3s;
}
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo { font-size: 1.3rem; font-weight: 800; color: white; }
.sidebar-brand .logo span { color: var(--primary); }
.sidebar .nav-link {
  color: rgba(255,255,255,0.65);
  padding: 11px 16px; border-radius: 10px;
  margin: 2px 10px; font-weight: 500; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.2s;
}
.sidebar .nav-link i { width: 18px; text-align: center; }
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: rgba(255,107,0,0.2);
  color: white;
}
.sidebar .nav-link.active { background: var(--primary); }
.sidebar-footer {
  margin-top: auto; padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.main-content {
  margin-left: 240px; padding: 28px;
  min-height: 100vh;
}

/* ── Stat cards ── */
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  border: none; height: 100%;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* ── Order card ── */
.order-card {
  background: white; border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: box-shadow 0.2s;
}
.order-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.order-card.status-pending   { border-left-color: #F59E0B; }
.order-card.status-preparing { border-left-color: #3B82F6; }
.order-card.status-ready     { border-left-color: var(--success); }
.order-card.status-delivering{ border-left-color: var(--primary); }

/* ── Tracking timeline ── */
.timeline { padding: 0; }
.t-step {
  display: flex; align-items: flex-start; gap: 14px;
  padding-bottom: 28px; position: relative;
}
.t-step::after {
  content: ''; position: absolute;
  left: 19px; top: 42px; bottom: 0; width: 2px;
  background: #E9ECEF;
}
.t-step.done::after  { background: var(--primary); }
.t-step:last-child::after { display: none; }
.t-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #E9ECEF; background: white;
  color: #ADB5BD; display: flex; align-items: center;
  justify-content: center; font-size: 16px; z-index: 1;
}
.t-step.done .t-icon    { background: var(--primary); border-color: var(--primary); color: white; }
.t-step.current .t-icon { border-color: var(--primary); color: var(--primary); animation: ring 1.5s infinite; }
@keyframes ring {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* ── Payment method ── */
.pay-method {
  border: 2px solid #E9ECEF; border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 14px;
}
.pay-method:hover, .pay-method.selected {
  border-color: var(--primary); background: var(--primary-light);
}

/* ── Badge subtle ── */
.badge-pending   { background: #FEF3C7; color: #92400E; }
.badge-preparing { background: #DBEAFE; color: #1E40AF; }
.badge-ready     { background: #D1FAE5; color: #065F46; }
.badge-delivering{ background: #EDE9FE; color: #5B21B6; }
.badge-delivered { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }

/* ── Avatar ── */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #FF9A3C);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 15px; flex-shrink: 0;
}

/* ── Toast ── */
.sana-toast {
  position: fixed; bottom: 80px; right: 20px; z-index: 9999;
  min-width: 260px; border-radius: 12px;
  padding: 14px 18px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Menu toggle switch ── */
.menu-toggle-item {
  background: white; border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow); margin-bottom: 10px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .hero-section { padding: 36px 0 28px; }
  .hero-section::after { font-size: 100px; right: 0; }
  .sana-nav .search-desktop { display: none; }

  /* Empêcher tout débordement horizontal */
  .container, .container-fluid { padding-left: 16px; padding-right: 16px; }
  .row { margin-left: 0; margin-right: 0; }
  .row > * { padding-left: 8px; padding-right: 8px; }

  /* Sections horizontales */
  .promos-scroll { padding-left: 0; padding-right: 0; }

  /* Annonces carousel */
  .ad-slide { padding: 16px 18px; height: auto; min-height: 130px; }
  .ad-slide .fw-bold.fs-4 { font-size: 1.1rem !important; }

  /* Chips */
  .categories-scroll { padding: 4px 0; }

  /* Toast */
  .sana-toast { left: 16px; right: 16px; min-width: 0; width: auto; }
}

/* ── Table ── */
.sana-table { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sana-table thead th { background: #F8F9FA; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: #6B7280; border: none; padding: 14px 16px; }
.sana-table tbody td { padding: 14px 16px; border-color: #F3F4F6; vertical-align: middle; }
.sana-table tbody tr:hover { background: #FAFAFA; }

/* ── Page header ── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }

/* ── Livreur card ── */
.delivery-card {
  background: white; border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: all 0.2s;
}
.delivery-card.active-delivery { border-color: var(--primary); background: var(--primary-light); }

/* ── Hamburger for mobile ── */
.sidebar-toggle {
  display: none; background: var(--secondary);
  border: none; color: white; padding: 8px 12px;
  border-radius: 8px; cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar-toggle { display: inline-flex; align-items: center; }
}
