/* SBH Boutique — design e-commerce premium */

:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f5f2eb;
  --border: #e8e4dd;
  --border-strong: #d9d3ca;
  --text: #2a2725;
  --text-2: #6b6663;
  --text-3: #a09b97;
  --rose: #c8847d;
  --rose-dark: #a96762;
  --rose-light: #f5e6e3;
  --gold: #b8956f;
  --green: #6b8e6b;
  --green-light: #e7efe7;
  --red: #c47171;
  --red-light: #f3e0e0;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.08);
  --container: 1200px;
  --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Pas de zoom (pinch / double-tap) — la fiche produit a sa propre lightbox pour agrandir */
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-x: none;
}
/* Évite que iOS Safari zoome automatiquement sur le focus d'un champ < 16px */
input, textarea, select { font-size: 16px; }

body { min-height: 100vh; display: flex; flex-direction: column; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

/* ── Top banner (marquee défilant) ────────────────────── */
.top-banner {
  background: #1f1c1a;
  color: #fff;
  overflow: hidden;
  padding: 8px 0;
  font-size: .82rem;
  letter-spacing: .03em;
  position: relative;
  z-index: 110;
  user-select: none;
  -webkit-user-select: none;
}
.top-banner-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
  animation: bannerScroll 38s linear infinite;
}
.top-banner-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
  flex-shrink: 0;
}
.top-banner-item {
  font-weight: 500;
}
.top-banner-sep {
  opacity: .45;
  font-size: 1.1em;
  line-height: 1;
}
@keyframes bannerScroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .top-banner-track { animation: none; justify-content: center; }
  .top-banner-group:nth-child(2) { display: none; }
}

/* ── Header ───────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.85);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  /* Padding vertical réduit pour compenser le logo plus gros → la bande garde la même hauteur */
  padding: .55rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand-logo { height: 56px; width: auto; max-width: 180px; object-fit: contain; flex-shrink: 0; }
.brand-tagline {
  font-family: 'Inter', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: .22em;
  text-transform: uppercase;
  border-left: 1px solid var(--border-strong);
  padding-left: .75rem;
  line-height: 1;
}

.header-actions { display: flex; align-items: center; gap: .6rem; }

.lang-switch {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px;
  font-size: .72rem;
  font-weight: 500;
}
.lang-switch button {
  padding: .25rem .55rem;
  border-radius: 999px;
  color: var(--text-3);
  transition: all .2s;
}
.lang-switch button.active {
  background: var(--text);
  color: var(--bg);
}

.cart-link {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: .85rem; color: var(--text);
  transition: background .2s;
}
.cart-link:hover { background: var(--rose-light); }
.cart-count {
  background: var(--rose);
  color: #fff;
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.cart-count[data-empty="true"] { display: none; }

/* ── Container ────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  width: 100%;
  flex: 1;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 2rem 0 2.5rem;
  text-align: center;
}
.hero h1 {
  font-family: 'Cinzel', 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin: 0 0 .9rem;
  line-height: 1.1;
}
.hero p {
  font-family: 'Inter', sans-serif;
  color: var(--text-3);
  font-size: .82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .28em;
  margin: 0 auto;
  max-width: 540px;
}

/* ── Filters ──────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 1.5rem;
}
.filters-centered { justify-content: center; }
.filter-chip {
  white-space: nowrap;
  padding: .4rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--text-2);
  background: var(--surface);
  transition: all .2s;
}
.filter-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.filter-chip:not(.active):hover {
  border-color: var(--text-2);
  color: var(--text);
}

.search-row {
  display: flex; gap: .6rem; align-items: center;
  margin-bottom: 1.5rem;
}
.search-input {
  flex: 1;
  padding: .7rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--rose); }
.search-input::placeholder { color: var(--text-3); }

/* ── Product grid ─────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
}
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  display: block;
  /* Empêche iOS de "réfléchir" entre tap et long-press → scroll fluide */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* L'effet "soulèvement au survol" n'est appliqué QUE sur les appareils avec
   vraie souris (hover: hover). Sur iOS / Android, le :hover s'active au tap
   et reste collé jusqu'à un autre tap → bloque le scroll. */
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
}

.card-img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
  position: relative;
  /* Bloque le menu natif iOS Safari (Enregistrer / Partager) au long-press */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.card-img-wrap > img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;  /* le tap traverse vers le lien <a class="card"> */
}
@media (hover: hover) {
  .card:hover .card-img-wrap > img { transform: scale(1.04); }
}
.card-img-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 3rem;
}

/* ── Slider photos sur les cartes catalogue (scroll-snap natif) ── */
.card-slider {
  display: flex;
  width: 100%; height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* On autorise pan-x (swipe horizontal entre photos) ET pan-y (scroll vertical de
     la page quand le doigt est sur la vignette). iOS choisit la direction selon le
     mouvement initial. Le scroll-snap garde le snap horizontal. */
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  /* Bloque le menu natif iOS au long-press sur les vignettes */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.card-slider::-webkit-scrollbar { display: none; }
.card-slider img {
  flex: 0 0 100%;
  width: 100%; height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  pointer-events: none;  /* tap = click sur la carte ; swipe = scroll natif */
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-drag: none;
}
.card-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
  pointer-events: none;
  background: rgba(0,0,0,.18);
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card-dot {
  width: 6px; height: 6px;
  background: rgba(255,255,255,.55);
  border-radius: 50%;
  transition: width .25s ease, background .2s;
}
.card-dot.active {
  background: #fff;
  width: 18px;
  border-radius: 4px;
}

.card-body { padding: 1rem 1rem 1.25rem; text-align: center; }
.card-cat {
  font-size: .68rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .35rem;
}
.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 .4rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price {
  font-size: 1rem;
  color: var(--rose-dark);
  font-weight: 600;
  margin-top: .45rem;
}
.card-sizes-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .35rem;
  font-size: .68rem;
  color: var(--text-2);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: .02em;
}

/* ── Stock indicator (carte + page produit) ───────────── */
.stock-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .4rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
}
.stock-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stock-chip.in-stock {
  background: #e7f3ea;
  color: #2e7d4f;
}
.stock-chip.in-stock .dot { background: #34a853; box-shadow: 0 0 0 3px rgba(52,168,83,.18); }
.stock-chip.preorder {
  background: #fdf0e1;
  color: #b56a1a;
}
.stock-chip.preorder .dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.stock-chip.admin-inline {
  margin: 0 .35rem 0 .2rem;
  vertical-align: middle;
  padding: .12rem .5rem;
  font-size: .65rem;
}

.product-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  padding: .45rem .95rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.product-stock-badge .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.product-stock-badge.in-stock {
  background: #e7f3ea;
  color: #2e7d4f;
}
.product-stock-badge.in-stock .dot { background: #34a853; box-shadow: 0 0 0 3.5px rgba(52,168,83,.2); }
.product-stock-badge.preorder {
  background: #fdf0e1;
  color: #b56a1a;
}
.product-stock-badge.preorder .dot { background: #f59e0b; box-shadow: 0 0 0 3.5px rgba(245,158,11,.2); }

/* ── Product detail ──────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  padding: .55rem 1.05rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: background .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .back-link:hover {
    background: var(--text);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
  }
}
.back-link:active { transform: scale(.97); }

.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 880px) {
  .product { grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; }
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.gallery-main {
  /* Cadre carré : la photo entière est toujours visible (object-fit: contain),
     centrée dans le carré, avec le fond crémeux qui apparaît en haut/bas
     ou sur les côtés si la photo n'est pas elle-même carrée. Coins arrondis. */
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  padding: .35rem;
  cursor: zoom-in;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.gallery-main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - .25rem);
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.gallery-thumbs {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.gallery-thumb {
  width: 80px; height: 80px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s;
  background: var(--surface-2);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.gallery-thumb.active { opacity: 1; box-shadow: 0 0 0 2px var(--rose); }
.gallery-thumb:hover { opacity: .9; }
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.product-info { padding: .5rem 0; }
.product-cat {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .75rem;
}
.product-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 1rem;
  line-height: 1.15;
}
.product-price {
  font-size: 1.75rem;
  color: var(--rose-dark);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.product-dims {
  display: flex; gap: .5rem;
  align-items: center;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  padding: .9rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* ── Variant selector (page produit) ──────────────────── */
.variant-selector { margin: 0 0 1.5rem; }
.variant-selector-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .55rem;
}
.variant-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.variant-pill {
  padding: .55rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.variant-pill:hover { border-color: var(--text-2); }
.variant-pill.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── Catalog "from" label ─────────────────────────────── */
.from-label {
  font-size: .72rem;
  color: var(--text-3);
  font-weight: 400;
  text-transform: lowercase;
  margin-right: .2rem;
}

/* ── Color dots (catalog card + product page) ─────────── */
.card-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: .6rem;
}
.color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset;
  flex-shrink: 0;
  cursor: help;
  transition: transform .15s;
}
.color-dot:hover { transform: scale(1.2); }
.color-more {
  font-size: .68rem;
  color: var(--text-3);
  margin-left: 2px;
  font-weight: 500;
}

.product-colors { margin: 0 0 1.5rem; }
.product-colors-label {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .55rem;
}
.product-colors-dots {
  display: flex; flex-wrap: wrap;
  gap: .55rem;
}
.color-dot-lg {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.08);
  box-shadow: 0 0 0 2px rgba(255,255,255,.6) inset, var(--shadow-sm);
  cursor: help;
  transition: transform .15s;
}
.color-dot-lg:hover { transform: scale(1.12); }

/* ── Cart item variant badge ──────────────────────────── */
.cart-item-variant {
  display: inline-block;
  margin-left: .4rem;
  padding: .12rem .5rem;
  background: var(--rose-light);
  color: var(--rose-dark);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: .03em;
  vertical-align: middle;
}

/* ── Order item variant badge (admin) ─────────────────── */
.order-item-variant {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .45rem;
  background: var(--rose-light);
  color: var(--rose-dark);
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.product-desc {
  font-size: .92rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  white-space: pre-line;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 500;
  text-align: center;
  transition: all .2s;
  font-family: inherit;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}
.btn-primary:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn-primary:disabled { background: var(--text-3); border-color: var(--text-3); cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--text); background: var(--surface-2); }
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: 1px solid #25D366;
}
.btn-whatsapp:hover { background: #1ebd5a; border-color: #1ebd5a; }
.btn-email {
  background: var(--rose);
  color: #fff;
  border: 1px solid var(--rose);
}
.btn-email:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red-light);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }
.btn-row { display: flex; gap: .6rem; }
.btn-row .btn { width: auto; flex: 1; }

.actions { display: flex; flex-direction: column; gap: .65rem; }

/* ── Payment info (discreet) ──────────────────────────── */
.payment-info {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: .76rem;
  line-height: 1.55;
  color: var(--text-2);
  text-align: center;
}

/* ── Cart ─────────────────────────────────────────────── */
.cart-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.cart-header h1 {
  font-size: 2rem;
  margin: 0 0 .35rem;
}
.cart-header p { color: var(--text-2); margin: 0; font-size: .9rem; }

.cart-items { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  background: var(--surface);
  padding: 1rem;
  border-radius: var(--radius);
  align-items: center;
}
.cart-item-img {
  width: 80px; height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}
.cart-item-img img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.cart-item-info { min-width: 0; }
.cart-item-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin: 0 0 .25rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-cat { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .25rem; }
.cart-item-price-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .5rem;
  gap: .75rem;
}
.cart-item-price { color: var(--rose-dark); font-weight: 600; font-size: .95rem; text-align: right; }
.cart-item-unit { display: block; color: var(--text-3); font-size: .7rem; font-weight: 400; margin-top: 2px; }
.qty-stepper {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.qty-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.qty-btn:hover { background: var(--rose-light); color: var(--rose-dark); }
.qty-value {
  min-width: 28px; text-align: center;
  font-weight: 600; font-size: .9rem;
}
.cart-item-remove {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 1rem;
  transition: all .2s;
}
.cart-item-remove:hover { background: var(--surface-2); color: var(--red); }

.cart-total {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: .5rem;
  font-size: .9rem;
  color: var(--text-2);
}
.cart-total-row.grand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  margin-top: .5rem;
}
.cart-total-row.grand strong { color: var(--rose-dark); font-family: 'Playfair Display', serif; font-weight: 500; font-size: 1.5rem; }

.checkout-form {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.checkout-form .field { margin-bottom: 1rem; }
.checkout-form .field label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.checkout-form .field input,
.checkout-form .field textarea {
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.checkout-form .field input:focus,
.checkout-form .field textarea:focus { border-color: var(--rose); background: var(--surface); }
.checkout-form .field textarea { resize: vertical; min-height: 80px; }
.checkout-summary { margin-bottom: 1.25rem; }

.cart-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-2);
}
.cart-empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.cart-empty h2 { font-size: 1.4rem; margin: 0 0 .5rem; }
.cart-empty p { margin: 0 0 1.5rem; font-size: .9rem; }

/* ── States ───────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-3);
  font-size: .9rem;
}
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-2);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .35; }
.empty-state h2 { font-size: 1.4rem; margin: 0 0 .5rem; }
.empty-state p { color: var(--text-3); margin: 0; }

.badge-soldout {
  position: absolute;
  top: .75rem; right: .75rem;
  background: rgba(42, 39, 37, .85);
  color: #fff;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  backdrop-filter: blur(4px);
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 1.25rem;
  margin-top: 3rem;
  text-align: center;
  font-size: .8rem;
  color: var(--text-3);
}
.footer p { margin: .25rem 0; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--rose-dark); text-decoration: underline; }

/* ── Toast ────────────────────────────────────────────── */
#toast {
  position: fixed;
  left: 50%; bottom: calc(var(--safe-bottom) + 24px);
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: var(--bg);
  padding: .85rem 1.25rem;
  border-radius: 999px;
  font-size: .85rem;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── ADMIN ────────────────────────────────────────────── */
.admin-wrap { max-width: 880px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 0;
  width: 100%;
}
.admin-tab {
  flex: 1 1 0;                  /* chaque onglet prend une part égale (25 %) */
  text-align: center;
  justify-content: center;       /* contenu centré horizontalement */
  padding: .8rem .4rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  min-width: 0;                 /* permet le shrink propre */
}
@media (max-width: 480px) {
  .admin-tab { padding: .75rem .3rem; font-size: .9rem; }
}
.admin-tab:hover { color: var(--text-2); }
.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--rose);
}
.tab-count {
  background: var(--rose);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: .1rem .45rem;
  min-width: 18px;
  text-align: center;
}
.tab-count:empty, .tab-count[style*="none"] { display: none; }

/* Orders grid */
.orders-grid { display: flex; flex-direction: column; gap: 1rem; }
.order-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.order-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.order-customer {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.2;
}
.order-date { font-size: .78rem; color: var(--text-3); margin-top: .15rem; }
.order-total {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--rose-dark);
  font-weight: 500;
  white-space: nowrap;
}
.order-contact {
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: .65rem;
  line-height: 1.7;
}
.order-contact a { color: var(--rose-dark); }
.order-contact a:hover { text-decoration: underline; }
.order-notes {
  font-size: .82rem;
  color: var(--text-2);
  background: var(--surface-2);
  padding: .55rem .8rem;
  border-radius: var(--radius);
  margin-bottom: .85rem;
  line-height: 1.5;
}
.order-items { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.order-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .65rem;
  align-items: center;
  background: var(--surface-2);
  padding: .5rem .75rem;
  border-radius: var(--radius);
}
.order-item-img-wrap { position: relative; width: 48px; height: 48px; }
.order-item img, .order-item-noimg {
  width: 48px; height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 1.3rem;
}
/* Pastille couleur en overlay sur la miniature (carte commande) */
.order-item-img-dot {
  position: absolute;
  bottom: -3px; right: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--surface-2);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.order-item-name { font-size: .9rem; font-weight: 500; line-height: 1.2; }
.order-item-meta { font-size: .75rem; color: var(--text-3); margin-top: .15rem; }
/* Badge couleur inline (à côté du nom du produit dans la carte commande) */
.order-item-color {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 500;
  padding: .08rem .4rem .08rem .25rem; border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  margin-left: .35rem; vertical-align: middle;
}
.order-item-color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
  flex-shrink: 0;
}
.order-actions {
  display: flex; gap: .5rem; align-items: center;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}
.order-status-select {
  flex: 1;
  padding: .55rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.btn-mini-danger {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--red-light);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.btn-mini-danger:hover { background: var(--red); color: #fff; }

/* ─── Carte commande : version cliquable (tap → modal d'édition) ─── */
.order-card[data-order-open] { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.order-card[data-order-open]:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.order-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.order-item-more { font-size: .78rem; color: var(--text-3); padding: .25rem .5rem; text-align: center; }

/* ─── Status badges (7 statuts) ─── */
.status-badge {
  display: inline-flex; align-items: center;
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
/* Badge méthode de paiement — visible uniquement sur les commandes Payées */
.payment-method-badge {
  display: inline-flex; align-items: center;
  font-size: .7rem;
  font-weight: 500;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
  margin-top: .25rem;
}
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-confirmed  { background: #dbeafe; color: #1e3a8a; }
.badge-ordered    { background: #ede9fe; color: #5b21b6; }
.badge-transit    { background: #fef3c7; color: #78350f; }
.badge-delivered  { background: #d1fae5; color: #065f46; }
.badge-paid       { background: #16a34a; color: #ffffff; }
.badge-cancelled  { background: #f3f4f6; color: #6b7280; }
.badge-completed  { background: #d1fae5; color: #065f46; }  /* rétrocompat */

/* ─── Modal commande ─── */
.modal-narrow .modal { max-width: 520px; }
.order-meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.order-edit-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem;
  margin-bottom: .65rem;
}
.order-edit-item-head { display: grid; grid-template-columns: 44px 1fr 28px; gap: .5rem; align-items: center; margin-bottom: .55rem; }
.oei-img-wrap { position: relative; width: 44px; height: 44px; }
.order-edit-item-head img, .order-edit-item-noimg {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 1.2rem;
}
/* Pastille couleur en overlay (bas-droit de la photo) — identifie le coloris commandé */
.oei-color-dot {
  position: absolute;
  bottom: -3px; right: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.oei-name { font-size: .92rem; font-weight: 500; line-height: 1.2; }
.oei-sub { font-size: .72rem; color: var(--text-3); margin-top: .1rem; }
/* Badges variante/couleur sous le nom du produit */
.oei-sub-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.oei-variant-badge {
  display: inline-flex; align-items: center;
  font-size: .72rem; font-weight: 500;
  padding: .15rem .5rem; border-radius: 10px;
  background: var(--rose-light); color: var(--rose-dark);
  letter-spacing: .02em;
}
.oei-color-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 500;
  padding: .15rem .5rem .15rem .3rem; border-radius: 10px;
  background: var(--surface-2); color: var(--text-2);
}
.oei-color-badge-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
  flex-shrink: 0;
}
.oei-remove {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  font-size: .85rem;
}
.oei-remove:hover { background: var(--red-light); color: var(--red); border-color: var(--red-light); }
.order-edit-item-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: .45rem;
}
.order-edit-item-grid label {
  display: block;
  font-size: .68rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .25rem;
}
.order-edit-item-grid input {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
}
.oei-input-eur {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0 .55rem 0 0;
}
.oei-input-eur input { border: none !important; padding: .5rem .55rem !important; outline: none; background: transparent !important; }
.oei-input-eur span { color: var(--text-2); font-size: .85rem; font-weight: 500; padding-left: .25rem; }

/* Frais lignes */
.order-edit-fee {
  display: grid;
  grid-template-columns: 110px 1fr 130px 28px;
  gap: .4rem;
  align-items: center;
  margin-bottom: .5rem;
}
.order-edit-fee select, .order-edit-fee input {
  padding: .5rem .65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
}

/* Récap commande */
.order-recap {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 1rem 0;
}
.recap-row {
  display: flex; justify-content: space-between;
  font-size: .9rem;
  padding: .25rem 0;
  color: var(--text-2);
}
.recap-total {
  border-top: 1px solid var(--border-strong);
  margin-top: .35rem;
  padding-top: .55rem;
  font-size: 1rem;
}
.recap-pos strong { color: var(--green, #16a34a); }
.recap-neg strong { color: var(--red, #dc2626); }

/* ─── Pick order / new customer ─── */
.pick-order-item {
  width: 100%;
  text-align: left;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: .5rem;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}
.pick-order-item:hover { border-color: var(--rose); background: var(--rose-light); }
.pick-order-name { font-weight: 500; font-size: .95rem; margin-bottom: .2rem; }
.pick-order-meta { font-size: .8rem; color: var(--text-3); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ─── Dashboard ─── */
.period-select {
  padding: .55rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.1rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--border);
}
.kpi-ca { border-left-color: var(--rose); }
.kpi-cost { border-left-color: #f59e0b; }
.kpi-margin-pos { border-left-color: #16a34a; }
.kpi-margin-neg { border-left-color: #dc2626; }
.kpi-label {
  font-size: .7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .35rem;
}
.kpi-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: .25rem;
}
.kpi-sub { font-size: .76rem; color: var(--text-2); }

.dash-alert {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #78350f;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
}

/* ─── Modal "Choisir un produit" ─── */
.pick-product-search {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  margin-bottom: .75rem;
}
.pick-product-search:focus { outline: none; border-color: var(--rose); }
.pick-product-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .65rem;
  align-items: center;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .65rem;
  margin-bottom: .4rem;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.pick-product-item:hover { background: var(--rose-light); border-color: var(--rose); }
.pick-product-item.active { background: var(--rose-light); border-color: var(--rose-dark); box-shadow: 0 0 0 2px var(--rose-light); }
.pick-product-item .ppi-photo {
  width: 48px; height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.pick-product-item .ppi-photo img { width: 100%; height: 100%; object-fit: cover; }
.pick-product-item .ppi-noimg { color: var(--text-3); font-size: 1.2rem; }
.pick-product-item .ppi-name { font-weight: 500; font-size: .9rem; line-height: 1.2; }
.pick-product-item .ppi-meta { font-size: .72rem; color: var(--text-3); margin-top: .15rem; }

.pick-product-divider {
  border-top: 1px dashed var(--border);
  margin: 1rem 0 .85rem;
}
.ppo-section { margin-bottom: .85rem; }
.ppo-label {
  font-size: .7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
  font-weight: 600;
}
.ppo-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.ppo-pill {
  padding: .45rem .85rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
}
.ppo-pill:hover { border-color: var(--text-2); }
.ppo-pill.active { background: var(--rose-light); border-color: var(--rose-dark); color: var(--rose-dark); font-weight: 600; }

.ppo-colors { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .35rem; }
.ppc-swatch {
  width: 50px; height: 50px;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
}
.ppc-swatch img, .ppc-fallback { width: 100%; height: 100%; object-fit: cover; display: block; }
.ppc-swatch:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.ppc-swatch.active { border-color: var(--rose-dark); box-shadow: 0 0 0 2px var(--rose-light); }
.ppc-selected-name { font-size: .82rem; color: var(--text-2); }

/* ─── Historique commercial dans la modal Produit ─── */
.product-history {
  background: linear-gradient(135deg, #faf7f4, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: 1.25rem;
}
.product-history-loading {
  color: var(--text-3);
  font-size: .85rem;
  padding: .5rem 0;
}
.product-history .ph-title {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  margin-bottom: .65rem;
}
.product-history .ph-empty {
  font-size: .85rem;
  color: var(--text-3);
  font-style: italic;
  padding: .15rem 0;
}
.product-history .ph-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .55rem .9rem;
}
.product-history .ph-stats > div {
  font-size: .85rem;
}
.product-history .ph-label {
  display: block;
  color: var(--text-3);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .15rem;
}
.product-history strong {
  display: inline-block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.product-history .ph-pos strong { color: #16a34a; }
.product-history .ph-neg strong { color: #dc2626; }
@media (max-width: 540px) {
  .product-history .ph-stats { grid-template-columns: 1fr 1fr; }
}

/* ─── Section Maintenance Dashboard ─── */
.dash-maintenance {
  border-top: 1px dashed var(--border);
  padding-top: 1.5rem;
  margin-top: 2rem;
}
.dm-desc { font-size: .82rem; color: var(--text-2); line-height: 1.5; margin: .25rem 0 .85rem; max-width: 600px; }
#cleanup-result { margin-top: .85rem; }
.cleanup-ok { background: #d1fae5; color: #065f46; padding: .65rem .9rem; border-radius: var(--radius); font-size: .9rem; }
.cleanup-warning { background: #fef3c7; color: #78350f; padding: .85rem 1rem; border-radius: var(--radius); font-size: .88rem; }
.cleanup-warning ul { margin: .55rem 0; padding-left: 1.25rem; font-family: 'SF Mono', Menlo, monospace; font-size: .75rem; }
.cleanup-error { background: #fee2e2; color: #991b1b; padding: .65rem .9rem; border-radius: var(--radius); font-size: .9rem; }

/* ─── Toast admin : notification de nouvelle commande ─── */
.toast-admin {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-200%);
  background: var(--rose-dark, #be185d);
  color: #fff;
  padding: .85rem 1.3rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  z-index: 99999;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  transition: transform .35s cubic-bezier(.22, .8, .25, 1);
  max-width: 92vw;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-admin.show { transform: translateX(-50%) translateY(0); }
@media (max-width: 540px) {
  .toast-admin { font-size: .85rem; padding: .75rem 1rem; max-width: 95vw; }
}

/* ── Onglet Stats ────────────────────────────────────── */
.stats-period-select {
  padding: .5rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: inherit;
  font-size: .88rem;
  color: var(--text);
  cursor: pointer;
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stats-kpi {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
.stats-kpi-label {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  margin-bottom: .35rem;
}
.stats-kpi-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--rose-dark);
  line-height: 1.1;
}
.stats-kpi-sub { font-size: .72rem; color: var(--text-3); margin-top: .25rem; }
.stats-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.stats-section h2 {
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin: 0 0 .75rem;
}
.stats-chart-wrap {
  position: relative;
  height: 260px;  /* hauteur fixe pour Chart.js responsive */
  width: 100%;
}

/* ── Top produits vus ── */
.stats-top-row {
  display: grid;
  grid-template-columns: 28px 1fr 80px 80px;
  gap: .65rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.stats-top-row:last-child { border-bottom: 0; }
.stats-top-rank {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rose-dark);
  text-align: center;
}
.stats-top-name { min-width: 0; }
.stats-top-name-main {
  font-size: .92rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stats-top-cat {
  font-size: .7rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
  margin-top: .15rem;
}
.stats-top-bar-wrap {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.stats-top-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rose) 0%, var(--rose-dark) 100%);
  border-radius: 4px;
  transition: width .4s ease;
}
.stats-top-count {
  text-align: right;
  font-size: .82rem;
  line-height: 1.2;
}
.stats-top-count strong { font-size: 1rem; color: var(--text); font-weight: 600; }
.stats-top-count span { display: block; color: var(--text-3); font-size: .7rem; }
@media (max-width: 480px) {
  .stats-top-row { grid-template-columns: 22px 1fr 60px; gap: .4rem; }
  .stats-top-bar-wrap { display: none; }  /* on cache la barre sur très petit écran */
}

/* ── Funnel de conversion ── */
.stats-funnel {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.stats-funnel-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .25rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.stats-funnel-row:last-child { border-bottom: 0; }
.stats-funnel-label {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
}
.stats-funnel-bar-wrap {
  position: relative;
  height: 24px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.stats-funnel-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.stats-funnel-count {
  position: absolute;
  top: 50%; left: .55rem;
  transform: translateY(-50%);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 0 4px var(--surface);
}
.stats-funnel-pct {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .7rem;
  color: var(--text-3);
}
.stats-funnel-conv { color: var(--rose-dark); font-weight: 500; }
.stats-funnel-total { color: var(--text-3); }

/* ── Sources de trafic ── */
.stats-sources { display: flex; flex-direction: column; gap: .55rem; }
.stats-source-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  gap: .65rem;
  align-items: center;
}
.stats-source-label {
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
}
.stats-source-bar-wrap {
  height: 16px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.stats-source-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.stats-source-count {
  text-align: right;
  font-size: .82rem;
  line-height: 1.2;
}
.stats-source-count strong { font-weight: 600; color: var(--text); }
.stats-source-count span { display: block; font-size: .7rem; color: var(--text-3); }
@media (max-width: 480px) {
  .stats-source-row { grid-template-columns: 90px 1fr 50px; gap: .4rem; }
  .stats-source-label { font-size: .82rem; }
}

/* ── Pills appareils / langues ── */
.stats-pills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stats-pills-label {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  margin-bottom: .35rem;
}
.stats-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.stats-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .55rem;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: .78rem;
}
.stats-pill strong { color: var(--rose-dark); font-weight: 600; }
.stats-pill em { color: var(--text-3); font-style: normal; font-size: .7rem; }
@media (max-width: 480px) {
  .stats-pills-grid { grid-template-columns: 1fr; gap: .85rem; }
}

/* ── Zone dangereuse (reset stats) ── */
.stats-danger-zone {
  margin-top: 2rem;
  padding: 1.1rem 1.25rem;
  background: #fef2f2;
  border: 1px dashed #fecaca;
  border-radius: var(--radius-lg);
  text-align: center;
}
.stats-danger-zone h3 {
  margin: 0 0 .35rem;
  font-size: .92rem;
  font-weight: 600;
  color: #b91c1c;
  font-family: inherit;
}
.stats-danger-zone p {
  font-size: .8rem;
  color: var(--text-2);
  margin: 0 0 .85rem;
  line-height: 1.45;
}
.stats-danger-zone .btn-danger {
  width: auto;
  display: inline-flex;
  padding: .55rem 1.1rem;
  font-size: .85rem;
}

.dash-section { margin-top: 1.5rem; }
.dash-section h2 {
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin: 0 0 .75rem;
}
.top-products { display: flex; flex-direction: column; gap: .5rem; }
.top-product-row {
  background: var(--surface);
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.tpr-name { font-weight: 500; font-size: .95rem; margin-bottom: .25rem; }
.tpr-stats { font-size: .8rem; color: var(--text-2); }
.tpr-stats strong { color: var(--text); }

@media (max-width: 540px) {
  .kpis { grid-template-columns: 1fr; }
  .order-meta-row { grid-template-columns: 1fr; }
  .order-edit-item-grid { grid-template-columns: 1fr 1fr; }
  .order-edit-item-grid > div:first-child { grid-column: 1 / -1; max-width: 80px; }
  .order-edit-fee { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; gap: .35rem; }
  .order-edit-fee > select { grid-column: 1 / 2; }
  .order-edit-fee > input.off-label { grid-column: 1 / -1; }
  .order-edit-fee > .oei-input-eur { grid-column: 1 / 2; }
  .order-edit-fee > .oei-remove { grid-column: 2 / 3; justify-self: end; }
}

.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-header h1 { font-size: 1.5rem; margin: 0; }
.admin-list { display: flex; flex-direction: column; gap: .75rem; }
.admin-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 1rem;
  background: var(--surface);
  padding: .75rem;
  border-radius: var(--radius);
  align-items: center;
}
.admin-row-thumb {
  width: 60px; height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.admin-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-info h3 { font-family: 'Playfair Display', serif; font-size: 1rem; margin: 0 0 .15rem; font-weight: 500; }
.admin-row-info .meta { font-size: .78rem; color: var(--text-3); }
/* Prix mis en valeur — gras + plus gros + couleur de la marque */
.admin-row-info .meta-price {
  font-size: .98rem;
  font-weight: 700;
  color: var(--rose-dark);
  letter-spacing: .01em;
}
/* 2e ligne : badge stock + badge publication alignés sur le même axe */
.admin-row-info .meta-row-2 {
  margin-top: .3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.admin-row-info .meta .pub { color: var(--green); font-weight: 500; }
.admin-row-info .meta .unpub { color: var(--text-3); }
.admin-row-info .meta-row-2 .pub,
.admin-row-info .meta-row-2 .unpub { margin-left: 0; }
.admin-row-actions { display: flex; gap: .35rem; }
.admin-row-actions button {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background .2s;
}
.admin-row-actions button:hover { background: var(--surface-2); }
.admin-row-actions .danger:hover { background: var(--red-light); color: var(--red); }

/* Admin form modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  /* Block all touch gestures on overlay (pinch zoom, pan-through) */
  touch-action: none;
  overscroll-behavior: contain;
  /* Prevent text selection drag from feeling like dragging the modal */
  user-select: none;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: calc(100% - 2rem);
  max-width: 640px;
  max-height: calc(100vh - 2rem);
  margin: 1rem;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;          /* prevents internal leak; rounded corners stay clean */
  /* Restore selection inside the modal */
  user-select: auto;
  -webkit-user-select: auto;
}

.modal-header {
  flex: 0 0 auto;
  padding: 1.2rem 1.5rem .85rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.modal-header h2 {
  font-size: 1.3rem;
  margin: 0;
  line-height: 1.2;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  /* Allow vertical scrolling only — no pinch-zoom */
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.modal-footer {
  flex: 0 0 auto;
  display: flex; gap: .6rem;
  justify-content: flex-end;
  padding: .9rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  /* Subtle shadow when content scrolls behind */
  box-shadow: 0 -2px 6px rgba(0,0,0,.03);
}
.modal-footer .btn { width: auto; min-width: 100px; }

/* Body scroll lock when modal open */
body.modal-open {
  overflow: hidden;
  /* Prevent iOS rubber-band scroll-through */
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Mobile: full-screen modal */
@media (max-width: 540px) {
  .modal {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
  .modal-header { padding: 1rem 1.1rem .8rem; }
  .modal-body { padding: 1.1rem 1.1rem; }
  .modal-footer { padding: .75rem 1.1rem; }
  .modal-footer .btn { min-width: 0; flex: 1; }
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--rose); }
.field textarea { resize: vertical; min-height: 80px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 3 colonnes (6 photos = 2 lignes) */
  gap: .5rem;
  margin-top: .5rem;
}
.photo-slot {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-size: 1.4rem;
}
.photo-slot.has-img {
  border-style: solid;
  cursor: grab;
  /* Désactive le menu natif iOS Safari sur long-press (sinon il intercepte le drag) */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* L'image elle-même ne capture pas les events → le slot parent reçoit le drag */
  touch-action: none;
}
.photo-slot.has-img.sortable-chosen { cursor: grabbing; opacity: .85; transform: scale(1.06); transition: transform .15s, opacity .15s; z-index: 10; }
.photo-slot.has-img.sortable-ghost { opacity: .25; }
/* Le "ghost" qui suit le doigt pendant le drag iOS (forceFallback) */
.photo-slot-drag-ghost { opacity: .85 !important; transform: scale(1.06) !important; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 9999 !important; }
/* Petite icône "≡" en haut-gauche pour indiquer qu'on peut drag la photo */
.photo-drag-handle {
  position: absolute;
  top: 4px; left: 4px;
  width: 22px; height: 22px;
  background: rgba(42, 39, 37, .75);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 600;
  line-height: 1;
  pointer-events: none;   /* purement décoratif — le slot parent gère le drag */
  z-index: 2;
}
.photo-slot.has-img:hover .photo-remove { opacity: 1; }
/* Sur mobile (pas de hover), la croix de suppression reste toujours visible */
@media (hover: none) { .photo-slot.has-img .photo-remove { opacity: 1; } }
.photo-slot img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;  /* clics traversent vers le .photo-slot parent */
}
.photo-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(42, 39, 37, .85);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  opacity: 0;
  transition: opacity .2s;
}
.photo-slot.uploading::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,.7) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23c8847d" stroke-width="2"><circle cx="12" cy="12" r="10" opacity=".2"/><path d="M22 12a10 10 0 01-10 10" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="1s" repeatCount="indefinite"/></path></svg>') center no-repeat;
}

/* ── Colors editor (admin form) ───────────────────────── */
.colors-preview {
  display: flex; flex-wrap: wrap; gap: .4rem;
  align-items: center;
  min-height: 28px;
  padding: .5rem .65rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: .55rem;
}
.colors-preview-empty { font-size: .78rem; color: var(--text-3); font-style: italic; }
.color-dot-md {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.08);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.55) inset;
}
.color-row {
  display: grid;
  grid-template-columns: 44px 110px 1fr 36px 36px;
  gap: .45rem;
  align-items: center;
  margin-bottom: .5rem;
}
.color-row .color-picker {
  width: 44px; height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.color-row .color-hex,
.color-row .color-name {
  padding: .55rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
}
.color-row .color-hex { text-transform: uppercase; font-family: 'SF Mono', Menlo, monospace; font-size: .82rem; }
.color-row .color-hex:focus,
.color-row .color-name:focus { border-color: var(--rose); }
.color-pick-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: all .15s;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.color-pick-btn:hover { background: var(--rose-light); color: var(--rose-dark); }
/* ✕ couleur : isolé avec marge à gauche + teinte rouge pour signaler "danger" */
.color-remove {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 600;
  transition: all .15s;
  cursor: pointer;
  padding: 0;
  margin-left: .35rem;
}
.color-remove:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }
.color-remove:active { transform: scale(.92); }
/* Œil visibilité : un peu plus large pour que 🙈 (3 caractères Unicode) tienne sans rognage */
.color-hide-toggle {
  width: 48px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 0; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  transition: background .15s, transform .15s;
}
.color-hide-toggle:hover { background: var(--rose-light); }
.color-hide-toggle:active { transform: scale(.92); }
/* Etat "masquée" : carte grisée mais toujours utilisable côté admin */
.color-card.is-hidden { opacity: .55; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px); }
.color-card.is-hidden::before { content: '🙈 Masquée côté client'; display: block; font-size: .72rem; color: var(--text-3); font-weight: 500; text-align: center; padding: .35rem; background: var(--surface); border-radius: var(--radius); margin-bottom: .5rem; letter-spacing: .03em; }
.variant-row.is-hidden { opacity: .55; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px); }
.variant-row.is-hidden::before { content: '🙈 Masquée côté client'; display: block; font-size: .72rem; color: var(--text-3); font-weight: 500; text-align: center; padding: .25rem .5rem; background: var(--surface); border-radius: var(--radius); margin-bottom: .4rem; }
.variant-hide-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  border: 0; cursor: pointer; padding: 0;
  transition: background .15s;
}
.variant-hide-toggle:hover { background: var(--rose-light); }
@media (max-width: 540px) {
  .color-row { grid-template-columns: 36px 1fr 36px 36px; }
  .color-row .color-name { grid-column: 1 / -1; }
}

/* ── Colors as cards (admin) — chaque couleur a son propre encart photos ── */
.color-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  margin-bottom: .8rem;
}
/* Ligne du haut : 7 items compacts — picker, #hex (élastique), pipette, ↑, ↓, œil, ✕ */
.color-card-top {
  display: flex;
  flex-wrap: nowrap;
  gap: .35rem;
  align-items: center;
  margin-bottom: .5rem;
}
.color-card-top > * { flex-shrink: 0; }
/* L'input #hex prend toute la place restante, sans plafond → la croix est poussée pile à droite */
.color-card-top .color-hex { flex: 1 1 auto; min-width: 50px; }
.color-card-top .color-picker {
  width: 40px; height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.color-card-top .color-hex {
  padding: .55rem .35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: .72rem;
  text-transform: uppercase;
  text-align: center;
  outline: none;
  min-width: 0;
}
.color-card-top .color-hex:focus { border-color: var(--rose); }
/* Flèches ↑↓ pour réordonner les couleurs */
.color-up, .color-down {
  width: 30px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  border: 0; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 600;
  transition: background .15s;
}
.color-up:hover, .color-down:hover { background: var(--rose-light); color: var(--rose-dark); }
.color-up:active, .color-down:active { transform: scale(.92); }
/* Ligne du dessous : input nom (pleine largeur) */
.color-card-name-row {
  margin-bottom: .65rem;
}
.color-card-name-row .color-name {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  outline: none;
}
.color-card-name-row .color-name:focus { border-color: var(--rose); }
.color-price-row {
  margin: .25rem 0 .65rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.color-price-row label {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.color-price-input {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0 .75rem;
  max-width: 200px;
}
.color-price-input input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  background: transparent;
  padding: .55rem 0;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
}
.color-price-unit { color: var(--text-2); font-weight: 500; }
.color-photos-label {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .45rem;
  display: flex; justify-content: space-between; align-items: center;
}
.color-photos-count { color: var(--text-2); font-weight: 500; letter-spacing: 0; text-transform: none; }
.color-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
}
.color-photo-slot {
  aspect-ratio: 1;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--text-3);
  cursor: pointer; transition: all .15s;
  position: relative; overflow: hidden;
}
.color-photo-slot:hover { background: var(--rose-light); color: var(--rose-dark); border-color: var(--rose); }
.color-photo-slot.has-img {
  border: none; padding: 0;
  cursor: grab;
  /* Désactive le menu natif iOS sur long-press pour laisser SortableJS faire son boulot */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.color-photo-slot.has-img.sortable-chosen { cursor: grabbing; opacity: .8; transform: scale(1.05); transition: transform .15s, opacity .15s; }
.color-photo-slot.has-img.sortable-ghost { opacity: .3; }
.color-photo-slot.has-img:hover { background: var(--surface); }
.color-photo-slot.has-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.color-photo-remove {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px;
  background: rgba(0,0,0,.6); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .82rem;
}
.color-photo-remove:hover { background: var(--red); }
@media (max-width: 540px) {
  .color-card-top { grid-template-columns: 36px 1fr 36px 36px; }
  .color-card-top .color-name { grid-column: 1 / -1; }
  .color-photo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Color swatches (fiche produit public, style SHEIN) ── */
.product-color-name {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-left: .35rem;
}
.product-color-swatches {
  display: flex; flex-wrap: wrap; gap: .6rem;
}
.color-swatch {
  width: 72px; height: 72px;
  padding: 0;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.color-swatch img,
.color-swatch .color-swatch-fallback {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.color-swatch:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.color-swatch.active {
  border-color: var(--rose-dark);
  box-shadow: 0 0 0 3px var(--rose-light), 0 2px 8px rgba(0,0,0,.08);
}

/* ── Cart item color badge ── */
.cart-item-color {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  padding: .2rem .55rem;
  border-radius: 999px;
  margin-left: .4rem;
  vertical-align: middle;
}
.cart-item-color-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  display: inline-block;
}

/* ── EyeDropper / Color picker overlay (fallback Safari) */
.eyedropper-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, .94);
  z-index: 1000;
  display: flex; flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}
.eyedropper-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
  color: #fff;
  padding: 0 .5rem;
}
.eyedropper-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}
.eyedropper-cancel {
  padding: .5rem 1.25rem;
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.2);
  transition: background .2s;
}
.eyedropper-cancel:hover { background: rgba(255,255,255,.2); }
.eyedropper-gallery {
  display: flex; flex-direction: column; gap: 1rem;
  max-width: 900px; margin: 0 auto; width: 100%;
}
.eyedropper-canvas {
  width: 100%; height: auto;
  border-radius: var(--radius);
  cursor: crosshair;
  background: var(--surface-2);
  display: block;
}
.eyedropper-error {
  background: var(--red-light);
  color: var(--red);
  padding: .85rem;
  border-radius: var(--radius);
  font-size: .85rem;
  text-align: center;
}

/* ── Variants editor (admin form) ─────────────────────── */
.variant-row {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: .6rem;
  padding: .65rem .7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background .2s, opacity .2s;
}
.variant-row-top {
  display: grid;
  /* 5 colonnes : nom (flex) · œil · ↑ · ↓ · ✕ */
  grid-template-columns: 1fr 36px 28px 28px 32px;
  gap: .35rem;
  align-items: center;
}
.variant-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .4rem;
}
.variant-row input {
  padding: .55rem .65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s;
  min-width: 0;
}
.variant-row input:focus { border-color: var(--rose); }
.variant-row .variant-sku { font-family: 'SF Mono', Menlo, monospace; font-size: .78rem; color: var(--text-2); }
.variant-up, .variant-down {
  width: 28px; height: 36px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all .15s;
}
.variant-up:hover, .variant-down:hover { background: var(--rose-light); color: var(--rose-dark); }
/* ✕ isolé visuellement (marge à gauche + teinte rouge subtile) pour éviter les clics accidentels */
.variant-remove {
  width: 32px; height: 36px;
  border-radius: var(--radius);
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 600;
  transition: all .2s;
  margin-left: .35rem;
  cursor: pointer;
}
.variant-remove:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }
.variant-remove:active { transform: scale(.92); }

.variants-summary-row {
  font-size: .8rem;
  color: var(--text-2);
  margin-top: .4rem;
  padding: .55rem .85rem;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.variants-summary { font-weight: 500; color: var(--text); }

/* Le layout en carte fonctionne déjà sur mobile (flex column),
   pas besoin de media query spécifique pour la grille variante */

.toggle-row {
  display: flex; align-items: center; gap: .75rem;
  background: var(--surface-2);
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--rose);
  cursor: pointer;
  margin: 0;
}
.toggle-row span { font-size: .9rem; color: var(--text); font-weight: 500; }
.toggle-row .hint { font-size: .75rem; color: var(--text-3); font-weight: 400; display: block; margin-top: 2px; }

.modal-actions {
  display: flex; gap: .6rem; justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.modal-actions .btn { width: auto; min-width: 100px; }

/* Login screen */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 70vh;
  padding: 2rem 1rem;
}
.login-box {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-md);
}
.login-box h1 {
  font-size: 1.5rem;
  margin: 0 0 .35rem;
  text-align: center;
}
.login-box .subtitle {
  text-align: center;
  font-size: .85rem;
  color: var(--text-2);
  margin: 0 0 1.5rem;
}
.error-msg {
  background: var(--red-light);
  color: var(--red);
  padding: .65rem .85rem;
  border-radius: var(--radius);
  font-size: .82rem;
  margin-bottom: 1rem;
  display: none;
}
.error-msg.show { display: block; }

/* ── Mobile tweaks ────────────────────────────────────── */
@media (max-width: 540px) {
  .container { padding: 1rem 1rem 3rem; }
  .header-inner { padding: .75rem 1rem; }
  .header-actions { gap: .35rem; }

  /* Fiche produit : on tasse pour que les couleurs rentrent au-dessus de la pliure */
  .product { gap: .85rem; }
  .gallery { gap: .5rem; }
  .gallery-main { aspect-ratio: 16 / 10; }  /* moins haute sur mobile */
  .product-info { padding: 0; }
  .product-cat { margin-bottom: .35rem; }
  .product-title { font-size: 1.55rem; margin: 0 0 .4rem; line-height: 1.1; }
  .product-stock-badge { margin: 0 0 .55rem; padding: .35rem .75rem; font-size: .72rem; }
  .product-price { font-size: 1.45rem; margin-bottom: .7rem; }
  .product-dims { font-size: 1.05rem; padding: .55rem 0; margin-bottom: .7rem; }
  .variant-selector { margin: 0 0 .75rem; }
  .product-colors { margin: 0 0 .8rem; }
  .product-colors-label { margin-bottom: .4rem; }
  .gallery-thumb { width: 56px; height: 56px; }
  .color-swatch { width: 64px; height: 64px; }

  /* Catalogue / panier / forms (inchangés sauf miniatures plus petites) */
  .grid { gap: .85rem; }
  .card-body { padding: .75rem .75rem 1rem; }
  .card-name { font-size: .95rem; }
  .card-price { font-size: .92rem; }
  .cart-item { grid-template-columns: 64px 1fr auto; padding: .75rem; }
  .cart-item-img { width: 64px; height: 64px; }
  .form-row { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .cart-link span:nth-child(2) { display: none; }
  .brand-name { font-size: .95rem; }
}

/* ── Lightbox (visionneuse plein écran fiche produit) ──── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15, 12, 10, .96);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  touch-action: none;  /* on capture les swipes via JS */
  animation: lb-fade .15s ease-out;
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  overflow: hidden;
  position: relative;
}
.lightbox-track {
  display: flex;
  width: 100%; height: 100%;
  transition: transform .35s cubic-bezier(.22, .8, .25, 1);
  will-change: transform;
}
.lightbox-img {
  flex: 0 0 100%;
  width: 100%; height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
  z-index: 10;
  border: none;
  font-family: inherit;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,.28); }
.lightbox-close {
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + .75rem));
  left: 50%; transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,.45);
  padding: .35rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .02em;
}
@media (max-width: 540px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.3rem; }
}

/* ── WhatsApp widget : FAB + pop-up de bienvenue ─────── */
.wa-fab {
  position: fixed;
  /* WhatsApp est EN HAUT du Message FAB (qui fait 44px + 10px gap) */
  bottom: calc(1.25rem + 54px + env(safe-area-inset-bottom));
  right: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.42), 0 2px 6px rgba(0,0,0,0.12);
  z-index: 90;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  transition: transform .15s ease, box-shadow .2s ease;
  animation: waPulse 3.4s ease-out 4s infinite;
}
.wa-fab svg { width: 25px; height: 25px; fill: #fff; }
.wa-fab:active { transform: scale(.94); }
@media (hover: hover) {
  .wa-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.55), 0 2px 6px rgba(0,0,0,0.14);
    animation-play-state: paused;
  }
}
@keyframes waPulse {
  0%   { box-shadow: 0 6px 18px rgba(37, 211, 102, 0.42), 0 0 0 0 rgba(37, 211, 102, 0.55); }
  35%  { box-shadow: 0 6px 18px rgba(37, 211, 102, 0.42), 0 0 0 18px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 6px 18px rgba(37, 211, 102, 0.42), 0 0 0 0 rgba(37, 211, 102, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab { animation: none; }
}

.wa-welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  backdrop-filter: blur(2px);
}
.wa-welcome-overlay.show { opacity: 1; pointer-events: auto; }

.wa-welcome-card {
  background: #fff;
  border-radius: 22px;
  padding: 1.85rem 1.5rem 1.6rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  transform: translateY(28px);
  transition: transform .35s cubic-bezier(0.2, 0.85, 0.3, 1.05);
  position: relative;
  text-align: center;
}
.wa-welcome-overlay.show .wa-welcome-card { transform: translateY(0); }

.wa-welcome-close {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  font-size: 1.15rem;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, color .15s ease;
}
.wa-welcome-close:hover, .wa-welcome-close:active {
  background: var(--border);
  color: var(--text);
}

.wa-welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25D366;
  margin: .25rem auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}
.wa-welcome-icon svg { width: 36px; height: 36px; fill: #fff; }

.wa-welcome-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 .55rem;
  color: var(--text);
  line-height: 1.3;
}
.wa-welcome-card p {
  color: var(--text-2);
  font-size: .95rem;
  margin: 0 0 1.35rem;
  line-height: 1.55;
}

.wa-welcome-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  background: #25D366;
  color: #fff;
  border: none;
  padding: .95rem 1.25rem;
  border-radius: 14px;
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, transform .1s ease;
  letter-spacing: .01em;
}
.wa-welcome-cta svg { width: 22px; height: 22px; fill: #fff; }
.wa-welcome-cta:active { transform: scale(.97); }
@media (hover: hover) {
  .wa-welcome-cta:hover { background: #1eba56; }
}

/* ── WhatsApp popup : lien secondaire vers formulaire ── */
.wa-form-link {
  display: block;
  margin: .9rem auto 0;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: .9rem;
  text-decoration: underline;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .4rem .5rem;
}
.wa-form-link:hover, .wa-form-link:active { color: var(--text); }

/* ── Pop-up : vue formulaire ──────────────────────────── */
.wa-card-form {
  text-align: left;
  padding-top: 2.2rem;
}
.wa-form-back {
  position: absolute;
  top: .65rem;
  left: .85rem;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: .9rem;
  cursor: pointer;
  padding: .35rem .25rem;
  -webkit-tap-highlight-color: transparent;
}
.wa-form-back:hover, .wa-form-back:active { color: var(--text); }
.wa-card-form h3 {
  text-align: center;
  margin-bottom: .35rem;
}
.wa-form-sub {
  text-align: center;
  margin-bottom: 1.15rem;
}
.wa-form { display: flex; flex-direction: column; gap: .75rem; }
.wa-field { display: flex; flex-direction: column; gap: .3rem; }
.wa-field > span {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}
.wa-field input,
.wa-field textarea {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: .7rem .85rem;
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wa-field input:focus,
.wa-field textarea:focus {
  outline: none;
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .15);
}
.wa-field textarea { min-height: 100px; }
.wa-turnstile { margin: .25rem 0; min-height: 0; }
.wa-turnstile:empty { display: none; }
.wa-form-err {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: .55rem .75rem;
  font-size: .85rem;
}
.wa-form-submit { margin-top: .35rem; }
.wa-form-submit:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* ── Pop-up : vue succès ──────────────────────────────── */
.wa-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  margin: .25rem auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}

/* ── 2e FAB : bouton "Nous écrire un message" (EN BAS, sous le WhatsApp) */
.wa-fab-msg {
  position: fixed;
  /* En bas, sous le WhatsApp (qui s'empile au-dessus) */
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #1f1c1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 90;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  transition: transform .15s ease, box-shadow .2s ease, background .15s ease;
}
.wa-fab-msg svg { width: 22px; height: 22px; fill: #fff; }
.wa-fab-msg:active { transform: scale(.94); }
@media (hover: hover) {
  .wa-fab-msg:hover {
    transform: scale(1.06);
    background: #2a2725;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  }
}
