/* ============================================
   style.css
   Styles globaux — identité visuelle du projet.

   Concept : la conversation WhatsApp qui devient une vente.
   Palette dérivée du sujet (marché sénégalais + paiement mobile),
   pas un thème générique.
   ============================================ */

@import url('polices.css');

:root {
  --nuit: #132A3E;
  --nuit-clair: #1D3E58;
  --sable: #F3E9D2;
  --corail: #E85D2C;
  --corail-clair: #FF7D4D;
  --sarcelle: #0E8A88;
  --creme: #FFFBF4;
  --encre: #16211C;
  --gris-texte: #5C6B66;
  --succes: #1E9E5C;
  --erreur: #D64545;

  --police-titre: 'Fraunces', serif;
  --police-corps: 'Work Sans', sans-serif;

  --rayon: 14px;
  --ombre-douce: 0 4px 20px rgba(19, 42, 62, 0.08);
  --ombre-forte: 0 12px 40px rgba(19, 42, 62, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--police-corps);
  background-color: var(--creme);
  color: var(--encre);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a {
  text-decoration: none;
  color: inherit;
}

.conteneur {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background-color: var(--corail);
  color: white;
  border: none;
  border-radius: 999px;
  font-family: var(--police-corps);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 6px 20px rgba(232, 93, 44, 0.35);
}

.bouton:hover {
  transform: translateY(-2px);
  background-color: var(--corail-clair);
  box-shadow: 0 10px 28px rgba(232, 93, 44, 0.45);
}

.bouton:active {
  transform: translateY(0);
}

.bouton-secondaire {
  background-color: transparent;
  color: var(--nuit);
  border: 1.5px solid var(--nuit);
  box-shadow: none;
}

.bouton-secondaire:hover {
  background-color: var(--nuit);
  color: white;
  box-shadow: none;
}

/* ---------- Entête ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 251, 244, 0.85);
  backdrop-filter: blur(10px);
  padding: 18px 0;
  border-bottom: 1px solid rgba(19, 42, 62, 0.08);
}

.entete .conteneur {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 22px;
  color: var(--nuit);
}

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

.entete nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 500;
}

.entete nav a {
  transition: color 0.2s ease;
}

.entete nav a:hover {
  color: var(--corail);
}

/* ---------- Icône panier SVG & SVG utilitaires ---------- */
.icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}

.icon-svg.sm { width: 16px; height: 16px; }
.icon-svg.lg { width: 24px; height: 24px; }
.icon-svg.xl { width: 32px; height: 32px; }

/* Icônes "solides" (remplies) pour remplacer les emojis */
.icon-svg-solide {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* Ajuste l'icône à la taille des éléments qui contenaient des emojis */
.bouton .icon-svg-solide { width: 1.2em; height: 1.2em; }
.bouton-whatsapp .icon-svg-solide { width: 26px; height: 26px; }
.carte-whatsapp .icon-svg-solide { width: 16px; height: 16px; }
.carte-commande-titre .icon-svg-solide,
.carte-commande-sous-titre .icon-svg-solide { width: 14px; height: 14px; }
.grille-fonctionnalites .icon-svg-solide { width: 28px; height: 28px; }
.badge .icon-svg-solide { width: 13px; height: 13px; }

/* Spinner de chargement inline (remplace l'emoji ⌛) */
.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: icone-spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
  opacity: 0.85;
}
@keyframes icone-spin { to { transform: rotate(360deg); } }

.icone-panier {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--sable);
  color: var(--nuit);
  transition: all 0.2s ease;
}

.icone-panier:hover {
  background-color: var(--corail);
  color: white;
}

.compteur-panier {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: var(--corail);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

/* ---------- Section motion utilities ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Focus visible (accessibilité) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--sarcelle);
  outline-offset: 3px;
}

/* ---------- Bandeau catégories (icônes) ---------- */
.bandeau-categories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 26px 0;
}

.categorie-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 84px;
  text-align: center;
  cursor: pointer;
}

.categorie-icone {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background-color: var(--sable);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.categorie-item:hover .categorie-icone {
  transform: translateY(-3px);
  background-color: #EFE2C4;
}

.categorie-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--nuit);
}

/* ---------- Widget WhatsApp flottant ---------- */
.widget-whatsapp {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 60;
}

.bouton-whatsapp {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
  cursor: pointer;
  box-shadow: var(--ombre-forte);
  border: none;
  transition: transform 0.2s ease;
}

.bouton-whatsapp:hover { transform: scale(1.06); }

.carte-whatsapp {
  display: none;
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 290px;
  background-color: white;
  border-radius: 16px;
  box-shadow: var(--ombre-forte);
  overflow: hidden;
}

.carte-whatsapp.ouverte { display: block; }

.carte-whatsapp-entete {
  background-color: #25D366;
  color: white;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.carte-whatsapp-corps {
  padding: 14px;
  background-color: #ECE9DD;
}

.carte-whatsapp .bulle-message {
  margin: 0 0 10px;
}

.carte-whatsapp-action {
  display: block;
  text-align: center;
  padding: 12px;
  background-color: #25D366;
  color: white;
  font-weight: 600;
  font-size: 13.5px;
}

/* ---------- Pied de page uniforme ---------- */
.pied-page-complet {
  padding: 30px 0 20px;
  text-align: center;
  border-top: 1px solid rgba(19, 42, 62, 0.08);
  margin-top: 20px;
}

.pied-page-liens {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--nuit);
}

.pied-page-liens a:hover { color: var(--corail); }

.pied-page-signature {
  font-size: 12.5px;
  color: var(--gris-texte);
}

/* ============================================ */
/* OPTIMISATION GLOBALE DE PERFORMANCE */
/* ============================================ */

/* GPU acceleration pour les transitions */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animations fluides */
button,
a,
input,
select,
textarea {
  transition: all 0.15s ease-out;
  will-change: auto;
}

button:active {
  transform: scale(0.98);
}

/* Images optimisées */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Lazy loading placeholders */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Liens de navigation avec pré-chargement */
a[href] {
  color: var(--corail);
  text-decoration: none;
  position: relative;
}

a[href]:hover {
  color: var(--corail-clair);
}

/* Pagination et transition de page rapide */
body {
  transition: opacity 0.1s ease-out;
}

body.navigating {
  opacity: 0.95;
  pointer-events: none;
}

/* Optimisation pour écrans tactiles */
@media (hover: none) {
  button,
  a {
    -webkit-tap-highlight-color: transparent;
  }
  
  button:active {
    opacity: 0.85;
  }
}

/* Réduction des animations si demandé par le système */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
