@charset "UTF-8";

/* ============================================================================
 * IMPORTANT : ce fichier est écrit en CSS PLAT (pas de nesting natif).
 * Le CSS nesting (règles imbriquées, avec ou sans `&`) n'est supporté qu'à
 * partir de Safari 16.5 / iOS 16.5. Or des appareils encore utilisés (ex.
 * iPhone 7 plafonné à iOS 15) ignorent toute règle imbriquée → modale cassée.
 * => Toujours ajouter les nouvelles règles à plat ici.
 * ========================================================================== */

#bc-modal.modal {
  z-index: 100000;
}

#bc-modal.bc-modal--iframe-loading .bc-modal-body-loader {
  display: flex;
}
#bc-modal.bc-modal--iframe-loading .bc-modal-footer-main {
  display: none !important;
}

#bc-modal.bc-modal--atc-loading .bc-modal-body::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.72);
  cursor: not-allowed;
  display: block;
}
#bc-modal.bc-modal--atc-loading .bc-modal-body::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border: 0.3rem solid rgba(0, 139, 202, 0.3);
  border-top-color: #008bca;
  border-radius: 50%;
  animation: bc-atc-spin 0.8s linear infinite;
  display: block;
}

#bc-modal .modal-footer.bc-modal-footer {
  display: block;
}

#bc-modal .bc-modal-footer-atc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 12px 16px;
  margin-bottom: 0;
}

#bc-modal .bc-modal-footer-atc .bc-modal-product-prices {
  flex: 0 0 auto;
  min-width: 100px;
}
#bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price {
  font-size: 1.1rem;
  line-height: 1.35;
}
#bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixht {
  font-weight: 700;
  font-size: 1.65rem;
  margin-bottom: 2px;
  color: #008bca;
}
#bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixht sup {
  font-size: 0.85em;
}
#bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixttc {
  margin: 0;
  font-size: 0.95em;
}

#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity {
  width: 160px;
  margin-bottom: 0 !important;
  justify-content: center;
  background-color: #e0e0e0;
  border-radius: 100px;
  padding: 5px;
}
/* La chaîne .qty > .input-group doit remplir toute la largeur de la pastille,
   sinon l'input reste minuscule et les boutons (40px) se chevauchent. */
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity .qty {
  width: 100%;
}
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity .input-group {
  width: 100%;
  flex-wrap: nowrap; /* garde [−][nombre][+] sur une seule ligne */
}
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity .input-group-prepend,
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity .input-group-append {
  flex: 0 0 40px;
}
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-minus,
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-plus {
  background-color: #fff;
  flex: 0 0 40px;
  -webkit-flex: 0 0 40px;
  height: 40px;
  border-radius: 20px;
  margin: 0;
  transition: .2s linear;
}
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-minus:hover,
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-plus:hover {
  background-color: #008bca;
  color: #fff;
}
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-minus[disabled],
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-plus[disabled] {
  background-color: #dfdfdf !important;
  color: #000 !important;
  cursor: not-allowed;
}
#bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-input {
  background-color: #fff;
  /* flex-basis 0% (avec unité, PAS `0` : Safari iOS ignore le basis sans unité
     → l'input ne grandit pas, laissant un vide avant le bouton +). */
  flex: 1 1 0%;
  -webkit-box-flex: 1;
  -webkit-flex: 1 1 0%;
  min-width: 0;
  width: auto;
  height: 40px;
  border-radius: 20px;
  margin: 0 5px;
  padding: 0 2px; /* peu de padding latéral pour afficher "9999" en entier */
  -webkit-appearance: none; /* normalise le rendu natif iOS du champ */
  appearance: none;
  transition: .2s linear;
}

#bc-modal .bc-modal-footer-atc #bc-addtocart.add-to-cart {
  background-color: #008bca;
  color: #fff;
  border-color: #008bca;
  border-radius: 100px;
  padding: 5px 20px;
  transition: .2s linear;
  width: 200px;
  white-space: normal;
  font-size: 14px;
}
#bc-modal .bc-modal-footer-atc #bc-addtocart.add-to-cart:hover {
  background-color: #0070a3;
  border-color: #0070a3;
}
#bc-modal .bc-modal-footer-atc #bc-addtocart.add-to-cart:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.modal-backdrop {
  z-index: 1040;
}

.bc-modal-dialog {
  max-width: 95vw;
  margin: 20px auto;
  border-radius: 15px;
  overflow: hidden;
}

.bc-modal-content {
  min-height: 80vh;
  display: grid;
  grid-template-rows: 1fr 78px;
}

.bc-modal-body {
  position: relative;
  padding: 0;
}
.bc-modal-body .bc-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 30px;
  height: 30px;
  font-size: 30px;
}

/* Loader iframe : visible uniquement avec #bc-modal.bc-modal--iframe-loading (modal.js) */
.bc-modal-body-loader {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
  padding: 1.5rem;
}

.bc-modal-body-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.bc-modal-body-loader-spinner {
  width: 2.5rem;
  height: 2.5rem;
}

.bc-modal-body-loader-text {
  font-size: 1rem;
  color: #333;
  max-width: 22rem;
}

.bc-modal-footer {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.bc-modal-iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  display: block;
}

.bc-price-loading {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  perspective: 120px;
}

.bc-price-loading-coin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  border: 2px solid #aaa;
  border-radius: 50%;
  color: #aaa;
  transform-style: preserve-3d;
  animation: bc-price-spin-y 0.9s linear infinite;
}

.bc-price-loading-symbol {
  font-size: 0.68em;
  font-weight: 700;
  line-height: 1;
}

@keyframes bc-price-spin-y {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

@media (max-width: 768px) {
  /* La modal occupe toute la hauteur de l'écran */
  .bc-modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100vh;
    min-height: unset;
  }

  .bc-modal-content {
    height: 100%;
    min-height: unset;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    grid-template-rows: none;
  }

  .bc-modal-body {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 0;
  }

  .bc-modal-iframe {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .bc-modal-tabs-container {
    flex: 1;
    overflow-y: auto;
  }

  .bc-modal-footer {
    flex-shrink: 0;
    padding: 8px 15px 10px;
    box-shadow: 0 0 7.5px rgba(0, 0, 0, 0.25);
    border-top: none;
  }

  /* Grille : prix sur toute la largeur, quantité + CTA centrés sur la ligne suivante */
  #bc-modal .bc-modal-footer-atc {
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: center;
    column-gap: 8px;
    row-gap: 8px;
    width: 100%;
  }

  #bc-modal .bc-modal-footer-atc .bc-modal-product-prices {
    grid-column: 1 / -1;
    grid-row: 1;
    flex: unset;
    width: 100%;
  }

  #bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    line-height: 1.2;
  }

  #bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixht,
  #bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixttc {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    margin: 0;
    white-space: nowrap;
  }

  #bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixht {
    font-size: 16px;
    font-weight: 700;
    color: #008bca;
  }

  #bc-modal .bc-modal-footer-atc .bc-modal-product-prices .current-price .prixttc {
    font-size: 14px;
    color: #2f2f31;
  }

  #bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-width: 118px;
    max-width: 142px;
    flex: unset;
    flex-shrink: 0;
    margin-bottom: 0 !important;
    padding: 4px;
    display: flex;
    align-items: center;
  }

  #bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-minus,
  #bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-plus {
    flex: 0 0 34px;
    -webkit-flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }

  #bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity .input-group-prepend,
  #bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity .input-group-append {
    flex: 0 0 34px;
  }

  #bc-modal .bc-modal-footer-atc #wrap_qty.product-quantity #bc-qty-input {
    height: 34px;
    margin: 0 3px;
    font-size: 14px;
  }

  #bc-modal .bc-modal-footer-atc .bc-modal-footer-nav-3d {
    grid-column: 3;
    grid-row: 2;
    flex: unset;
    width: auto;
    min-width: 0;
    align-items: stretch;
  }

  #bc-modal .bc-modal-footer-atc .add {
    grid-column: 3;
    grid-row: 2;
    flex: unset;
    min-width: 0;
    width: auto;
    max-width: min(100%, 260px);
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #bc-modal .bc-modal-footer-atc #bc-addtocart {
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 42px;
    height: auto;
    margin-left: 0;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
  }

  #bc-modal .bc-modal-footer-atc #bc-addtocart .bc-addtocart-label {
    white-space: normal;
    line-height: 1.2;
  }

  #bc-modal .bc-modal-footer-atc #bc-addtocart .shopping-cart {
    flex-shrink: 0;
  }
}

.bc-configure-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
}
.bc-configure-btn-wrapper .bc-configure-btn,
.bc-configure-btn-wrapper .bc-import-creation-btn {
  width: 100%;
  padding: 15px 40px;
  border-radius: 100px;
  border-width: 2px;
  transition: all 0.3s ease-out;
  text-transform: uppercase;
}
.bc-configure-btn-wrapper .bc-configure-btn {
  background-color: #008bca;
  color: #fff;
  border-color: #008bca;
}
.bc-configure-btn-wrapper .bc-configure-btn:hover {
  background-color: #0070a3;
}
.bc-configure-btn-wrapper .bc-import-creation-btn {
  background-color: #fff;
  color: #008bca;
  border-color: #008bca;
}
.bc-configure-btn-wrapper .bc-import-creation-btn:hover {
  background-color: #008bca;
  color: #fff;
}

/* --- Panier : preview configuration + bouton "Voir le produit" --- */
.bc-cart-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
}
.bc-cart-preview-thumb {
  max-width: 120px;
  max-height: 60px;
  border: 1px solid #ddd;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}
.bc-cart-voir-produit, .bc-cart-edit-btn {
  font-size: 14px;
  padding: 3px 10px;
  border: 1px solid #008bca;
  color: #008bca;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bc-cart-voir-produit:hover, .bc-cart-edit-btn:hover {
  background: #008bca;
  color: #fff;
}
.bc-cart-preview-modal .modal-body {
  background: #f8f8f8;
}
.bc-cart-preview-full {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

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

/* --- Configurateur 3D : footer step-aware (Phase 2.4) --- */
.bc-modal-footer-previous,
.bc-modal-footer-next-spacer {
  display: none;
}

#bc-3d-back {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  padding: 0 30px;
  border: 2px solid #008bca;
  border-radius: 100px;
  background: #fff;
  color: #008bca;
  font-family: 'Jost', Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: .2s linear;
}
#bc-3d-back:hover {
  background: #008bca;
  color: #fff;
}
#bc-3d-back .bc-3d-back-icon {
  display: block;
  flex-shrink: 0;
}

.bc-modal-footer-nav-3d {
  display: none;
  gap: 12px;
}

#bc-3d-next {
  border-radius: 100px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: .2s linear;
  background-color: #008bca;
  color: #fff;
  border: 1px solid #008bca;
}
#bc-3d-next:hover {
  background-color: #0070a3;
  border-color: #0070a3;
}

#bc-modal.bc-modal--mode-3d .bc-modal-footer-atc .add {
  display: none;
}
#bc-modal.bc-modal--mode-3d .bc-modal-footer-nav-3d {
  display: flex;
}
#bc-modal.bc-modal--mode-3d.bc-modal--3d-step-3 #bc-3d-next {
  display: none;
}
#bc-modal.bc-modal--mode-3d.bc-modal--3d-step-3 .bc-modal-footer-atc .add {
  display: block;
}

@media (min-width: 769px) {
  #bc-modal.bc-modal--mode-3d .bc-modal-footer-atc {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 10px;
  }

  #bc-modal.bc-modal--mode-3d .bc-modal-footer-previous,
  #bc-modal.bc-modal--mode-3d .bc-modal-footer-next-spacer {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    height: 50px;
    align-items: center;
  }

  #bc-modal.bc-modal--mode-3d .bc-modal-footer-previous {
    justify-content: flex-start;
  }

  #bc-modal.bc-modal--mode-3d .bc-modal-footer-next-spacer {
    justify-content: flex-end;
  }

  #bc-modal.bc-modal--mode-3d.bc-modal--3d-step-2 #bc-3d-back,
  #bc-modal.bc-modal--mode-3d.bc-modal--3d-step-3 #bc-3d-back {
    display: inline-flex;
  }

  #bc-modal.bc-modal--mode-3d #bc-addtocart.add-to-cart {
    height: 50px;
    min-width: 280px;
    max-width: 450px;
    flex: 0 1 450px;
    font-size: 15px;
    line-height: 18px;
    text-transform: uppercase;
  }
}

@media (max-width: 768px) {
  /* Configurateur 3D mobile : croix au-dessus de la frise d'étapes (maquette Figma) */
  #bc-modal.bc-modal--mode-3d .bc-modal-body .bc-modal-close {
    top: 5px;
    right: 0;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    opacity: 1;
  }

  #bc-modal.bc-modal--mode-3d .bc-modal-footer-nav-3d #bc-3d-next {
    width: 100%;
    min-height: 42px;
    text-align: center;
  }

  #bc-modal.bc-modal--mode-3d.bc-modal--3d-step-3 .bc-modal-footer-nav-3d {
    display: none;
  }
}
