@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Karla:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
  --terre:    #3b1a08;
  --rouille:  #b84a1a;
  --or:       #d4921e;
  --or-clair: #f0c060;
  --vert:     #1a4a1a;
  --vert-mid: #2d6a2d;
  --creme:    #fdf6ec;
  --sable:    #f5e8d0;
  --blanc:    #ffffff;
  --texte:    #1e0e04;
  --gris:     #6b5a50;

  --shadow-sm: 0 2px 8px rgba(59,26,8,.10);
  --shadow-md: 0 8px 30px rgba(59,26,8,.14);
  --shadow-lg: 0 20px 60px rgba(59,26,8,.18);

  --radius: 14px;
  --radius-sm: 8px;

  --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Karla', sans-serif;
  background: var(--creme);
  color: var(--texte);
  font-size: 16px;
  line-height: 1.6;
}

/* ── Typography ── */
h1,h2,h3,h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.2;
}

/* ── Layout ── */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Header ── */
header {
  background: var(--terre);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}

.brand { text-decoration: none; }
.brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--or-clair);
  letter-spacing: .5px;
}
.brand p {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 50px;
  transition: var(--transition);
  letter-spacing: .3px;
}
nav a:hover, nav a.active {
  background: rgba(255,255,255,.12);
  color: var(--or-clair);
}

/* Panier */
.cart-btn {
  background: var(--or);
  color: var(--terre) !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-btn:hover { background: var(--or-clair) !important; }
#cart-count {
  background: var(--terre);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* Hamburger mobile */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 5px;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--terre) 0%, var(--vert) 100%);
  color: white;
  padding: 90px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h2 {
  font-size: clamp(36px, 6vw, 64px);
  margin-bottom: 16px;
  position: relative;
}
.hero p {
  font-size: 18px;
  opacity: .8;
  position: relative;
  margin-bottom: 32px;
}
.hero-badge {
  display: inline-block;
  background: var(--or);
  color: var(--terre);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 20px;
  border-radius: 50px;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

/* ── Section ── */
.section { padding: 60px 0; }
.section-title {
  font-size: clamp(26px, 4vw, 38px);
  margin-bottom: 8px;
  color: var(--terre);
}
.section-sub {
  color: var(--gris);
  margin-bottom: 40px;
  font-size: 15px;
}

/* ── Cards produits ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}
.card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-badge {
  display: inline-block;
  background: var(--sable);
  color: var(--rouille);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 10px;
}
.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--terre);
}
.card p {
  color: var(--gris);
  font-size: 14px;
  flex: 1;
  margin-bottom: 16px;
}
.card-prix {
  font-size: 22px;
  font-weight: 700;
  color: var(--rouille);
  font-family: 'Playfair Display', serif;
  margin-bottom: 14px;
}
.card-prix span { font-size: 13px; color: var(--gris); font-family: 'Karla', sans-serif; font-weight: 400; }

/* ── Boutons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Karla', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: .3px;
}
.btn-primary {
  background: var(--rouille);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: #9c3d14; }
.btn-secondary {
  background: var(--sable);
  color: var(--terre);
}
.btn-secondary:hover { background: var(--or-clair); }
.btn-or {
  background: var(--or);
  color: var(--terre);
}
.btn-or:hover { background: var(--or-clair); }
.btn-vert {
  background: var(--vert);
  color: white;
}
.btn-vert:hover { background: var(--vert-mid); }

/* ── Formulaire ── */
.form-card {
  background: white;
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-md);
  max-width: 680px;
  margin: 0 auto;
}
.form-title {
  font-size: 28px;
  margin-bottom: 6px;
  color: var(--terre);
}
.form-sub {
  color: var(--gris);
  margin-bottom: 30px;
  font-size: 14px;
}

.form-row { display: grid; gap: 18px; margin-bottom: 18px; }
.form-row.two { grid-template-columns: 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
label {
  font-size: 13px;
  font-weight: 600;
  color: var(--terre);
  letter-spacing: .3px;
}
input, select, textarea {
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  padding: 12px 16px;
  border: 1.5px solid #e0d5c8;
  border-radius: var(--radius-sm);
  color: var(--texte);
  background: white;
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--or);
}
textarea { resize: vertical; min-height: 90px; }

/* ── Récapitulatif commande ── */
.recap-box {
  background: var(--sable);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.recap-box h4 { font-size: 15px; margin-bottom: 12px; color: var(--terre); }
.recap-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: 14px;
}
.recap-item:last-child { border-bottom: none; }
.recap-total {
  font-weight: 700;
  font-size: 16px;
  color: var(--rouille);
  padding-top: 12px;
  border-top: 2px solid var(--or);
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}

/* ── Notification toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--terre);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: .35s cubic-bezier(.4,0,.2,1);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid #4caf50; }
.toast.error   { border-left: 4px solid #f44336; }

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 20px;
  margin-bottom: 36px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--or);
}
.stat-card .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gris);
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--terre);
  font-weight: 700;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--gris);
  margin-top: 4px;
}

/* Tableau commandes */
.table-wrap {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-wrap h3 {
  padding: 20px 24px;
  border-bottom: 1px solid var(--sable);
  font-size: 18px;
  color: var(--terre);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: var(--sable);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gris);
  font-weight: 600;
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0e8dc;
  font-size: 14px;
  color: var(--texte);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdf9f4; }

.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}
.badge-nouveau  { background: #e3f2fd; color: #1565c0; }
.badge-confirmé { background: #e8f5e9; color: #2e7d32; }
.badge-livré    { background: #f3e5f5; color: #6a1b9a; }

/* ── Recettes ── */
.recette-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}
.recette-header {
  background: linear-gradient(135deg, var(--terre), var(--rouille));
  padding: 28px 32px;
  color: white;
}
.recette-header h2 { font-size: 26px; margin-bottom: 6px; }
.recette-header p  { opacity: .75; font-size: 14px; }
.recette-body { padding: 28px 32px; }
.recette-body h4 { font-size: 15px; color: var(--rouille); margin: 20px 0 10px; text-transform: uppercase; letter-spacing: 1px; }
.recette-body ul, .recette-body ol { padding-left: 20px; }
.recette-body li { margin-bottom: 8px; font-size: 15px; color: var(--gris); }

/* ── Auth overlay ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,14,4,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.auth-box {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-box h2 { font-size: 26px; margin-bottom: 6px; color: var(--terre); }
.auth-box p  { color: var(--gris); font-size: 14px; margin-bottom: 28px; }
.auth-error  { color: #c62828; font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ── Panier modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,14,4,.6);
  z-index: 500;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-close {
  background: var(--sable);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--terre);
}

/* ── Footer ── */
footer {
  background: var(--terre);
  color: rgba(255,255,255,.7);
  padding: 40px 0 24px;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 32px;
  margin-bottom: 28px;
}
footer h4 {
  font-family: 'Playfair Display', serif;
  color: var(--or-clair);
  font-size: 16px;
  margin-bottom: 12px;
}
footer p, footer a { font-size: 14px; color: rgba(255,255,255,.65); text-decoration: none; line-height: 2; }
footer a:hover { color: var(--or-clair); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.4);
}

/* ── Utilitaires ── */
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.text-center { text-align: center; }
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--gris);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--sable);
  border-top-color: var(--or);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .form-row.two { grid-template-columns: 1fr; }
  nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--terre); padding: 16px; gap: 4px; }
  nav.open { display: flex; }
  nav a { border-radius: var(--radius-sm); }
  .menu-toggle { display: block; }
  header { position: relative; }
  .header-inner { flex-wrap: wrap; }
  .recette-body, .recette-header { padding: 20px; }
  .form-card { padding: 24px; }
}

/* ── Admin dashboard ── */
.badge-status { display:inline-block;padding:3px 10px;border-radius:20px;font-size:12px;font-weight:700;text-transform:capitalize; }
.badge-nouveau   { background:#e3f2fd;color:#1565c0; }
.badge-confirmé  { background:#e8f5e9;color:#2e7d32; }
.badge-prep      { background:#fff8e1;color:#f57f17; }
.badge-expediee  { background:#e0f7fa;color:#006064; }
.badge-livré     { background:#ede7f6;color:#4527a0; }
.badge-annule    { background:#fce4ec;color:#c62828; }
