/* ============================================================
   PeptidLab — Styles personnalisés
   Palette : vert sauge, bleu apaisant, or doux, blanc cassé
   ============================================================ */

:root {
  /* Palette claire — blanc lumineux, bleu vif, vert émeraude */
  --color-bg:           #FFFFFF;
  --color-bg-soft:      #F6F9FC;
  --color-surface:      #FFFFFF;
  --color-surface-alt:  #EEF3F9;
  --color-border:       #E1E8F0;

  --color-text:         #0F172A;
  --color-text-soft:    #475569;
  --color-text-muted:   #64748B;

  --color-primary:      #2563EB;   /* bleu vif */
  --color-primary-dark: #1D4ED8;
  --color-primary-soft: #EAF1FE;

  --color-accent:       #0EA968;   /* vert émeraude frais */
  --color-accent-soft:  #E7F8EF;

  --color-gold:         #F59E0B;   /* ambre lumineux */
  --color-gold-soft:    #FEF3E2;

  --color-success:      #0EA968;
  --color-danger:       #E11D48;

  --shadow-soft: 0 2px 12px rgba(15, 23, 42, 0.05);
  --shadow-med:  0 8px 28px rgba(15, 23, 42, 0.09);
  --shadow-lg:   0 20px 56px rgba(15, 23, 42, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

/* Palette sombre (activable via le bouton mode sombre) */
.dark {
  --color-bg:           #0B1220;
  --color-bg-soft:      #111A2C;
  --color-surface:      #111A2C;
  --color-surface-alt:  #1A2740;
  --color-border:       #263A57;

  --color-text:         #F1F5F9;
  --color-text-soft:    #CBD5E1;
  --color-text-muted:   #94A3B8;

  --color-primary:      #5B9BF6;
  --color-primary-dark: #3B82F6;
  --color-primary-soft: #16233C;

  --color-accent:       #34D399;
  --color-accent-soft:  #113026;

  --color-gold:         #FBBF24;
  --color-gold-soft:    #2E2208;

  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-med:  0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 18px 50px rgba(0, 0, 0, 0.5);
}

/* ============== Base ============== */
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ============== Utility helpers ============== */
.bg-surface     { background: var(--color-surface); }
.bg-surface-alt { background: var(--color-surface-alt); }
.bg-soft        { background: var(--color-bg-soft); }
.text-soft      { color: var(--color-text-soft); }
.text-muted     { color: var(--color-text-muted); }
.text-primary   { color: var(--color-primary); }
.text-accent    { color: var(--color-accent); }
.text-gold      { color: var(--color-gold); }
.border-soft    { border-color: var(--color-border); }
.shadow-soft    { box-shadow: var(--shadow-soft); }
.shadow-med     { box-shadow: var(--shadow-med); }
.shadow-lg      { box-shadow: var(--shadow-lg); }

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  transition: all .2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 170, 117, .35);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(107, 170, 117, .45);
}
.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-soft);
}
.btn-ghost:hover { color: var(--color-primary); }

.btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* ============== Cards ============== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-med);
  border-color: var(--color-primary-soft);
}

/* ============== Badges ============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge-new       { background: var(--color-accent-soft); color: var(--color-accent); }
.badge-bestseller{ background: var(--color-gold-soft);    color: var(--color-gold); }
.badge-promo     { background: #FDE6EC;                   color: var(--color-danger); }
.dark .badge-promo { background: #3A1224; }

/* ============== Header / nav ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--color-bg) 80%, transparent);
  border-bottom: 1px solid var(--color-border);
}

.nav-link {
  position: relative;
  color: var(--color-text-soft);
  font-weight: 500;
  font-size: .95rem;
  transition: color .2s;
  padding: .25rem 0;
}
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* ============== Hero ============== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top right, var(--color-primary-soft), transparent 60%),
    radial-gradient(ellipse at bottom left, var(--color-accent-soft), transparent 55%),
    var(--color-bg);
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .35;
  pointer-events: none;
}

/* ============== Decorative molecule pattern ============== */
.molecule-bg {
  background-image:
    radial-gradient(circle at 20% 30%, var(--color-primary-soft) 0, transparent 8%),
    radial-gradient(circle at 80% 70%, var(--color-accent-soft) 0, transparent 9%),
    radial-gradient(circle at 60% 20%, var(--color-gold-soft) 0, transparent 7%);
  background-size: 600px 600px;
}

/* ============== Form ============== */
.input, .textarea, .select {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  color: var(--color-text);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

/* ============== Animations ============== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .7s ease both; }

@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}
.float { animation: floaty 5s ease-in-out infinite; }

/* ============== Cart badge ============== */
.cart-count {
  position: absolute;
  top: -4px; right: -6px;
  background: var(--color-primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  height: 18px; min-width: 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.cart-count.hidden { display: none; }

/* ============== Toast ============== */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: fadeUp .4s ease both;
  max-width: 320px;
  font-weight: 500;
}
.toast-error { border-left-color: var(--color-danger); }

/* ============== Footer ============== */
.site-footer {
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
}

/* ============== Scrollbar (subtil) ============== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ============== Focus visible global ============== */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============== Mobile nav ============== */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 60;
  display: none;
  flex-direction: column;
  padding: 5rem 2rem 2rem;
}
.mobile-nav.open { display: flex; }

/* ============== WhatsApp floating button ============== */
.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
  z-index: 90;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: whatsappPulse 2.4s ease-in-out infinite;
}
.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(37, 211, 102, .6);
}
@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(37, 211, 102, .45), 0 0 0 0 rgba(37, 211, 102, .5); }
  50%      { box-shadow: 0 6px 20px rgba(37, 211, 102, .45), 0 0 0 14px rgba(37, 211, 102, 0); }
}

/* ============== Social proof notification ============== */
.social-proof {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 80;
  max-width: 320px;
  transform: translateY(20px) translateX(-10px);
  opacity: 0;
  transition: transform .4s ease, opacity .4s ease;
  pointer-events: none;
}
.social-proof.show {
  transform: translateY(0) translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.social-proof-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--color-text);
  position: relative;
}
.social-proof-img {
  width: 44px; height: 44px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.social-proof-text { flex: 1; min-width: 0; }
.social-proof-title { font-size: .82rem; }
.social-proof-desc {
  font-size: .78rem;
  color: var(--color-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.social-proof-time {
  font-size: .68rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.social-proof-close {
  position: absolute;
  top: 4px; right: 6px;
  background: none; border: 0;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.social-proof-close:hover { color: var(--color-text); }

/* Petit écran : aligner la preuve sociale au-dessus de WhatsApp */
@media (max-width: 640px) {
  .social-proof { left: 12px; bottom: 12px; max-width: calc(100vw - 90px); }
  .whatsapp-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }
}

/* ============== Bandeau cookies RGPD ============== */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 24px rgba(0,0,0,.08);
  padding: 1.25rem 1.5rem;
  z-index: 95;
  display: none;
  transform: translateY(100%);
  transition: transform .4s ease;
}
.cookie-banner.show { display: block; transform: translateY(0); }
.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.cookie-banner-text { flex: 1; min-width: 240px; font-size: .9rem; color: var(--color-text-soft); }
.cookie-banner-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
