/* ==========================================================================
   ALMÈVE — « La formule à nu »
   E-shop = étagère de laboratoire botanique. Transparence comme interface.
   Marcellus (display) · Mulish (texte) · IBM Plex Mono (données de formule)
   Projet démonstratif conçu par Genshi.
   ========================================================================== */

:root {
  --blanc: #FAF8F3;
  --sable: #EFE9DC;
  --sable-2: #E3DAC6;
  --carte: #FFFEFA;
  --encre: #252B23;
  --gris: #6F756A;
  --sauge: #5C6B57;
  --sauge-deep: #46543F;
  --sauge-pale: #C9D2C4;
  --ligne: rgba(37, 43, 35, 0.14);
  --ligne-2: rgba(37, 43, 35, 0.08);
  --ombre: 0 20px 50px -28px rgba(37, 43, 35, 0.35);
  --f-display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --f-body: "Mulish", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--blanc);
  color: var(--encre);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--sauge); color: var(--blanc); }

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sauge); outline-offset: 3px; }

/* ---------- Typographie ---------- */

h1, h2, h3, .display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; }

p { text-wrap: pretty; }

.lead { font-size: 1.1rem; color: var(--gris); max-width: 38em; }

.mono {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris);
}

.mono--sauge { color: var(--sauge); }

/* ---------- Layout ---------- */

.aw { width: min(1240px, 92vw); margin-inline: auto; }
.asec { padding-block: clamp(56px, 7vw, 100px); }
.astack > * + * { margin-top: 16px; }

.hr { border: none; border-top: 1px solid var(--ligne); }

/* ---------- Bandeau annonce ---------- */

.annonce {
  background: var(--encre);
  color: var(--blanc);
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px;
}

/* ---------- Header ---------- */

.ahd {
  position: sticky;
  top: -1px; /* évite le filet de 1px au-dessus du header sticky */
  z-index: 60;
  background: color-mix(in srgb, var(--blanc) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ligne-2);
  transition: box-shadow 0.3s;
}

.ahd.is-scrolled { box-shadow: 0 12px 30px -24px rgba(37, 43, 35, 0.4); }

.ahd .aw { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 16px; }

.alogo { text-decoration: none; display: flex; flex-direction: column; line-height: 1; }
.alogo .l-name { font-family: var(--f-display); font-size: 1.55rem; letter-spacing: 0.34em; }
.alogo .l-sub { font-family: var(--f-mono); font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gris); margin-top: 5px; }

.anav { display: flex; align-items: center; gap: 28px; }

.anav a:not(.cartbtn) {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gris);
  padding-block: 6px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.anav a:not(.cartbtn):hover { color: var(--encre); border-bottom-color: var(--sauge-pale); }
.anav a:not(.cartbtn)[aria-current="page"] { color: var(--encre); border-bottom-color: var(--sauge); }

.cartbtn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--encre);
  border-radius: 100px;
  padding: 9px 18px;
  background: transparent;
  cursor: pointer;
  font-family: var(--f-body);
  color: var(--encre);
  transition: background 0.2s, color 0.2s;
}

.cartbtn:hover { background: var(--encre); color: var(--blanc); }

.cartbtn .count {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  background: var(--sauge);
  color: var(--blanc);
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aburger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; background: none; border: none; cursor: pointer; }
.aburger span { width: 22px; height: 1.5px; background: var(--encre); transition: transform 0.3s, opacity 0.3s; }

/* ---------- Boutons ---------- */

.b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 16px 28px;
  background: var(--sauge);
  color: var(--blanc);
  border: 1px solid var(--sauge);
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.b:hover { background: var(--sauge-deep); border-color: var(--sauge-deep); transform: translateY(-1px); }

.b--line { background: transparent; color: var(--encre); border-color: var(--encre); }
.b--line:hover { background: var(--encre); border-color: var(--encre); color: var(--blanc); }

.b--sm { padding: 11px 18px; font-size: 0.7rem; }

.b[disabled] { opacity: 0.45; cursor: default; transform: none; }

/* ---------- Jauge de composition ---------- */

.gauge { display: grid; gap: 7px; }

.gauge .g-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--sable-2);
  overflow: hidden;
  display: flex;
}

.gauge .g-fill { background: var(--sauge); border-radius: 2px; }

.gauge .g-legend { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--gris); }

.gauge .g-legend strong { color: var(--encre); font-weight: 500; }

/* ---------- Chips « sans » ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gris);
  border: 1px solid var(--ligne);
  border-radius: 100px;
  padding: 5px 12px;
  background: var(--carte);
}

.chip::before { content: "Ø "; color: var(--sauge); font-weight: 700; }

/* ---------- Carte produit ---------- */

.pcard {
  background: var(--carte);
  border: 1px solid var(--ligne-2);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
  position: relative;
}

.pcard:hover { transform: translateY(-4px); box-shadow: var(--ombre); border-color: var(--ligne); }

.pcard .p-img { aspect-ratio: 4 / 5; overflow: hidden; background: var(--sable); position: relative; }
.pcard .p-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.pcard:hover .p-img img { transform: scale(1.035); }

.pcard .p-num {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  background: color-mix(in srgb, var(--blanc) 88%, transparent);
  border: 1px solid var(--ligne);
  border-radius: 2px;
  padding: 4px 8px;
  color: var(--encre);
}

.pcard .p-body { padding: 18px 18px 20px; display: grid; gap: 12px; flex: 1; }

.pcard .p-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }

.pcard .p-name { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.2; }

.pcard .p-price { font-family: var(--f-display); font-size: 1.05rem; white-space: nowrap; }

.pcard .p-add {
  margin-top: auto;
  font-family: var(--f-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sauge);
  background: none;
  border: 1px solid var(--sauge-pale);
  border-radius: 2px;
  padding: 11px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pcard .p-add:hover { background: var(--sauge); border-color: var(--sauge); color: var(--blanc); }

/* ---------- Note de la formulatrice ---------- */

.note-inz {
  border-left: 2px solid var(--sauge);
  background: var(--carte);
  padding: 20px 24px;
  display: grid;
  gap: 8px;
}

.note-inz .mono { font-size: 0.64rem; }
.note-inz p { font-size: 0.95rem; color: var(--encre); font-style: italic; max-width: 56ch; }
.note-inz .sig { font-size: 0.8rem; color: var(--gris); font-style: normal; }

/* ---------- Accordéons (fiche produit) ---------- */

details.acc { border-top: 1px solid var(--ligne); }
details.acc:last-of-type { border-bottom: 1px solid var(--ligne); }

details.acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; font-family: var(--f-mono); font-size: 1rem; color: var(--sauge); transition: transform 0.25s; }
details.acc[open] summary::after { transform: rotate(45deg); }

details.acc .acc-body { padding-bottom: 20px; font-size: 0.93rem; color: var(--gris); }

/* INCI : la formule ligne par ligne */
.inci { display: grid; gap: 0; }
.inci-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  gap: 8px 18px;
  padding-block: 9px;
  border-bottom: 1px solid var(--ligne-2);
  font-size: 0.82rem;
  align-items: baseline;
}
.inci-row:last-child { border-bottom: none; }
.inci-row .lat { font-family: var(--f-mono); font-size: 0.7rem; color: var(--encre); }
.inci-row .fr { color: var(--encre); }
.inci-row .role { color: var(--gris); font-size: 0.78rem; }
.inci-row .pct { font-family: var(--f-mono); font-size: 0.7rem; color: var(--sauge); }
@media (max-width: 640px) { .inci-row { grid-template-columns: 1fr 1fr; } .inci-row .role { grid-column: 1 / -1; } }

/* ---------- Le lot ---------- */

.lot {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--gris);
  border: 1px dashed var(--ligne);
  border-radius: 2px;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

/* ---------- Mini-panier (drawer) ---------- */

.drawer-veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(37, 43, 35, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.drawer-veil.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  width: min(420px, 100vw);
  background: var(--blanc);
  border-left: 1px solid var(--ligne);
  box-shadow: -24px 0 60px -30px rgba(37, 43, 35, 0.45);
  transform: translateX(102%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.drawer.is-open { transform: none; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--ligne); }
.drawer-head h3 { font-size: 1.2rem; }
.drawer-close { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--gris); padding: 6px; }
.drawer-close:hover { color: var(--encre); }

.drawer-body { flex: 1; overflow-y: auto; padding: 18px 24px; display: grid; gap: 16px; align-content: start; }

.drawer-empty { text-align: center; color: var(--gris); padding-block: 40px; font-size: 0.95rem; }

.citem { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; }
.citem img { width: 72px; height: 86px; object-fit: cover; background: var(--sable); }
.citem .ci-num { font-family: var(--f-mono); font-size: 0.62rem; color: var(--gris); }
.citem .ci-name { font-family: var(--f-display); font-size: 0.98rem; line-height: 1.2; }
.citem .ci-price { font-family: var(--f-display); font-size: 0.95rem; white-space: nowrap; }

.qty { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--ligne); border-radius: 2px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; background: none; border: none; cursor: pointer; font-family: var(--f-mono); color: var(--gris); font-size: 0.85rem; }
.qty button:hover { color: var(--encre); }
.qty span { font-family: var(--f-mono); font-size: 0.75rem; min-width: 26px; text-align: center; }

.ci-remove { background: none; border: none; cursor: pointer; font-size: 0.7rem; color: var(--gris); text-decoration: underline; font-family: var(--f-body); margin-top: 4px; }

.drawer-foot { border-top: 1px solid var(--ligne); padding: 18px 24px 22px; display: grid; gap: 12px; }
.drawer-total { display: flex; justify-content: space-between; font-family: var(--f-display); font-size: 1.15rem; }
.drawer-foot .ship { font-size: 0.78rem; color: var(--gris); }

/* toast ajout panier */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translate(-50%, 80px);
  z-index: 100;
  background: var(--encre);
  color: var(--blanc);
  font-size: 0.85rem;
  padding: 12px 22px;
  border-radius: 2px;
  opacity: 0;
  transition: transform 0.35s, opacity 0.35s;
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Footer ---------- */

.aft { background: var(--sable); border-top: 1px solid var(--ligne); padding-block: 56px 28px; }

.aft-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 40px; border-bottom: 1px solid var(--ligne); }

.aft h4 { font-family: var(--f-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gris); margin-bottom: 14px; }

.aft ul { list-style: none; display: grid; gap: 7px; font-size: 0.9rem; }
.aft a { text-decoration: none; }
.aft a:hover { text-decoration: underline; }

.aft-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 20px; font-size: 0.76rem; color: var(--gris); }

/* ---------- Badge démo ---------- */

.g-demo-badge {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 80;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--gris);
  background: color-mix(in srgb, var(--carte) 92%, transparent);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  max-width: 70vw;
}

/* ---------- Révélation ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .rv.is-in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .anav {
    position: fixed;
    inset: 0;
    z-index: 70;
    flex-direction: column;
    justify-content: center;
    gap: 6vh;
    background: var(--blanc);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .anav a:not(.cartbtn) { font-family: var(--f-display); font-size: 1.9rem; color: var(--encre); }
  .anav.is-open { opacity: 1; pointer-events: auto; }
  .aburger { display: flex; position: relative; z-index: 75; }
  .aburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .aburger.is-open span:nth-child(2) { opacity: 0; }
  .aburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .aft-grid { grid-template-columns: 1fr 1fr; }
  .g-demo-badge { display: none; }
}

@media (max-width: 560px) {
  .aft-grid { grid-template-columns: 1fr; }
}
