/* vitrine.css — habillage des emplacements remplis par vitrine.js
   (facileapp.org/vitrine/). Voir docs/chantier-vitrine.md, section 4.

   Tout passe par des VARIABLES : chaque site peut les surcharger dans sa
   propre feuille, par exemple
     :root { --vt-accent:#FFC000; --vt-on-accent:#3a2a00; }
   Des préréglages par site sont posés plus bas (attribut data-vitrine-site,
   posé par le script sur <html>). Mobile d'abord : une colonne, puis la
   grille s'élargit d'elle-même. */

:root {
  --vt-accent: #002060;
  --vt-on-accent: #ffffff;
  --vt-accent-2: #FFBD00;
  --vt-ink: #12141b;
  --vt-heading: inherit;
  --vt-muted: #5a6273;
  --vt-surface: #ffffff;
  --vt-soft: #f5f7fb;
  --vt-line: #e5e8f0;
  --vt-wa: #1a8f4c;          /* vert WhatsApp assombri : contraste AA sur blanc */
  --vt-on-wa: #ffffff;
  --vt-radius: 16px;
  --vt-shadow: 0 10px 30px -16px rgba(16, 24, 40, .28);
  --vt-gap: 16px;
}

/* Préréglages par site (surchargeables). */
[data-vitrine-site="fflexyprinter"], [data-vitrine-site="fflexypos"] {
  --vt-accent: #E6A200; --vt-on-accent: #2a1e00; --vt-accent-2: #0f1117;
}
[data-vitrine-site="fflexypos"] { --vt-accent: #F2A900; }
[data-vitrine-site="sfav"] { --vt-accent: #002060; --vt-accent-2: #F97316; }
[data-vitrine-site="facileapp"] { --vt-accent: #0b4fd6; }
[data-vitrine-site="fchat"] { --vt-accent: #E4322B; }

/* Mode sombre : celui du site (data-theme) d'abord, sinon celui du système. */
[data-theme="dark"] {
  --vt-ink: #e9ebf2; --vt-muted: #9aa2b4; --vt-surface: #151a27;
  --vt-soft: #10141f; --vt-line: #283048; --vt-wa: #25a35a;
  --vt-shadow: 0 10px 30px -16px rgba(0, 0, 0, .7);
}
[data-theme="dark"][data-vitrine-site="groupeelako"],
[data-theme="dark"][data-vitrine-site="sfav"],
[data-theme="dark"]:not([data-vitrine-site]) { --vt-accent: #7aa2ff; --vt-on-accent: #0b0d14; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --vt-ink: #e9ebf2; --vt-muted: #9aa2b4; --vt-surface: #151a27;
    --vt-soft: #10141f; --vt-line: #283048; --vt-wa: #25a35a;
  }
}

.vt-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 340px));
  justify-content: center;
  gap: var(--vt-gap);
  margin: 0; padding: 0; list-style: none;
}
.vt-carte {
  background: var(--vt-surface);
  color: var(--vt-ink);
  border: 1px solid var(--vt-line);
  border-radius: var(--vt-radius);
  box-shadow: var(--vt-shadow);
  padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
  text-align: left;
}
.vt-carte h3, .vt-carte h4 {
  margin: 0; font-size: 1.08rem; line-height: 1.3; color: var(--vt-heading);
  overflow-wrap: anywhere;
}
.vt-ligne {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 0; font-size: .94rem; line-height: 1.45; color: var(--vt-ink);
  overflow-wrap: anywhere;
}
.vt-ligne svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--vt-muted); }
.vt-ligne a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.vt-ligne a:hover { color: var(--vt-accent); }
.vt-muet { color: var(--vt-muted); font-size: .88rem; }
.vt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }

.vt-btn {
  display: inline-flex; align-self: flex-start; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 9px 16px; border-radius: 999px;
  font-family: inherit; font-size: .93rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: filter .15s, transform .15s;
}
.vt-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.vt-btn:focus-visible, .vt-ligne a:focus-visible, .vt-produit a:focus-visible {
  outline: 3px solid var(--vt-accent); outline-offset: 2px;
}
.vt-btn svg { width: 17px; height: 17px; flex: none; }
.vt-btn-principal { background: var(--vt-accent); color: var(--vt-on-accent); }
.vt-btn-wa { background: var(--vt-wa); color: var(--vt-on-wa); }
.vt-btn-contour { background: transparent; color: var(--vt-ink); border-color: var(--vt-line); }

/* Produits */
.vt-produit { padding: 0; overflow: hidden; }
.vt-produit .vt-media {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--vt-soft);
  display: flex; align-items: center; justify-content: center;
}
.vt-produit .vt-media svg { width: 64px; height: 64px; color: var(--vt-muted); }
/* MÊME HAUTEUR POUR TOUTES LES CARTES : le format carré de la photo du
   Flexy POS (1280 x 1280). Une photo d'un autre format est recadrée, jamais
   étirée ; sans overflow, une photo en hauteur allongeait sa carte. */
.vt-produit .vt-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vt-produit .vt-corps { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vt-prix { font-size: 1.35rem; font-weight: 800; color: var(--vt-ink); letter-spacing: -.01em; }
.vt-prix small { font-size: .8rem; font-weight: 600; color: var(--vt-muted); }
.vt-pastille {
  display: inline-block; align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: var(--vt-soft); color: var(--vt-muted); border: 1px solid var(--vt-line);
}
.vt-pastille.vt-dispo { color: #157347; border-color: rgba(21, 115, 71, .3); background: rgba(21, 115, 71, .08); }
.vt-pastille.vt-rupture { color: #b42318; border-color: rgba(180, 35, 24, .3); background: rgba(180, 35, 24, .07); }
[data-theme="dark"] .vt-pastille.vt-dispo { color: #5fd49a; }
[data-theme="dark"] .vt-pastille.vt-rupture { color: #ff8a80; }

/* Tarifs */
.vt-tarif { align-items: flex-start; }
.vt-tarif.vt-vedette { border: 2px solid var(--vt-accent); }
.vt-montant { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--vt-ink); }
.vt-montant small { font-size: .9rem; font-weight: 600; color: var(--vt-muted); }
.vt-liste { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.vt-liste li { position: relative; padding-left: 22px; font-size: .93rem; line-height: 1.45; }
.vt-liste li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 10px; height: 6px;
  border-left: 2px solid var(--vt-accent); border-bottom: 2px solid var(--vt-accent);
  transform: rotate(-45deg);
}

/* Le numéro et l'e-mail insérés dans un texte ne cassent pas la ligne. */
[data-vitrine="whatsapp"]:not(a), [data-vitrine="tel"]:not(a) { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .vt-btn { transition: none; }
  .vt-btn:hover { transform: none; }
}

/* Listes compactes (pied de page) : l'icône suit la taille du texte. */
.vt-mini svg { width: 1em; height: 1em; vertical-align: -.12em; flex: none; }
.vt-mini b { margin-right: 4px; }

/* Le cercle de chargement des produits, au bleu du Groupe ELAKO. */
.vt-chargeur { width: 44px; height: 44px; margin: 24px auto 12px; border-radius: 50%;
  border: 4px solid rgba(0, 32, 96, .15); border-top-color: #13348f; animation: vt-tourne .8s linear infinite; }
@keyframes vt-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vt-chargeur { animation-duration: 2.4s; } }

/* La promotion : remise sur la photo, ancien prix barré, urgence discrète. */
.vt-badge-promo { position: absolute; top: 10px; left: 10px; z-index: 1; background: #e4322b; color: #fff;
  font-weight: 800; font-size: .8rem; padding: 4px 9px; border-radius: 999px; }
.vt-prix-avant { color: var(--vt-muted); font-weight: 500; font-size: .75em; }
.vt-urgence { margin: 0; font-size: .82rem; color: #e4572e; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.vt-urgence b { font-weight: 800; }
.vt-compte { font-variant-numeric: tabular-nums; }

/* Le bouton de commande des cartes : une icône panier sur fond bleu, sans texte. */
.vt-btn.vt-btn-commande { width: 100%; align-self: stretch; justify-content: center; background: #1546b8; color: #fff; border-color: transparent; min-height: 44px; }
.vt-btn.vt-btn-commande svg { width: 22px; height: 22px; }
