/* =========================================================
   Plaque BAL – configurateur
   Tout est scopé sous .pbal : aucun effet sur le reste du site.
   Pour adapter à la charte du site, modifier les variables ci-dessous.
   ========================================================= */

.pbal {
  --pbal-accent: #1d4ed8;        /* couleur principale (bouton, sélection) */
  --pbal-accent-hover: #1e40af;
  --pbal-ink: #16181d;           /* texte */
  --pbal-muted: #5d6470;         /* texte secondaire */
  --pbal-line: #dfe3e8;          /* bordures */
  --pbal-surface: #ffffff;       /* fond des cartes */
  --pbal-soft: #f5f7f9;          /* fond doux */
  --pbal-danger: #b42318;
  --pbal-radius: 14px;
  --pbal-gap: 20px;

  width: 100%;
  color: var(--pbal-ink);
  font-size: 16px;
  line-height: 1.5;
  max-width: 1180px;
  margin: 0 auto;
}

.pbal *,
.pbal *::before,
.pbal *::after { box-sizing: border-box; }

.pbal [hidden] { display: none !important; }

.pbal :where(p, ul, h1, h2, h3) { margin: 0; }

/* ---------------------------------------------------------
   En-tête (layout complet)
   --------------------------------------------------------- */
.pbal-head { text-align: center; padding: 8px 0 28px; }
.pbal-kicker {
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--pbal-accent); font-weight: 600; margin-bottom: 10px;
}
.pbal-title {
  font-size: clamp(26px, 4.2vw, 40px); line-height: 1.15; font-weight: 750;
  letter-spacing: -.01em; margin-bottom: 10px; color: var(--pbal-ink);
}
.pbal-subtitle { color: var(--pbal-muted); font-size: 17px; }
.pbal-badges {
  list-style: none; padding: 0; margin-top: 18px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.pbal-badges li {
  font-size: 14px; padding: 6px 12px 6px 30px; border-radius: 999px;
  background: var(--pbal-soft); border: 1px solid var(--pbal-line); position: relative;
}
.pbal-badges li::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 12px; height: 7px;
  border-left: 2px solid #15803d; border-bottom: 2px solid #15803d;
  transform: translateY(-70%) rotate(-45deg);
}

/* ---------------------------------------------------------
   Grille et cartes
   --------------------------------------------------------- */
.pbal-grid { display: grid; gap: var(--pbal-gap); }
@media (min-width: 960px) {
  .pbal--full .pbal-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
  .pbal--full .pbal-sell { position: sticky; top: 24px; }
}

.pbal-card {
  background: var(--pbal-surface);
  border: 1px solid var(--pbal-line);
  border-radius: var(--pbal-radius);
  padding: clamp(16px, 2.5vw, 28px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}
.pbal--compact .pbal-card { padding: 0; border: 0; box-shadow: none; background: none; }
.pbal-card--soft { background: var(--pbal-soft); box-shadow: none; }

.pbal-card-top {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.pbal-h2 { font-size: 21px; font-weight: 700; color: var(--pbal-ink); }
.pbal-h3 { font-size: 18px; font-weight: 700; margin-bottom: 14px; color: var(--pbal-ink); }
.pbal-price { text-align: right; margin-left: auto; }
.pbal-price-big { display: block; font-size: 30px; font-weight: 800; line-height: 1; color: var(--pbal-ink); }
.pbal-price-big .woocommerce-Price-amount { font-weight: inherit; }
.pbal-price-sub { font-size: 13px; color: var(--pbal-muted); }

/* ---------------------------------------------------------
   Aperçu de la plaque
   --------------------------------------------------------- */
.pbal-preview-wrap { margin-bottom: 22px; }
.pbal-stage {
  /* Façade de boîte aux lettres stylisée */
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.75), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #e7eaee, #d3d8de);
  border-radius: calc(var(--pbal-radius) - 4px);
  padding: clamp(22px, 5vw, 48px) clamp(12px, 3vw, 36px);
  display: flex; align-items: center; justify-content: center;
  min-height: clamp(140px, 22vw, 230px);
}
.pbal-plate {
  --pbal-bg: #111;
  --pbal-fg: #fff;
  --pbal-fs: 24px;
  position: relative;
  width: calc(var(--pbal-w, 100) / var(--pbal-wmax, 120) * 100%);
  aspect-ratio: var(--pbal-w, 100) / var(--pbal-h, 25);
  background: var(--pbal-bg);
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -1px 0 rgba(0,0,0,.25),
    0 1px 1px rgba(0,0,0,.18),
    0 6px 14px rgba(0,0,0,.18);
  transition: width .25s ease, border-radius .2s ease;
}
.pbal-plate.is-rounded { border-radius: min(14%, 12px); }

/* Finitions spéciales */
.pbal .pbal-plate[data-finish="metal"],
.pbal .pbal-finish-metal {
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0) 30%, rgba(0,0,0,.22) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.14) 0 1px, rgba(0,0,0,.10) 1px 2px),
    linear-gradient(90deg, #bfbfbf, #ffffff 20%, #dcdcdc 45%, #ffffff 70%, #bfbfbf);
}
.pbal .pbal-plate[data-finish="gold"],
.pbal .pbal-finish-gold {
  background:
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 35%, rgba(0,0,0,.18) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.10) 0 1px, rgba(0,0,0,.08) 1px 2px),
    linear-gradient(90deg, #b8923c, #f1d27a 22%, #c9a24c 48%, #f3d98a 72%, #b8923c);
}

.pbal-plate-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .12em;
  font-family: var(--pbal-font, Arial, sans-serif);
  font-size: var(--pbal-fs);
  line-height: 1.12;
  color: var(--pbal-fg);
  text-align: center;
}
.pbal-plate-text > div {
  white-space: nowrap;
  /* léger relief de gravure */
  text-shadow: 0 1px 0 rgba(255,255,255,.18), 0 -1px 0 rgba(0,0,0,.18);
}
.pbal-plate-text > .is-placeholder { opacity: .38; }

.pbal-note { font-size: 13px; color: var(--pbal-muted); text-align: center; margin-top: 8px; }

/* ---------------------------------------------------------
   Champs
   --------------------------------------------------------- */
.pbal-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; }
.pbal-row--full { grid-column: 1 / -1; }
.pbal-row { min-width: 0; }
.pbal .pbal-row--full.pbal-help { margin-top: -8px; }

.pbal fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pbal-label {
  display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; color: var(--pbal-ink); padding: 0;
}
.pbal-label-hint { font-weight: 400; color: var(--pbal-muted); }
.pbal-help { font-size: 13px; color: var(--pbal-muted); }

.pbal .pbal-input {
  width: 100%; height: 46px; margin: 0;
  padding: 0 14px;
  font: inherit; font-size: 16px; /* 16px : pas de zoom auto sur iPhone */
  color: var(--pbal-ink);
  background: #fff;
  border: 1px solid #c9ced6;
  border-radius: 10px;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.pbal select.pbal-input {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6470' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.pbal select.pbal-input option:disabled { color: #aaa; }
.pbal .pbal-input:hover { border-color: #9aa3ae; }
.pbal .pbal-input:focus { outline: none; border-color: var(--pbal-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pbal-accent) 22%, transparent); }
.pbal .pbal-input[aria-invalid="true"] { border-color: var(--pbal-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pbal-danger) 15%, transparent); }
.pbal .pbal-input::placeholder { color: #9aa1ab; }

.pbal-line-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pbal-count { font-size: 12px; color: var(--pbal-muted); font-variant-numeric: tabular-nums; }
.pbal-count.is-near { color: #b54708; font-weight: 600; }

/* Pastilles de couleur */
.pbal-swatch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pbal-swatch,
.pbal-font {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 6px; border: 1px solid var(--pbal-line); border-radius: 10px;
  background: #fff; cursor: pointer; text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pbal-swatch:hover,
.pbal-font:hover { border-color: #9aa3ae; }
.pbal-swatch input,
.pbal-font input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pbal-swatch:has(input:checked),
.pbal-font:has(input:checked) {
  border-color: var(--pbal-accent);
  box-shadow: 0 0 0 2px var(--pbal-accent);
}
.pbal-swatch:has(input:focus-visible),
.pbal-font:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--pbal-accent) 40%, transparent); outline-offset: 2px; }

.pbal-swatch-chip {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 34px; border-radius: 4px;
  background: var(--pbal-bg, #ccc);
  font: 600 15px/1 Arial, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.pbal-swatch-name { font-size: 12px; line-height: 1.25; color: var(--pbal-muted); }
.pbal-swatch:has(input:checked) .pbal-swatch-name { color: var(--pbal-ink); font-weight: 600; }

/* Polices */
.pbal-font-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pbal-font-sample { font-size: 20px; max-width: 100%; overflow: hidden; line-height: 1.2; color: var(--pbal-ink); }
.pbal-font-name { font-size: 12px; color: var(--pbal-muted); }

/* Case option */
.pbal-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.pbal-check input { width: 18px; height: 18px; accent-color: var(--pbal-accent); }

/* ---------------------------------------------------------
   Erreurs, achat
   --------------------------------------------------------- */
.pbal-errors {
  margin-top: 18px; padding: 12px 16px; border-radius: 10px;
  background: #fef3f2; color: var(--pbal-danger); border: 1px solid #fecdca; font-size: 15px;
}
.pbal-errors ul { margin: 0; padding-left: 18px; }

.pbal-buy { display: flex; gap: 12px; align-items: flex-end; margin-top: 22px; }
.pbal-qty { flex: 0 0 84px; }
.pbal-qty .pbal-input { text-align: center; padding: 0 8px; }

.pbal .pbal-btn {
  flex: 1; height: 52px; margin: 0; padding: 0 20px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--pbal-accent); color: #fff;
  font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .01em;
  text-transform: none; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16,24,40,.1), 0 4px 12px color-mix(in srgb, var(--pbal-accent) 30%, transparent);
  transition: background .15s, transform .05s;
}
.pbal .pbal-btn:hover { background: var(--pbal-accent-hover); }
.pbal .pbal-btn:active { transform: translateY(1px); }
.pbal .pbal-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--pbal-accent) 45%, transparent); outline-offset: 2px; }
.pbal .pbal-btn:disabled { opacity: .65; cursor: progress; }

.pbal-mini-trust { text-align: center; font-size: 13px; color: var(--pbal-muted); margin-top: 12px; }

/* ---------------------------------------------------------
   Colonne argumentaire
   --------------------------------------------------------- */
.pbal-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.pbal-list li { position: relative; padding-left: 26px; font-size: 15px; }
.pbal-list li::before {
  content: ""; position: absolute; left: 3px; top: .45em; width: 11px; height: 6px;
  border-left: 2px solid #15803d; border-bottom: 2px solid #15803d; transform: rotate(-45deg);
}
.pbal-callout {
  margin-top: 18px; padding: 14px 16px; border-radius: 10px;
  background: #fff; border-left: 4px solid var(--pbal-accent); font-size: 15px;
}
.pbal-callout-title { font-weight: 700; margin-bottom: 2px; }

.pbal-faq { margin-top: 18px; display: grid; gap: 8px; }
.pbal-faq details { background: #fff; border: 1px solid var(--pbal-line); border-radius: 10px; }
.pbal-faq summary {
  cursor: pointer; padding: 12px 40px 12px 14px; font-weight: 600; font-size: 15px;
  list-style: none; position: relative;
}
.pbal-faq summary::-webkit-details-marker { display: none; }
.pbal-faq summary::after {
  content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 20px; font-weight: 400; color: var(--pbal-muted);
}
.pbal-faq details[open] summary::after { content: "−"; }
.pbal-faq details p { padding: 0 14px 12px; font-size: 15px; color: var(--pbal-muted); }

.pbal-notices { margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
  .pbal *, .pbal *::before, .pbal *::after { transition: none !important; }
}

/* Mode « Modifier ma plaque » */
.pbal-editing {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--pbal-accent) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--pbal-accent) 30%, #fff);
  font-size: 15px; font-weight: 600;
}
.pbal-editing a { color: var(--pbal-accent); font-weight: 600; }
