/* ═══════════════════════════════════════════════════════════
   AfriMarket — UI Components
   ═══════════════════════════════════════════════════════════ */

/* ── BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; transition: var(--transition);
  white-space: nowrap; cursor: pointer;
}
.btn-primary   { background: var(--green);   color: #fff; }
.btn-secondary { background: var(--white);   color: var(--dark); border: 1.5px solid var(--border); }
.btn-gold      { background: var(--gold);    color: #fff; }
.btn-danger    { background: var(--red);     color: #fff; }
.btn-ghost     { background: transparent;   color: var(--green); }
.btn-dark      { background: var(--dark);   color: #fff; }

.btn-primary:hover   { background: var(--dark2); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(27,107,58,0.3); }
.btn-secondary:hover { background: var(--light); border-color: var(--green); }
.btn-gold:hover      { background: #b8860b; }
.btn-ghost:hover     { background: var(--green-pale); border-radius: var(--radius-sm); }
.btn-danger:hover    { background: #a93226; }

.btn-sm   { padding: 7px 14px; font-size: 13px; }
.btn-lg   { padding: 14px 32px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; }

/* ── BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500; letter-spacing: 0.3px;
}
.badge-green  { background: var(--green-pale); color: var(--green); }
.badge-gold   { background: var(--gold-pale);  color: #7A5C00; }
.badge-red    { background: var(--red-pale);   color: var(--red); }
.badge-dark   { background: var(--dark);       color: #fff; }
.badge-blue   { background: #EBF5FF;           color: #1A56A7; }

/* ── STATUS PILLS */
.status-pill { padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 500; }
.status-pending   { background: var(--gold-pale);  color: #6B5000; }
.status-shipped   { background: #E8F0FE;            color: #1A56A7; }
.status-delivered { background: var(--green-pale); color: var(--green); }
.status-cancelled { background: var(--red-pale);   color: var(--red); }
.status-processing{ background: #F3E8FF;           color: #6B21A8; }

/* ── FORM ELEMENTS */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--mid); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body); color: var(--dark);
  background: var(--white); transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(27,107,58,0.1); }
.form-input::placeholder { color: var(--muted); }
.form-input:disabled { background: var(--light); cursor: not-allowed; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }
.form-hint  { font-size: 12px; color: var(--muted); margin-top: 4px; }

.form-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.form-divider span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── STARS */
.stars { display: flex; align-items: center; gap: 2px; }
.star  { color: var(--gold); font-size: 13px; }
.star-empty { color: #DDD; font-size: 13px; }

/* ── SECTION HEADER */
.section-header { margin-bottom: 28px; }
.section-title { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.section-sub   { color: var(--muted); font-size: 15px; }

/* ── MODALS */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,30,20,0.6); z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-xl);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  padding: 22px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; background: var(--light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; color: var(--muted); transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--dark); }
.modal-body   { padding: 22px 24px; }
.modal-footer { padding: 0 24px 22px; }

/* ── TABS */
.tab-switch { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 13px 20px; font-size: 14px; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: var(--transition); background: none;
}
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── TOAST */
.toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--dark); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; z-index: var(--z-toast);
  opacity: 0; transition: var(--transition-slow);
  white-space: nowrap; pointer-events: none;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── CART SIDEBAR */
.cart-overlay { position: fixed; inset: 0; z-index: var(--z-overlay); display: none; }
.cart-overlay.active { display: block; }
.cart-backdrop { position: absolute; inset: 0; background: rgba(15,30,20,0.5); }
.cart-sidebar {
  position: absolute; right: 0; top: 0; bottom: 0; width: 400px;
  background: var(--white); box-shadow: -8px 0 40px rgba(15,30,20,0.15);
  display: flex; flex-direction: column; animation: slideIn 0.25s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: none; }
}

/* ── TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 11px; color: var(--muted); font-weight: 500;
  text-align: left; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--light);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td { font-size: 13px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--dark); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--light); }

/* ── WHATSAPP FLOAT */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--z-overlay);
  background: #25D366; color: #fff;
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  cursor: pointer; transition: transform 0.2s; text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* ── PAGINATION */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); cursor: pointer;
  border: 1px solid var(--border); background: var(--white);
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ── SKELETON LOADER */
.skeleton {
  background: linear-gradient(90deg, var(--light) 0%, var(--border) 50%, var(--light) 100%);
  background-size: 200% 100%;
  animation: skeletonMove 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonMove {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── EMPTY STATE */
.empty-state {
  text-align: center; padding: 64px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 8px; }
.empty-state h3 { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.empty-state p  { font-size: 14px; color: var(--muted); max-width: 320px; }
