/*
 * tsp-shortcode.css — [tsp_product] dans les articles et les pages.
 * Couleurs modifiables depuis le thème : redéfinir les variables sur .tsp-sc.
 */
.tsp-sc {
  --tsp-sc-navy: #1a2a5e;
  --tsp-sc-text: #1f2937;
  --tsp-sc-muted: #6b7280;
  --tsp-sc-border: #e5e7eb;
  --tsp-sc-bg: #fff;
  --tsp-sc-digital: #6366f1;
  --tsp-sc-whatsapp: #25d366;
  --tsp-sc-radius: 14px;
  box-sizing: border-box; color: var(--tsp-sc-text); line-height: 1.4;
  /* Tailles en px : le thème du site fixe html { font-size: 10px } */
  font-size: 15px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.tsp-sc *, .tsp-sc *::before, .tsp-sc *::after { box-sizing: border-box; }
.tsp-sc a { text-decoration: none; box-shadow: none; }

/* Alignement dans l'article */
.tsp-sc-center { margin-left: auto; margin-right: auto; }
.tsp-sc-right  { margin-left: auto; }
.tsp-sc-button.tsp-sc-center, .tsp-sc-slot.tsp-sc-center { display: block; text-align: center; }
.tsp-sc-button.tsp-sc-right,  .tsp-sc-slot.tsp-sc-right  { display: block; text-align: right; }

/* ── Carte ─────────────────────────────────────────── */
.tsp-sc-card {
  display: block; width: 100%; max-width: 320px; margin-top: 16px; margin-bottom: 16px; overflow: hidden;
  background: var(--tsp-sc-bg); border: 1px solid var(--tsp-sc-border); border-radius: var(--tsp-sc-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
}
.tsp-sc-card .tsp-sc-media { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #e0e7ff, #dbeafe); }
.tsp-sc-card .tsp-sc-media img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
.tsp-sc-card .tsp-sc-body { padding: 14px 16px 16px; }

/* ── Bandeau ───────────────────────────────────────── */
.tsp-sc-banner {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 620px; margin-top: 16px; margin-bottom: 16px;
  padding: 12px 16px; background: var(--tsp-sc-bg); border: 1px solid var(--tsp-sc-border);
  border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tsp-sc-banner .tsp-sc-media { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #f0f2f8; }
.tsp-sc-banner .tsp-sc-media img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }
.tsp-sc-banner .tsp-sc-body { flex: 1; min-width: 0; }
.tsp-sc.tsp-sc-banner .tsp-sc-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; margin: 0; }
.tsp-sc-banner .tsp-sc-row { margin: 2px 0 0; justify-content: flex-start; gap: 10px; }
.tsp-sc-banner .tsp-sc-price { font-size: 18px; }
.tsp-sc.tsp-sc-banner .tsp-sc-btn { flex: 0 0 auto; width: auto; padding: 10px 18px; font-size: 15px; }

/* ── Bouton seul ───────────────────────────────────
 * Tout est réglable dans Sales Program → Réglages → Bouton shortcode : les variables --tsp-scb-*
 * sont posées par le plugin ; les valeurs après la virgule sont celles par défaut. */
.tsp-sc-button {
  display: var(--tsp-scb-display, inline-block); max-width: 100%;
  margin-top: var(--tsp-scb-mt, 0px); margin-bottom: var(--tsp-scb-mb, 0px);
}
.tsp-sc.tsp-sc-button .tsp-sc-btn {
  display: inline-flex; width: var(--tsp-scb-width, auto); min-width: var(--tsp-scb-min-width, 0px); max-width: 100%;
  padding: var(--tsp-scb-pad-y, 12px) var(--tsp-scb-pad-x, 22px); gap: var(--tsp-scb-gap, 8px);
  font-size: var(--tsp-scb-font, 15px); font-weight: var(--tsp-scb-weight, 700); text-transform: var(--tsp-scb-transform, none);
  border-radius: var(--tsp-scb-radius, 10px); box-shadow: var(--tsp-scb-shadow, none);
  border: var(--tsp-scb-border-w, 0px) solid var(--tsp-scb-bd, transparent);
  background: var(--tsp-scb-bg, #1a2a5e); color: var(--tsp-scb-fg, #fff); text-align: center;
}
.tsp-sc.tsp-sc-button .tsp-sc-btn:hover { opacity: var(--tsp-scb-hover, .88); color: var(--tsp-scb-fg, #fff); }
.tsp-sc.tsp-sc-button .tsp-sc-btn-order    { --tsp-scb-bg: var(--tsp-scb-order-bg, #1a2a5e); --tsp-scb-fg: var(--tsp-scb-order-fg, #fff); --tsp-scb-bd: var(--tsp-scb-order-bd, #1a2a5e); }
.tsp-sc.tsp-sc-button .tsp-sc-btn-whatsapp { --tsp-scb-bg: var(--tsp-scb-wa-bg, #25d366);    --tsp-scb-fg: var(--tsp-scb-wa-fg, #fff);    --tsp-scb-bd: var(--tsp-scb-wa-bd, #25d366); }
.tsp-sc.tsp-sc-button .tsp-sc-btn-digital  { --tsp-scb-bg: var(--tsp-scb-dig-bg, #6366f1);   --tsp-scb-fg: var(--tsp-scb-dig-fg, #fff);   --tsp-scb-bd: var(--tsp-scb-dig-bd, #6366f1); }
.tsp-sc.tsp-sc-button .tsp-sc-btn-disabled { --tsp-scb-bg: var(--tsp-scb-off-bg, #e5e7eb);   --tsp-scb-fg: var(--tsp-scb-off-fg, #6b7280); --tsp-scb-bd: var(--tsp-scb-off-bg, #e5e7eb); cursor: not-allowed; }
.tsp-sc.tsp-sc-button .tsp-sc-btn-disabled:hover { opacity: 1; }
.tsp-sc.tsp-sc-button .tsp-sc-wa { display: var(--tsp-scb-icon-show, inline-block); width: var(--tsp-scb-icon, 18px); height: var(--tsp-scb-icon, 18px); }

/* ── Éléments ──────────────────────────────────────── */
.tsp-sc-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 44px; }
.tsp-sc-banner .tsp-sc-placeholder { font-size: 28px; }
.tsp-sc-badge {
  display: inline-block; margin-bottom: 8px; padding: 2px 9px; border-radius: 10px;
  background: #ede9fe; color: #6d28d9; font-size: 13px; font-weight: 700;
}
.tsp-sc .tsp-sc-title { display: block; margin: 0 0 6px; font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--tsp-sc-navy); }
.tsp-sc .tsp-sc-title:hover { text-decoration: underline; }
.tsp-sc-desc {
  margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: var(--tsp-sc-muted);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tsp-sc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.tsp-sc-price { font-size: 22px; font-weight: 800; color: var(--tsp-sc-navy); white-space: nowrap; }
.tsp-sc-country { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--tsp-sc-muted); }
.tsp-sc-country .fi { width: 16px; height: 12px; border-radius: 2px; }

.tsp-sc .tsp-sc-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 11px 16px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--tsp-sc-navy); color: #fff; font-size: 15px; font-weight: 700; line-height: 1.25; min-height: 44px;
  transition: opacity .15s, transform .1s;
}
.tsp-sc .tsp-sc-btn:hover { opacity: .88; color: #fff; }
.tsp-sc .tsp-sc-btn:active { transform: scale(.98); }
.tsp-sc .tsp-sc-btn:focus-visible { outline: 2px solid var(--tsp-sc-navy); outline-offset: 2px; }
.tsp-sc .tsp-sc-btn-digital  { background: var(--tsp-sc-digital); }
.tsp-sc .tsp-sc-btn-whatsapp { background: var(--tsp-sc-whatsapp); }
.tsp-sc .tsp-sc-btn-disabled { background: #e5e7eb; color: #6b7280; cursor: not-allowed; }
.tsp-sc .tsp-sc-btn-disabled:hover { opacity: 1; color: #6b7280; }
.tsp-sc-wa { flex-shrink: 0; }
.tsp-sc .tsp-sc-more { display: block; margin-top: 8px; text-align: center; font-size: 14px; color: var(--tsp-sc-muted); text-decoration: underline; }

/* Aperçu administrateur : carte d'un produit non vendu dans le pays principal (visible par l'administrateur seulement) */
.tsp-sc.tsp-sc-preview { outline: 2px dashed #a7f3d0; outline-offset: 2px; }
.tsp-sc-adminnote {
  display: block; margin: 0 0 10px; padding: 6px 10px; border: 1px solid #bbf7d0; border-radius: 8px;
  background: #f0fdf4; color: #14532d; font-size: 13px; font-weight: 600; line-height: 1.4;
}
.tsp-sc-card > .tsp-sc-adminnote { margin: 10px 10px 0; }
.tsp-sc-button .tsp-sc-adminnote { margin: 6px 0 0; }
.tsp-sc-banner.tsp-sc-preview { flex-wrap: wrap; }
.tsp-sc-banner > .tsp-sc-adminnote { flex: 1 1 100%; margin: 0; }

.tsp-sc-notice {
  max-width: 620px; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--tsp-sc-border);
  border-radius: 10px; background: #f9fafb; font-size: 15px; color: var(--tsp-sc-muted);
}

/* Emplacement en attente (chargement différé) */
.tsp-sc-slot:empty { min-height: 64px; max-width: 320px; border-radius: 12px; background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%); background-size: 400% 100%; animation: tspScWait 1.4s ease infinite; }
.tsp-sc-slot.is-empty { display: none; }
@keyframes tspScWait { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 480px) {
  .tsp-sc-card { max-width: 100%; }
  .tsp-sc-banner { flex-wrap: wrap; }
  .tsp-sc.tsp-sc-banner .tsp-sc-btn { flex: 1 1 100%; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .tsp-sc *, .tsp-sc-slot { animation: none !important; transition: none !important; } }

/* ── Promotion : ancien prix barré + étiquette de remise ── */
.tsp-sc .tsp-promo { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; vertical-align: middle; }
.tsp-sc .tsp-promo-old { font-size: 14px; font-weight: 600; color: var(--tsp-sc-muted); text-decoration: line-through; }
.tsp-sc .tsp-promo-badge { padding: 2px 7px; border-radius: 20px; background: #fff0f0; border: 1px solid #f5b8b8; color: #cc0000; font-size: 12px; font-weight: 800; }
.tsp-sc .tsp-promo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tsp-sc .tsp-sc-price { display: inline-flex; align-items: center; flex-wrap: wrap; row-gap: 2px; }

/* ── Packs digitaux ── */
.tsp-sc .tsp-sc-pack { align-self: flex-start; display: inline-block; margin: 0 0 6px; padding: 3px 10px; border-radius: 20px; background: #eaeefc; color: #1a2a5e; font-size: 12px; font-weight: 700; line-height: 1.4; }
.tsp-sc .tsp-sc-pack-list { margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: #6b7a9b; }
.tsp-sc .tsp-sc-pack-save { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #2d9c4e; }
.tsp-sc .tsp-sc-inpack { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #3b5998; text-decoration: none; }
.tsp-sc .tsp-sc-inpack:hover { text-decoration: underline; }
.tsp-sc-banner .tsp-sc-pack, .tsp-sc-banner .tsp-sc-pack-save { margin: 2px 8px 0 0; display: inline-block; }
