/* bpphonedetect v1.5.0 — deux widgets (détection + carrousel), design A·Atelier.
   Scopé sur les conteneurs #bppd-detect / #bppd-carousel : ils fonctionnent
   aussi bien dans le wrapper bannière que posés dans le thème. */

#bppd-detect,
#bppd-carousel {
  --bppd-blue: #0b2b4a;
  --bppd-orange: #f07a1f;
  --bppd-teal: #4dd0c9;
  --bppd-teal-soft: #e8faf8;
  --bppd-ink: #1a1d22;
  --bppd-graphite: #3d434d;
  --bppd-mute: #6b7280;
  --bppd-line: #e6e8ec;
  --bppd-paper: #fff;
  --bppd-font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bppd-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  display: none;
}

#bppd-detect.bppd-on,
#bppd-carousel.bppd-on {
  display: block;
  height: 100%;
}

/* Mode bannière (wrapper auto-injecté) : centré, largeur bornée */
#bppd-banner {
  display: none;
}

#bppd-banner.bppd-visible {
  display: block;
  max-width: 720px;
  margin: 12px auto;
  padding: 0 10px;
}

#bppd-banner #bppd-detect.bppd-on,
#bppd-banner #bppd-carousel.bppd-on {
  margin-bottom: 10px;
}

/* Carte commune */
.bppd-card {
  position: relative;
  height: 100%;
  box-shadow: 0 10px 30px -20px rgba(11, 43, 74, .18);
  padding: 44px 14px 0;
  /*min-height: 120px; /* réserve anti-CLS */
}

.bppd-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--bppd-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--bppd-orange);
  background: #fff;
  padding: 5px 9px;
  border-radius: 0 0 8px 0;
}

.bppd-close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--bppd-mute);
  padding: 6px 10px;
  cursor: pointer;
}

/* ---- Widget 1 : détection ---- */
.bppd-detect-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
}

.bppd-visual {
  flex: 0 0 auto;
  width: 72px;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bppd-blue);
}

.bppd-visual svg {
  max-height: 70px;
  object-fit: contain;
}

.bppd-detect-main {
  flex: 1;
  min-width: 0;
}

.bppd-model-name {
  font-family: var(--bppd-font-display);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--bppd-blue);
  margin: 6px 0 10px;
}

.bppd-fromprice {
  font-size: 13px;
  color: var(--bppd-graphite);
  margin: 0 0 10px;
}

.bppd-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--bppd-graphite);
  margin: 0;
}

.bppd-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bppd-cta {
  display: inline-flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  background: var(--bppd-orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  margin: -4px 0 6px 0;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.bppd-cta:hover {
  color: #fff;
  filter: brightness(1.04);
}

.bppd-notmine {
  border: none;
  background: none;
  color: var(--bppd-mute);
  text-decoration: underline;
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
}

.bppd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
}

.bppd-chip {
  border: 1px solid var(--bppd-line);
  background: #fff;
  color: var(--bppd-blue);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bppd-chip:hover {
  border-color: var(--bppd-orange);
  color: var(--bppd-orange);
}

.bppd-chip--other {
  border-style: dashed;
  color: var(--bppd-mute);
}

/* Champ IMEI / n° de modèle */
.bppd-identify {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1.5px solid var(--bppd-line);
  border-radius: 6px;
  padding: 0 3px 0 12px;
  background: #fff;
  margin-top: 14px;
}

.bppd-identify--mini {
  /*max-width: 420px;*/
}

.bppd-identify input {
  width: 100%;
  border: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-family: var(--bppd-font-mono);
  font-size: 13px;
  color: #000;
  padding: 9px 0;
  background: transparent;
}

.bppd-identify button {
  background: var(--bppd-orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.bppd-identify-msg {
  font-size: 12.5px;
  color: var(--bppd-mute);
  margin: 6px 0 0;
  min-height: 1em;
}

/* ---- Widget 2 : carrousel ---- */
.bppd-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.bppd-tile {
  flex: 0 0 auto;
  width: 128px;
  background: #fff;
  border: 1px solid var(--bppd-line);
  border-radius: 10px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bppd-tile img,
.bppd-tile-ph {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.bppd-tile-name {
  font-size: 11.5px;
  line-height: 1.3;
  max-height: 3.9em;
  overflow: hidden;
  margin-top: 6px;
  color: var(--bppd-ink);
}

.bppd-tile-price {
  font-family: var(--bppd-font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--bppd-blue);
  margin-top: 4px;
}

.bppd-cat-tile {
  flex: 0 0 auto;
  width: 148px;
  min-height: 104px;
  background: var(--bppd-blue);
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bppd-cat-tile:hover {
  color: #fff;
  filter: brightness(1.08);
}

.bppd-cat-tile-top {
  font-family: var(--bppd-font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--bppd-teal);
}

.bppd-cat-tile-label {
  font-family: var(--bppd-font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
}

.bppd-cat-tile-arrow {
  margin-top: auto;
  color: var(--bppd-orange);
  font-size: 18px;
}

.bppd-strip-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bppd-orange);
  text-decoration: none;
}

.bppd-strip-more:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .bppd-model-name {
    font-size: 16px;
  }

  .bppd-visual {
    width: 56px;
  }
}

/* Liens SSR de la sélection fixe (maillage interne, avant hydratation JS) */
.bppd-seo-links {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.bppd-seo-links a {
  color: var(--bppd-blue);
  font-size: 13px;
  text-decoration: none;
}

.bppd-seo-links a:hover {
  text-decoration: underline;
}

/* Aide "où trouver mon IMEI / n° de série" */
.bppd-help-toggle {
  float: right;
  border: none;
  background: none;
  color: var(--bppd-mute);
  text-decoration: underline;
  font-size: 12px;
  padding: 6px 0 0;
  cursor: pointer;
}

.bppd-help {
  font-size: 12.5px;
  line-height: 1.5;
  color: #404040;
  background: var(--bppd-teal-soft);
  border-radius: 6px;
  padding: 6px 12px;
  margin-top: 30px;
}
