/* ==========================================================================
   FRESH DISTRI — Charte "Épuré Magazine"
   Variables centralisées : modifier ici suffit à rethémer tout le site.
   ========================================================================== */

:root {
  /* --- Couleurs --- */
  --color-bg:           #FBFAF6;   /* fond principal, crème très clair */
  --color-bg-alt:       #F3F0E8;   /* sections alternées */
  --color-surface:      #FFFFFF;   /* cartes, header */
  --color-text:         #1B221C;   /* texte principal, presque noir-vert */
  --color-text-soft:    #5C6760;   /* texte secondaire, gris chaud */
  --color-border:       #E7E2D5;   /* séparateurs discrets */

  --color-accent:       #1B6B2F;   /* vert FRESH DISTRI — accent principal */
  --color-accent-dark:  #134F22;   /* vert foncé (hover, texte sur clair) */
  --color-accent-soft:  #E9F1EA;   /* vert très clair (fonds badges) */

  --color-secondary:    #CC1414;   /* rouge — promotions / accents ponctuels uniquement */
  --color-secondary-soft:#FBE9E9;

  --color-overlay-dark: rgba(10, 14, 11, .55); /* voile sur photos pour lisibilité texte */

  /* --- Typographies --- */
  --font-titres: 'Fraunces', Georgia, serif;          /* serif élégant : titres, logo */
  --font-texte:  'Work Sans', -apple-system, 'Segoe UI', Roboto, sans-serif; /* sans-serif lisible : corps */

  /* --- Espacements (échelle 4px) --- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* --- Rayons & ombres --- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 18px rgba(20, 25, 20, .07);
  --shadow-elevated: 0 12px 36px rgba(20, 25, 20, .14);

  /* --- Cibles tactiles (mobile-first, non négociable) --- */
  --tap-min: 44px;
}

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

body {
  font-family: var(--font-texte);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .titre {
  font-family: var(--font-titres);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap-min);
  padding: 0 var(--sp-5);
  border-radius: var(--radius-pill);
  font-family: var(--font-texte);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); }

.btn-outline { background: transparent; color: var(--color-accent); border: 1.5px solid var(--color-accent); }

.btn-secondary { background: var(--color-secondary); color: #fff; }

/* --- Cartes --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

/* --- Badge prix verrouillé --- */
.badge-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  border: 1px solid #cfe3d3;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

/* --- Conteneur --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--sp-6); }
}

/* ==========================================================================
   COMPOSANTS DU SITE (Étape 3)
   ========================================================================== */

body { padding-bottom: 0; }

/* --- Header --- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-family: var(--font-titres); font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.logo b { color: var(--color-accent); }
.logo a { display: flex; align-items: center; gap: 10px; }
.burger-btn { width: var(--tap-min); height: var(--tap-min); display: flex; align-items: center; justify-content: center;
  font-size: 20px; border: none; background: none; cursor: pointer; }
.desktop-nav { display: none; gap: var(--sp-5); font-size: 13px; font-weight: 600; color: var(--color-text-soft); }
.desktop-nav a:hover { color: var(--color-accent); }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn {
  width: var(--tap-min); height: var(--tap-min); display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 18px; border: none; background: none; cursor: pointer; position: relative;
}
.cart-count {
  position: absolute; top: 2px; right: 2px; background: var(--color-accent); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.btn-pro-desktop { display: none; }

/* Menu mobile (burger) */
.mobile-nav {
  position: fixed; inset: 0; background: rgba(10,14,11,.5); z-index: 60; display: none;
}
.mobile-nav.open { display: block; }
.mobile-nav-panel {
  background: var(--color-surface); width: 82%; max-width: 320px; height: 100%;
  padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2);
}
.mobile-nav-panel a, .mobile-nav-panel button {
  display: block; text-align: left; padding: var(--sp-3) 0; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid var(--color-border); background: none; border-left: none; border-right: none; border-top: none;
  min-height: var(--tap-min); cursor: pointer;
}

/* --- Hero --- */
.hero {
  position: relative; min-height: 420px; display: flex; align-items: flex-end;
  background: linear-gradient(160deg,#EFEDE2,#E1DCC9); background-size: cover; background-position: center;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--color-overlay-dark), rgba(10,14,11,0) 65%); }
.hero-content { position: relative; z-index: 2; padding: var(--sp-6) var(--sp-4) var(--sp-7); color: #fff; max-width: 560px; }
.hero-kicker { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .9; margin-bottom: var(--sp-3); }
.hero-content h1 { font-size: 28px; color: #fff; margin-bottom: var(--sp-4); }
.hero-content h1 b { color: #BFE8C8; }

/* --- Réassurance --- */
.reassurance { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-3); padding: var(--sp-5) var(--sp-4);
  background: var(--color-bg-alt); text-align: center; }
.reassurance .item { font-size: 11px; font-weight: 600; color: var(--color-text-soft); }
.reassurance .item .ic { display: block; font-size: 20px; margin-bottom: var(--sp-2); color: var(--color-accent); }

/* --- Double porte --- */
.doors { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); }
.door { border-radius: var(--radius-lg); padding: var(--sp-5); min-height: 120px; display: flex; flex-direction: column;
  justify-content: flex-end; color: #fff; position: relative; overflow: hidden; cursor: pointer; border: none; text-align: left; }
.door.pro { background: linear-gradient(135deg,#1B6B2F,#134F22); }
.door.part { background: linear-gradient(135deg,#5C6760,#3A433D); }
.door h3 { color: #fff; font-size: 19px; margin-bottom: var(--sp-1); }
.door p { font-size: 12px; opacity: .9; }

/* --- Sections génériques --- */
.section { padding: var(--sp-6) var(--sp-4); }
.section-title { font-size: 22px; margin-bottom: var(--sp-1); }
.section-sub { font-size: 13px; color: var(--color-text-soft); margin-bottom: var(--sp-5); }

/* --- Cartes catégories (avec fallback si pas de photo) --- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.cat-card {
  position: relative; border-radius: var(--radius-md); overflow: hidden; height: 132px;
  display: flex; align-items: flex-end; background: linear-gradient(135deg,#F1EEE3,#E2DCC6);
  text-decoration: none; cursor: pointer; border: none; padding: 0; text-align: left;
}
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-card .veil { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,14,11,.72), rgba(10,14,11,0) 60%); }
.cat-card .lbl { position: relative; z-index: 2; color: #fff; padding: var(--sp-3); }
.cat-card .lbl .n { font-size: 14px; font-weight: 700; font-family: var(--font-titres); }
.cat-card .lbl .c { font-size: 11px; opacity: .9; }
.cat-card.no-photo .lbl .n,
.cat-card.no-photo .lbl .c { color: var(--color-text); }
.cat-card.no-photo .veil { display: none; }
.cat-cta { text-align: center; margin-top: var(--sp-5); }

/* --- Filtres / recherche --- */
.search-bar {
  display: flex; align-items: center; gap: var(--sp-2); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 0 var(--sp-4);
  min-height: var(--tap-min); margin-bottom: var(--sp-4);
}
.search-bar input {
  border: none; outline: none; background: none; font-size: 14px; flex: 1; min-height: var(--tap-min); font-family: var(--font-texte);
}
.tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.tab {
  flex: 0 0 auto; padding: 0 16px; min-height: 36px; display: flex; align-items: center; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; background: var(--color-bg-alt); color: var(--color-text-soft); white-space: nowrap;
  border: none; cursor: pointer;
}
.tab.active { background: var(--color-accent); color: #fff; }

/* --- Produits --- */
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.prod-card { padding: var(--sp-3); cursor: pointer; border: 1px solid var(--color-border); text-align: left; background: var(--color-surface); }
.prod-card .ph {
  height: 84px; border-radius: var(--radius-sm); background: var(--color-bg-alt); margin-bottom: var(--sp-2); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--color-text-soft); text-align: center;
}
.prod-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod-card .nm { font-size: 12px; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.prod-card .un { font-size: 11px; color: var(--color-text-soft); margin-bottom: var(--sp-2); }
.prod-card .price { font-size: 13px; font-weight: 700; color: var(--color-accent-dark); margin-bottom: var(--sp-2); }
.prod-card .add-btn { width: 100%; min-height: 36px; font-size: 12px; padding: 0; }
.empty-state { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--color-text-soft); font-size: 13px; }

/* --- Qui sommes-nous --- */
.about { background: var(--color-bg-alt); }
.about-inner { display: flex; flex-direction: column; gap: var(--sp-4); }
.about .ph { height: 160px; border-radius: var(--radius-md); background: linear-gradient(135deg,#E7E2D2,#D9D2BC);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--color-text-soft); overflow: hidden; }
.about .ph img { width: 100%; height: 100%; object-fit: cover; }
.about p { font-size: 13px; color: var(--color-text-soft); }

/* --- Marques --- */
.brands { display: flex; gap: var(--sp-4); overflow-x: auto; padding: var(--sp-5) var(--sp-4); align-items: center; }
.brand-pill { flex: 0 0 auto; padding: 10px 18px; border-radius: var(--radius-pill); background: var(--color-surface);
  border: 1px solid var(--color-border); font-size: 11px; font-weight: 700; color: var(--color-text-soft); }

/* --- Footer --- */
footer { background: #1B221C; color: #DDE3DE; padding: var(--sp-6) var(--sp-4) var(--sp-6); font-size: 12px; }
footer h4 { color: #fff; font-size: 13px; margin-bottom: var(--sp-3); }
.footer-grid { display: flex; flex-direction: column; gap: var(--sp-5); }
footer .legal { font-size: 11px; opacity: .6; border-top: 1px solid #2C342D; padding-top: var(--sp-4); margin-top: var(--sp-2); }
footer a:hover { color: #fff; }

/* --- Barre sticky WhatsApp (mobile) --- */
.sticky-bar {
  position: sticky; bottom: 0; display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  background: rgba(251,250,246,.95); border-top: 1px solid var(--color-border); backdrop-filter: blur(6px); z-index: 40;
}
.sticky-bar .btn { flex: 1; }
.btn-whatsapp { background: #25A148; color: #fff; }
.btn-whatsapp:hover { background: #1e8a3a; }

/* --- Modales (fiche produit, login pro, panier) --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,14,11,.55); z-index: 100; display: none;
  align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-panel {
  background: var(--color-surface); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: var(--sp-5) var(--sp-4) var(--sp-7);
  position: relative; animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close {
  position: absolute; top: var(--sp-3); right: var(--sp-3); width: 36px; height: 36px; border-radius: var(--radius-pill);
  background: var(--color-bg-alt); border: none; font-size: 16px; cursor: pointer;
}
.fiche-photo { height: 200px; border-radius: var(--radius-md); background: var(--color-bg-alt); margin-bottom: var(--sp-4);
  display: flex; align-items: center; justify-content: center; color: var(--color-text-soft); font-size: 12px; overflow: hidden; }
.fiche-photo img { width: 100%; height: 100%; object-fit: cover; }
.fiche-title { font-size: 19px; margin-bottom: var(--sp-1); }
.fiche-meta { font-size: 13px; color: var(--color-text-soft); margin-bottom: var(--sp-4); }
.fiche-price { font-size: 22px; font-weight: 700; color: var(--color-accent-dark); margin-bottom: var(--sp-4); }
.qty-row { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.qty-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-bg-alt);
  font-size: 18px; cursor: pointer; }
.qty-val { font-size: 16px; font-weight: 700; min-width: 32px; text-align: center; }

/* --- Panier --- */
.cart-item { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; border-bottom: 1px solid var(--color-border); }
.cart-item .nm { font-size: 13px; font-weight: 600; flex: 1; }
.cart-item .qty-row { margin: 0; gap: var(--sp-2); }
.cart-item .qty-btn { width: 32px; height: 32px; font-size: 14px; }
.cart-remove { background: none; border: none; color: var(--color-secondary); font-size: 12px; cursor: pointer; padding: var(--sp-2); }
.cart-empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--color-text-soft); font-size: 13px; }

/* --- Login pro --- */
.form-field { margin-bottom: var(--sp-4); }
.form-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: var(--sp-2); color: var(--color-text-soft); }
.form-field input {
  width: 100%; min-height: var(--tap-min); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 0 var(--sp-4); font-size: 14px; font-family: var(--font-texte);
}
.form-error { font-size: 12px; color: var(--color-secondary); margin-bottom: var(--sp-3); display: none; }
.form-error.show { display: block; }
.pro-status-banner {
  background: var(--color-accent-soft); border: 1px solid #cfe3d3; border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4); font-size: 12px; color: var(--color-accent-dark); margin-bottom: var(--sp-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.pro-status-banner button { background: none; border: none; color: var(--color-accent-dark); font-size: 11px; font-weight: 700;
  text-decoration: underline; cursor: pointer; }

/* ==========================================================================
   RESPONSIVE — mêmes fichiers, redisposition par largeur d'écran
   ========================================================================== */
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(3,1fr); }
  .cat-card { height: 160px; }
  .doors { flex-direction: row; }
  .door { flex: 1; }
  .prod-grid { grid-template-columns: repeat(3,1fr); }
  .reassurance { padding: var(--sp-6) var(--sp-6); }
  .modal-overlay { align-items: center; }
  .modal-panel { border-radius: var(--radius-lg); max-height: 80vh; }
}

@media (min-width: 1024px) {
  .burger-btn { display: none; }
  .desktop-nav { display: flex; }
  .btn-pro-desktop { display: inline-flex; }
  .hero { min-height: 520px; }
  .hero-content { padding: var(--sp-8); }
  .hero-content h1 { font-size: 42px; }
  .section, .reassurance, .doors { padding-left: var(--sp-8); padding-right: var(--sp-8); }
  .cat-grid { grid-template-columns: repeat(4,1fr); }
  .cat-card { height: 190px; }
  .prod-grid { grid-template-columns: repeat(4,1fr); }
  .about-inner { flex-direction: row; align-items: center; }
  .about .ph { flex: 0 0 360px; height: 240px; }
  .footer-grid { flex-direction: row; justify-content: space-between; }
  .sticky-bar { display: none; }
}
