/* DukaLangu — Mobile-first styles for low-bandwidth East African market */

:root {
  --green: #0a8754;
  --green-light: #e8f5ee;
  --green-dark: #065c3a;
  --gold: #d4920b;
  --gold-light: #fef8e8;
  --coral: #d85a30;
  --bg: #fafaf7;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-sec: #5a5a56;
  --text-hint: #8a8a84;
  --border: #e5e5df;
  --border-light: #f0f0ea;
  --shadow: rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.container-wide {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ─── Typography ─── */
h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin-bottom: 0.5rem; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navigation ─── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-sec);
  font-weight: 500;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--green);
  color: white;
}
.btn-primary:hover { background: var(--green-dark); text-decoration: none; }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-sec); text-decoration: none; }

.btn-gold {
  background: var(--gold);
  color: white;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius);
  width: 100%;
}
.btn-whatsapp:hover { background: #1da851; text-decoration: none; }

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Cards ─── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-body {
  padding: 16px;
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235a5a56' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Shop Page ─── */
.shop-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}

.shop-profile {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.shop-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  overflow: hidden;
}

.shop-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-info {
  flex: 1;
  min-width: 0;
}

.shop-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.shop-location {
  font-size: 0.875rem;
  color: var(--text-sec);
  margin-bottom: 4px;
}

.shop-stats {
  display: flex;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-hint);
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ─── Product Grid ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 0;
}

@media (min-width: 480px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.product-card:active {
  box-shadow: 0 2px 8px var(--shadow);
}

.product-image {
  aspect-ratio: 1;
  background: var(--border-light);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-hint);
  font-size: 2rem;
}

.product-info {
  padding: 10px 12px;
}

.product-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--green);
  margin-top: 2px;
}

.product-price-text {
  font-size: 0.75rem;
  color: var(--text-hint);
}

/* ─── Share Bar ─── */
.share-bar {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-url {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--green-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Dashboard ─── */
.dash-header {
  padding: 24px 0 16px;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-hint);
  margin-top: 2px;
}

.product-list-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  align-items: center;
}

.product-list-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-light);
}

.product-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-list-info {
  flex: 1;
  min-width: 0;
}

.product-list-actions {
  display: flex;
  gap: 6px;
}

/* ─── Request Board ─── */
.request-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.request-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.request-meta {
  font-size: 0.8125rem;
  color: var(--text-hint);
}

.request-budget {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
}

/* ─── Landing Page ─── */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-sec);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.features {
  display: grid;
  gap: 16px;
  padding: 24px 0;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.feature p {
  font-size: 0.875rem;
  color: var(--text-sec);
  margin: 0;
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Image Upload ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.upload-zone:hover {
  border-color: var(--green);
}

.upload-zone.has-image {
  padding: 0;
  border-style: solid;
}

.upload-zone img {
  width: 100%;
  border-radius: var(--radius);
}

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease-out;
  max-width: 320px;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--coral); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Loading ─── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-hint);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ─── Utilities ─── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sec { color: var(--text-sec); }
.text-hint { color: var(--text-hint); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ─── Responsive ─── */
@media (min-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .container { padding: 0 24px; }
  .product-grid { gap: 16px; }
}
