:root {
  --wave: #1DC8F2;
  --wave-dark: #0B9FC4;
  --text: #1a2230;
  --muted: #6b7686;
  --bg: #f5f8fa;
  --surface: #ffffff;
  --border: #e2e8ee;
  --radius: 12px;
  --success: #1a9e5c;
  --danger: #d6384a;
}

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

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

body {
  margin: 0;
  background: #f5f8fa;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-top: 20px; padding-bottom: 32px; }

a { color: var(--wave-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px; }
main.container { padding-top: 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.logo:hover { text-decoration: none; color: var(--wave-dark); }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--text); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--wave-dark); text-decoration: none; }
.badge {
  display: inline-block;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--wave);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--wave) 0%, var(--wave-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px 20px;
  margin-bottom: 24px;
  text-align: center;
}
.hero h1 { font-size: 1.8rem; margin-bottom: 8px; }
.hero p { margin: 0; opacity: 0.95; }

/* Grille produits */
.grid-produits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.carte-produit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.carte-produit:hover { box-shadow: 0 6px 18px rgba(20, 40, 60, .08); transform: translateY(-2px); }
.carte-produit img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.carte-produit .corps { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.carte-produit .nom { font-weight: 600; color: var(--text); }
.carte-produit .prix { font-weight: 700; font-size: 1.05rem; }
.carte-produit .btn { margin-top: auto; }

.placeholder-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #c9f1fb, #8adcf0 55%, #5fcbe8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 2rem;
}

/* Fiche produit */
.fiche-produit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.fiche-produit img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.fiche-produit .prix { font-size: 1.6rem; font-weight: 700; margin: 8px 0 16px; }
@media (min-width: 768px) {
  .fiche-produit { grid-template-columns: 1fr 1fr; padding: 24px; }
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; border-color: var(--wave-dark); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--wave); border-color: var(--wave); color: #fff; }
.btn-primary:hover { background: var(--wave-dark); border-color: var(--wave-dark); }
.btn-secondary { background: #eef3f6; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: #e2eaef; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b82a3b; border-color: #b82a3b; }
.btn-block { display: block; width: 100%; }

/* Formulaires */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=url], input[type=file], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--wave);
  box-shadow: 0 0 0 3px rgba(29, 200, 242, .25);
}
.field-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }

/* Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafcfd; }
.table tr:last-child td { border-bottom: 0; }

.qty-input { width: 72px !important; text-align: center; padding: 8px; }

/* Alertes */
.alert { padding: 12px 16px; border-radius: 10px; margin: 8px 0 16px; border: 1px solid transparent; }
.alert-success { background: #e6f7ee; border-color: #b6e6cb; color: #12683d; }
.alert-error { background: #fdecee; border-color: #f5bcc3; color: #9b2230; }
.flash-zone { padding-bottom: 0; }

/* Résumé panier */
.resume-panier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}
.resume-panier .ligne { display: flex; justify-content: space-between; padding: 6px 0; }
.resume-panier .total { font-size: 1.2rem; font-weight: 700; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.pagination a, .pagination span {
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.pagination .active, .pagination .current { background: var(--wave); border-color: var(--wave); color: #fff; }

/* Paiement */
.paiement-box {
  max-width: 440px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 6px 22px rgba(20, 40, 60, .06);
}
#qrcode {
  width: 260px;
  min-height: 260px;
  margin: 16px auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
#qrcode img, #qrcode canvas { max-width: 100%; height: auto; }
.montant { font-size: 2.2rem; font-weight: 700; margin: 8px 0; }
.statut-paiement { margin-top: 16px; font-weight: 600; padding: 10px 14px; border-radius: 10px; }
.statut-attente { background: #e8f9fe; color: var(--wave-dark); animation: pulse 1.6s ease-in-out infinite; }
.statut-ok { background: #e6f7ee; color: #12683d; }
.statut-erreur { background: #fdecee; color: #9b2230; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Badges de statut commande */
.badge-statut { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #eef3f6; color: var(--muted); }
.st-en_attente { background: #fff4d6; color: #8a6200; }
.st-payee { background: #e6f7ee; color: #12683d; }
.st-echouee { background: #fdecee; color: #9b2230; }
.st-expiree { background: #eceff2; color: #5b6572; }
.st-annulee { background: #f1e6f5; color: #6b2f7d; }
.st-livree { background: #e1effd; color: #1b5aa6; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.site-footer .footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.wave-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1DC8F2; margin-right: 6px; }

/* Utilitaires */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.muted { color: var(--muted); }

@media (max-width: 480px) {
  .nav { gap: 10px; }
  .hero h1 { font-size: 1.5rem; }
}
