/* Pamerio — site public. Léger, sans police externe, pensé pour mobile. */
:root {
  --violet: #7928ca;
  --violet-2: #a855f7;
  --violet-soft: #f5eefc;
  --bg: #edeef2;
  --card: #fff;
  --text: #20202a;
  --muted: #85858f;
  --field: #f1f2f5;
  --line: #dadce2;
  --yellow: #ffca18;
  --green: #16a34a;
  --red: #c62828;
  --radius: 18px;
  --bar-h: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
main { max-width: 640px; margin: 0 auto; min-height: 100vh; padding: 16px 16px calc(var(--bar-h) + 24px); }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
h1, h2, h3, p { margin: 0; }

.loading, .notice { text-align: center; padding: 64px 16px; color: var(--muted); }
.spinner {
  width: 32px; height: 32px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--violet);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* En-tête de la boutique */
.shop-head {
  display: flex; gap: 14px; align-items: center;
  background: var(--card); border-radius: 24px; padding: 14px;
}
.shop-logo {
  width: 72px; height: 72px; flex: none; border-radius: 20px; object-fit: cover;
  background: var(--violet-soft); color: var(--violet);
  display: grid; place-items: center; font-weight: 800; font-size: 26px;
}
.shop-head h1 { font-size: 19px; line-height: 1.2; }
.shop-head p { color: var(--muted); font-size: 14px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Bandeau « en direct » (LiveXpress) */
.live-banner {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  background: var(--violet); color: #fff; border-radius: 16px; padding: 10px 12px;
}
.live-banner .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; flex: none; }
.live-banner span { flex: 1; font-weight: 600; font-size: 14px; }
.live-banner button { background: #fff; color: var(--violet); border-radius: 12px; padding: 8px 12px; font-weight: 700; }

/* Grille des produits */
.section-title { margin: 18px 4px 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; }
.card .photo {
  aspect-ratio: 1 / 1; width: 100%; border-radius: 14px; overflow: hidden;
  background: var(--violet-soft); display: grid; place-items: center; color: var(--violet-2);
}
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 14px; font-weight: 700; margin: 8px 2px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .price { font-weight: 800; font-size: 14px; margin: 0 2px 8px; }
.card .actions { margin-top: auto; display: grid; gap: 6px; }
.btn {
  display: block; width: 100%; border-radius: 12px; padding: 10px 8px;
  font-weight: 700; font-size: 14px; text-align: center;
}
.btn-grey { background: var(--field); color: var(--text); }
.btn-violet { background: var(--violet); color: #fff; }
.btn-big { padding: 15px; font-size: 16px; border-radius: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.empty { text-align: center; color: var(--muted); padding: 32px 8px; }

/* Barre du bas : recherche + panier */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(237, 238, 242, .96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bottom-bar .inner { max-width: 608px; margin: 0 auto; display: flex; gap: 10px; }
.bottom-bar input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff;
  border-radius: 14px; padding: 12px 14px; outline: none;
}
.bottom-bar input:focus { border-color: var(--violet); }
.cart-btn { position: relative; background: var(--violet); color: #fff; border-radius: 14px; padding: 0 18px; font-weight: 700; }
.cart-btn .count {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--yellow); color: var(--text); font-size: 12px;
  display: grid; place-items: center;
}

/* Détail produit */
.back { background: none; color: var(--violet); font-weight: 700; padding: 4px 0 12px; }
.gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 22px; }
.gallery img { flex: none; width: 88%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 22px; scroll-snap-align: start; background: var(--violet-soft); }
.product-info { background: var(--card); border-radius: 22px; padding: 16px; margin-top: 12px; }
.product-info h1 { font-size: 20px; }
.product-info .price { font-size: 20px; font-weight: 800; color: var(--violet); margin: 6px 0 10px; }
.product-info .desc { color: var(--muted); white-space: pre-line; }

/* Quantité */
.qty { display: inline-flex; align-items: center; gap: 4px; background: var(--field); border-radius: 12px; }
.qty button { width: 36px; height: 36px; background: none; font-size: 20px; font-weight: 700; color: var(--violet); }
.qty span { min-width: 24px; text-align: center; font-weight: 700; }

/* Fenêtres (pop-up LiveXpress, panier, formulaire) */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(20, 20, 30, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 24px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { font-size: 18px; }
.close { background: var(--field); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }

/* Encadré de l'article LiveXpress : numéro et prix non modifiables */
.live-box { background: var(--violet); color: #fff; border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; }
.live-box .label { font-size: 12px; opacity: .8; display: flex; align-items: center; gap: 6px; }
.live-box .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; }
.live-box .num { font-size: 18px; font-weight: 700; }
.live-box .amount { font-size: 22px; font-weight: 800; }

/* Récapitulatif (produit seul ou panier) */
.summary { background: var(--violet-soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; }
.summary .line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.summary .total { font-weight: 800; margin-top: 6px; padding-top: 6px; border-top: 1px solid #e3d3f6; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--field); }
.cart-line img, .cart-line .ph { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--violet-soft); flex: none; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.cart-line .info small { color: var(--muted); }

/* Formulaire */
.form { display: grid; gap: 10px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px 4px; }
.field input, .field textarea {
  width: 100%; border: 1px solid transparent; background: var(--field);
  border-radius: 14px; padding: 13px 14px; outline: none; font-size: 16px;
}
.field input:focus, .field textarea:focus { border-color: var(--violet); background: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gps { display: flex; align-items: center; gap: 10px; }
.gps button { background: var(--violet-soft); color: var(--violet); border-radius: 12px; padding: 11px 12px; font-weight: 700; white-space: nowrap; }
.gps small { color: var(--muted); }
.gps small.ok { color: var(--green); font-weight: 600; }
.pay { display: grid; gap: 8px; }
.pay label {
  display: flex; align-items: center; gap: 10px; border: 2px solid var(--field);
  border-radius: 14px; padding: 12px; font-weight: 600;
}
.pay label.on { border-color: var(--violet); background: var(--violet-soft); }
.pay label.off { color: var(--muted); }
.pay label small { margin-left: auto; font-weight: 500; font-size: 12px; }
.pay input { accent-color: var(--violet); width: 18px; height: 18px; margin: 0; }
.error { color: var(--red); font-size: 14px; font-weight: 600; }
.captcha { min-height: 0; }

/* Confirmation */
.done { text-align: center; padding: 8px 4px; }
.done .check {
  width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%;
  background: #c8f0d4; color: var(--green); display: grid; place-items: center; font-size: 34px; font-weight: 800;
}
.done h2 { font-size: 20px; }
.done p { color: var(--muted); margin: 6px 0 16px; }
.done .ref { color: var(--text); font-weight: 800; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px); transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 30;
  font-size: 14px; max-width: 90vw;
}

/* Petites classes utilitaires (pas de style en ligne : la CSP l'interdit) */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; flex: none; }
.lead { margin: 4px 0 14px; }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; }
.stack { display: grid; gap: 8px; }
.title { color: var(--violet); margin-bottom: 8px; }
.cart-total { margin-top: 14px; font-weight: 800; }
.cart-total + .btn { margin-top: 4px; }
.retry { max-width: 220px; margin: 16px auto 0; }

/* Correctifs d'affichage */
.card .photo { position: relative; }
.card .photo img { position: absolute; inset: 0; }
.cart-btn .count[hidden] { display: none; }
