/* =========================
   Scroll smooth avec les ancres
========================= */
html,
body {
  scroll-behavior: smooth;
}

/* =========================
   Espace au-dessus de la preview
========================= */
body .wp-site-blocks .bs-preview {
  margin-top: 0 !important;
}

/* =========================
   Wrapper global preview
========================= */
body .bs-preview {
  position: relative;
  padding-top: 12px !important;
  padding-bottom: 6px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* =========================
   Header page
========================= */
.bs-page-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 20px;
  padding: 10px 20px 0;
}

.bs-page-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.bs-page-header p {
  margin: 8px 0 0;
  font-size: 15px;
  color: #666;
}

/* =========================
   Layout preview + preuves
========================= */
.bs-product-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto 24px;
}

.bs-product-top .bs-preview {
  margin: 0;
}

.bs-product-top .bs-product-details {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 16px;
}

/* =========================
   Ligne preview
========================= */
body .bs-preview .previewRow {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

/* =========================
   Cadre base
========================= */
body .bs-preview .frame {
  display: inline-block;
  padding: 14px;
  margin: 0 auto;
  background: #f8f8f8;
  border-radius: 2px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.18),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

/* =========================
   Cadres
========================= */
body .bs-preview .frame--black {
  border: 10px solid #121212;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 8px 18px rgba(255, 255, 255, 0.05),
    0 18px 45px rgba(0, 0, 0, 0.18),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

body .bs-preview .frame--wood {
  border: 10px solid #e2d0b1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    inset 0 10px 22px rgba(255, 255, 255, 0.12),
    0 18px 45px rgba(0, 0, 0, 0.18),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

body .bs-preview .frame--none {
  border: 14px solid transparent;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.10);
}

/* =========================
   Image preview
========================= */
body .bs-preview .frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#frameWrap {
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  margin: 0 auto;
  min-width: min(78vw, 324px);
  min-height: 45vh;
}

#replicatePreview {
  display: block;
  max-width: 75vw;
  height: 45vh;
  width: auto;
  position: relative;
  left: 0;
  top: 0;
}

/* =========================
   Pastilles couleurs
========================= */
.bs-bg-controls {
  margin: 10px auto 30px;
  max-width: 180px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  justify-items: center;
}

.bs-bg-label {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 14px;
  margin-bottom: 4px;
  color: #444;
  display: block;
  font-weight: 600;
}

.bs-bg-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease;
}

.bs-bg-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.bs-bg-btn.is-active {
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
}

/* couleurs texte */
.bs-text-black { background-color: #111; }
.bs-text-white { background-color: #fff; }

/* couleurs fond */
.bs-bg-ivoire { background-color: #ECE6DA; }
.bs-bg-beige { background-color: #E4D1B9; }
.bs-bg-sauge { background-color: #C3D3B4; }
.bs-bg-moutarde { background-color: #D1A83A; }
.bs-bg-bleu { background-color: #5eaab7; }
.bs-bg-foret { background-color: #1F5C63; }
.bs-bg-marine { background-color: #24304F; }
.bs-bg-rose-vintage { background-color: #B75169; }

/* =========================
   Sections configurateur
========================= */
.bs-section {
  max-width: 720px;
  margin: 0 auto 28px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.bs-section h3 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 20px;
  line-height: 1.2;
}

.bs-subsection + .bs-subsection {
  margin-top: 18px;
}

.bs-subsection > span {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 10px;
}

/* =========================
   Boutons configurateur
========================= */
#productControls,
#frameControls,
#sizeControls,
#textControls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
}

#productControls button,
#frameControls button,
#sizeControls button,
#textControls button,
#bs-test-checkout {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease,
    color 0.12s ease;
}

#productControls button:hover,
#frameControls button:hover,
#sizeControls button:hover,
#textControls button:hover,
#bs-test-checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.22);
}

#productControls button.is-active,
#frameControls button.is-active,
#sizeControls button.is-active,
#textControls button.is-active {
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* =========================
   Prix
========================= */
#bsPrice {
  text-align: center;
  margin: 30px auto;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
}

/* =========================
   CTA
========================= */
#bs-test-checkout {
  min-width: 240px;
  padding: 14px 22px;
}

/* =========================
   Preuves produit
========================= */
.bs-detail-card {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  border-radius: 14px;
  padding: 7px;
  width: 72px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.bs-detail-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
}

.bs-detail-card img[src$=".svg"] {
  padding: 10px;
  object-fit: contain;
}

.bs-detail-label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  min-height: 2.4em;
  font-size: 9px;
  font-weight: 600;
  color: #222;
  text-align: center;
  line-height: 1.15;
}

/* =========================
   Override pastilles texte
========================= */
#textControls.bs-bg-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  max-width: none;
}

#textControls.bs-bg-controls button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  background: transparent;
  color: transparent;
}

#textControls.bs-bg-controls button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
  border-color: #fff;
}

#textControls.bs-bg-controls button.is-active {
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
}

#textControls.bs-bg-controls .bs-text-black {
  background-color: #111 !important;
}

#textControls.bs-bg-controls .bs-text-white {
  background-color: #fff !important;
}

/* =========================
   Sticky CTA mobile
========================= */
.bs-sticky-price-from {
  text-align: center;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.bs-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  padding: 10px 12px calc(20px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#bs-sticky-checkout {
  width: 100%;
  appearance: none;
  border: none;
  border-radius: 999px;
  background: #70A8B5;
  color: #fff;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

#bs-sticky-checkout:hover {
  background: #5f99a6;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.bs-sticky-delivery {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #666;
  line-height: 1.2;
}

/* =========================
   Photo guide upload
========================= */
.bs-photo-guide {
  margin: 18px 0 10px;
}

.bs-photo-guide-grid {
  display: flex;
  gap: 8px;
}

.bs-photo-example {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
}

.bs-photo-example img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 6px;
}

.bs-photo-ok img {
  border: 3px solid #2ecc71;
}

.bs-photo-no img {
  border: 3px solid #e74c3c;
}

/* =========================
   Bouton retour Preview
========================= */
.bs-preview-top {
  position: fixed;
  top: 72px;
  left: 14px;
  z-index: 1000;
  margin: 0;
  width: auto;
  max-width: none;
  display: block;
  pointer-events: none;
}

.bs-back-button {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: #222;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}

.bs-back-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10);
  border-color: rgba(0, 0, 0, 0.18);
}

/* =========================
   Loader preview
========================= */
.bs-preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(2px);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bs-preview-loader.is-active {
  opacity: 1;
  pointer-events: auto;
}

.bs-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: #70A8B5;
  border-radius: 50%;
  animation: bs-spin 0.8s linear infinite;
}

.bs-preview-loader-sub {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  opacity: 0.8;
}

.bs-preview-loader-text {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

@keyframes bs-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   Invitation Scroll Preview vers config
========================= */
.bs-scroll-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #70A8B5;
  border: none;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  animation: bsScrollBounce 1s infinite;
  z-index: 8;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}

@keyframes bsScrollBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* =========================
   Invitation Zoom Preview
========================= */
.bs-zoom-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 6;
}

/* =========================
   Mobile
========================= */
@media (max-width:768px) {
  body {
    padding-bottom: 140px;
  }

  body .bs-preview {
    margin-top: 0;
    padding-bottom: 0;
  }

  body .bs-preview .frame {
    box-sizing: border-box;
    padding: 14px;
    max-width: 78vw;
    margin: 0 auto;
  }

  body .bs-preview .frame--black,
  body .bs-preview .frame--wood,
  body .bs-preview .frame--none {
    border-width: 10px;
  }

  #frameWrap {
    min-width: 0;
    min-height: 0;
    width: min(75vw, 320px);
    aspect-ratio: 1 / 1.414;
  }

  #replicatePreview {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    left: 0;
    top: 0;
  }

  .bs-page-header h1 {
    font-size: 22px;
  }

  .bs-page-header p {
    font-size: 14px;
  }

  .bs-section {
    padding: 18px 16px;
    margin-bottom: 20px;
    border-radius: 14px;
  }

  .bs-section h3 {
    font-size: 18px;
    margin-bottom: 14px;
  }

  #productControls button,
  #frameControls button,
  #sizeControls button,
  #textControls button,
  #bs-test-checkout {
    font-size: 14px;
    padding: 11px 15px;
  }

  #bsPrice {
    font-size: 30px;
    margin: 24px auto;
  }

  .bs-product-top .bs-product-details {
    max-width: 100%;
  }

  .bs-product-top .bs-detail-card {
    width: 64px;
    padding: 5px;
    border-radius: 10px;
  }

  .bs-product-top .bs-detail-card img[src$=".svg"] {
    padding: 8px;
  }

  .bs-product-top .bs-detail-label {
    font-size: 9px;
    margin-top: 4px;
    line-height: 1.15;
  }

  .bs-preview-top {
    top: 68px;
    left: 12px;
  }

  .bs-back-button {
    font-size: 13px;
    padding: 9px 12px;
  }

  .bs-zoom-hint {
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 6px 9px;
  }
}

/* =========================
   Erreur preview
========================= */

.bs-preview-error{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  background:rgba(255,255,255,0.88);
  backdrop-filter:blur(2px);
  z-index:6;
  text-align:center;
  padding:20px;
}

.bs-preview-error[hidden]{
  display:none !important;
}

.bs-preview-error p{
  margin:0;
  font-size:14px;
  font-weight:600;
  color:#333;
}

#bsRetryPreview{
  appearance:none;
  border:none;
  border-radius:999px;
  background:#70A8B5;
  color:#fff;
  padding:12px 18px;
  font-size:14px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,0.15);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}

#bsRetryPreview:hover{
  background:#5f99a6;
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(0,0,0,0.18);
}


/* =========================
   PRODUCT SELECTION - PREVIEW
========================= */

.bs-product-grid{
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:space-between;
  align-items:stretch;
  gap:6px;
  width:100%;
}

.bs-product-card{
  flex:1 1 0 !important;
  min-width:0;
  max-width:none;

  border:1px solid #e5e5e5;

  padding:10px 6px;
  background:#fff;
  text-align:center;
  cursor:pointer;
  transition:all 0.15s ease;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;

  min-height:130px;
}

#productControls .bs-product-card{
  border-radius:24px !important;
}

.bs-product-card.is-active{
  border-color:#000;
}

.bs-product-visual{
  width:44px;
  height:60px;
  background:#f5f5f5;
  border-radius:6px;
  margin-bottom:10px;
  flex:0 0 auto;
}

.bs-product-visual.dashed{
  border:2px dashed #ccc;
  background:transparent;
}

.bs-product-visual.frame-black{
  box-shadow:inset 0 0 0 6px #000;
  background:#fff;
}

.bs-product-visual.frame-wood{
  box-shadow:inset 0 0 0 6px #d2b085;
  background:#fff;
}

.bs-product-card span{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:11px;
  font-weight:700;
  line-height:1.15;
  min-height:30px;
}

#productControls .bs-product-visual.poster-print{
  background:#f5f5f5;
  box-shadow:inset 0 0 0 2px #d0d0d0;
}
/* =========================
   SIZE SELECTION
========================= */

#sizeControls.bs-size-grid{
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:space-between;
  align-items:stretch;
  gap:10px;
  width:100%;
}

#sizeControls .bs-size-card{
  flex:1 1 0 !important;
  min-width:0;
  appearance:none;
  -webkit-appearance:none;

  border:1px solid #e5e5e5 !important;
  background:#fff !important;
  color:#222 !important;
  border-radius:14px !important;
  padding:12px 8px !important;
  text-align:center;
  cursor:pointer;
  transition:all 0.15s ease;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  padding-bottom:14px !important;

  min-height:130px;
  box-shadow:none !important;
}

#sizeControls .bs-size-card.is-active{
  background:#000 !important;
  border-color:#000 !important;
  color:#fff !important;
}

#sizeControls .bs-size-card span{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  min-height:24px;
  color:inherit;
}

#sizeControls .bs-size-visual{
  background:#f5f5f5;
  border-radius:6px;
  margin-bottom:10px;
  flex:0 0 auto;

  box-shadow:inset 0 0 0 2px #d0d0d0; /* ← AJOUT */
}

#sizeControls .bs-size-visual.a4{
  width:34px;
  height:48px;
}

#sizeControls .bs-size-visual.a3{
  width:42px;
  height:60px;
}

#sizeControls .bs-size-visual.a2{
  width:50px;
  height:72px;
}

/* =========================
   OPTION PRICE (Produit + Taille)
========================= */

.bs-option-price{
  display:block;
  margin-top:4px;
  font-size:11px;
  line-height:1;
  font-weight:600;
  color:#777;
}

.bs-product-card.is-active .bs-option-price,
.bs-size-card.is-active .bs-option-price{
  color:#fff;
}

/* =========================
   TEMP : hide zoom hint
========================= */

/*.bs-zoom-hint{
  display:none !important;
}*/

