/* PSF - Commande rapide v0.16.0
   CSS nettoyé : grille, image, ref/prix, quantité, barre uniquement. */

/* Catalogue pleine largeur uniquement sur le parent réellement détecté par le JS */
.psf-qo-sidebar-only {
  display: none !important;
}
.psf-qo-catalog-host {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Grille */
#js-product-list .products {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: -3px !important;
  margin-right: -3px !important;
}

#js-product-list .products > .psf-qo-col {
  box-sizing: border-box !important;
  padding-left: 3px !important;
  padding-right: 3px !important;
  margin-bottom: 8px !important;
}

@media (min-width: 992px) {
  #js-product-list .products > .psf-qo-col {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  #js-product-list .products > .psf-qo-col {
    flex: 0 0 33.3333% !important;
    width: 33.3333% !important;
    max-width: 33.3333% !important;
  }
}

@media (max-width: 767px) {
  #js-product-list .products > .psf-qo-col {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
  }
}

/* Carte */
#js-product-list .psf-qo-col .product-miniature,
#js-product-list .psf-qo-col .thumbnail-container {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* IMAGE : zone portée à 288px pour rendre l'agrandissement réellement visible. */
#js-product-list .psf-qo-col a.product-thumbnail {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 288px !important;
  min-height: 288px !important;
  max-height: 288px !important;
  overflow: hidden !important;
  position: relative !important;
}

#js-product-list .psf-qo-col a.product-thumbnail > img {
  display: block !important;
  width: 288px !important;
  height: 288px !important;
  min-width: 288px !important;
  min-height: 288px !important;
  max-width: 288px !important;
  max-height: 288px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  position: static !important;
  transform: none !important;
}

/* Description */
#js-product-list .psf-qo-col .product-description {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 5px 3px 7px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

#js-product-list .psf-qo-col .product-title,
#js-product-list .psf-qo-col .product-name {
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Référence à gauche / prix à droite :
   une seule ligne créée par notre JS, sans séparateur artificiel. */
.psf-qo-refprice-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 3px 0 4px !important;
  padding: 0 !important;
}

.psf-qo-ref {
  min-width: 0 !important;
  justify-self: start !important;
  text-align: left !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.psf-qo-price {
  justify-self: end !important;
  text-align: right !important;
  margin-left: 0 !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

/* Masquage explicite des éléments natifs une fois recopiés */
.psf-qo-hide-original {
  display: none !important;
}

/* Aucun bouton Ajouter au panier individuel */
#js-product-list [data-button-action="add-to-cart"],
#js-product-list .add-to-cart {
  display: none !important;
}

/* Quantité */
.psf-qo-control {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  margin: 4px 0 6px !important;
  min-height: 32px !important;
}

.psf-qo-control button {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
}

.psf-qo-qty {
  width: 48px !important;
  height: 28px !important;
  text-align: center !important;
}

.psf-qo-state {
  font-size: 10px !important;
  line-height: 1.15 !important;
  max-width: 145px !important;
}

.psf-qo-error {
  outline: 3px solid #c62828 !important;
  outline-offset: -3px !important;
}
.psf-qo-added {
  opacity: .62 !important;
}

/* Barre */
.psf-qo-bar {
  position: sticky !important;
  top: 0 !important;
  z-index: 900 !important;
  background: #fff !important;
  border-bottom: 1px solid #ccc !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.12) !important;
  padding: 9px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
  margin-bottom: 12px !important;
}

.psf-qo-counters {
  display: flex !important;
  gap: 18px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

#psf-qo-submit {
  display: none;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

#psf-qo-message {
  width: 100% !important;
  text-align: center !important;
  font-size: 12px !important;
  min-height: 0 !important;
}

@media (max-width: 991px) {
  .psf-qo-bar {
    flex-wrap: wrap !important;
  }
}


/* V0.18 : 4 colonnes compactes, gouttières 6px */
#js-product-list,
#js-product-list .products {
  padding-left:0!important;
  padding-right:0!important;
}

#js-product-list .products > .psf-qo-col {
  padding-left:3px!important;
  padding-right:3px!important;
}

#js-product-list .psf-qo-col .thumbnail-container {
  margin-left:0!important;
  margin-right:0!important;
}

#js-product-list .psf-qo-col .product-description {
  padding-left:3px!important;
  padding-right:3px!important;
}


/* V0.19 — correction des seuls stocks insuffisants */
.psf-qo-stock-modal {
  display:none;
  position:fixed;
  inset:0;
  z-index:10050;
  background:rgba(0,0,0,.48);
  padding:18px;
  overflow:auto;
}
.psf-qo-stock-modal.is-open {
  display:flex;
  align-items:center;
  justify-content:center;
}
.psf-qo-stock-dialog {
  width:min(760px,100%);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border-radius:6px;
  box-shadow:0 8px 30px rgba(0,0,0,.28);
  padding:18px;
}
.psf-qo-stock-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:20px;
  margin-bottom:6px;
}
.psf-qo-stock-close {
  border:0;
  background:transparent;
  font-size:30px;
  line-height:1;
  cursor:pointer;
}
.psf-qo-stock-intro {
  margin:0 0 14px;
}
.psf-qo-stock-table {
  width:100%;
  border-collapse:collapse;
}
.psf-qo-stock-table th,
.psf-qo-stock-table td {
  padding:9px 7px;
  border-bottom:1px solid #ddd;
  text-align:left;
  vertical-align:middle;
}
.psf-qo-stock-newqty {
  width:76px;
  min-height:38px;
  text-align:center;
  font-size:16px;
}
.psf-qo-stock-actions {
  display:flex;
  justify-content:flex-end;
  margin-top:16px;
}
.psf-qo-stock-confirm {
  min-height:44px;
  padding:9px 16px;
  font-weight:700;
}
.psf-qo-stock-message {
  margin-top:9px;
  font-weight:600;
}

@media (max-width: 600px) {
  .psf-qo-stock-modal {
    padding:8px;
    align-items:flex-start;
  }
  .psf-qo-stock-dialog {
    padding:13px;
    margin-top:10px;
  }
  .psf-qo-stock-table thead {
    display:none;
  }
  .psf-qo-stock-table,
  .psf-qo-stock-table tbody,
  .psf-qo-stock-table tr,
  .psf-qo-stock-table td {
    display:block;
    width:100%;
  }
  .psf-qo-stock-table tr {
    padding:8px 0;
    border-bottom:2px solid #ddd;
  }
  .psf-qo-stock-table td {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    border:0;
    padding:5px 0;
  }
  .psf-qo-stock-table td::before {
    content:attr(data-label);
    font-weight:700;
  }
  .psf-qo-stock-confirm {
    width:100%;
  }
}


/* V0.20 — sécurité 4 colonnes après tri/rechargement AJAX */
@media (min-width: 992px) {
  #js-product-list .products > *,
  .products > .product-miniature,
  .products > .js-product-miniature {
    flex: 0 0 25% !important;
    max-width: 25% !important;
    width: 25% !important;
  }
}


/* V0.22 — conserver les mêmes marges et tailles d'image après un tri */
#js-product-list .products {
  margin-left:-3px !important;
  margin-right:-3px !important;
  padding-left:0 !important;
  padding-right:0 !important;
}

#js-product-list .products > * {
  padding-left:3px !important;
  padding-right:3px !important;
  margin-bottom:8px !important;
  box-sizing:border-box !important;
}

#js-product-list .products .product-miniature,
#js-product-list .products .thumbnail-container {
  margin-left:0 !important;
  margin-right:0 !important;
}

#js-product-list .products a.product-thumbnail {
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:288px !important;
  min-height:288px !important;
  max-height:288px !important;
  overflow:hidden !important;
}

#js-product-list .products a.product-thumbnail > img {
  width:288px !important;
  height:288px !important;
  min-width:288px !important;
  min-height:288px !important;
  max-width:288px !important;
  max-height:288px !important;
  object-fit:contain !important;
  margin:0 auto !important;
}

@media (max-width: 1200px) and (min-width: 768px) {
  #js-product-list .products a.product-thumbnail {
    height:250px !important;
    min-height:250px !important;
    max-height:250px !important;
  }
  #js-product-list .products a.product-thumbnail > img {
    width:250px !important;
    height:250px !important;
    min-width:250px !important;
    min-height:250px !important;
    max-width:250px !important;
    max-height:250px !important;
  }
}

@media (max-width: 767px) {
  #js-product-list .products > * {
    padding-left:3px !important;
    padding-right:3px !important;
  }
  #js-product-list .products a.product-thumbnail {
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
  }
  #js-product-list .products a.product-thumbnail > img {
    width:100% !important;
    height:auto !important;
    min-width:0 !important;
    min-height:0 !important;
    max-width:100% !important;
    max-height:none !important;
  }
}


/* V0.23 — tri référence à côté du tri PrestaShop */
.psf-qo-ref-sort-wrap {
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-left:12px;
  vertical-align:middle;
  white-space:nowrap;
}
.psf-qo-ref-sort-wrap label {
  margin:0;
  font-weight:600;
  font-size:13px;
}
#psf-qo-ref-sort {
  width:180px;
  height:36px;
  padding:4px 8px;
  font-size:13px;
}

.sort-by-row,
.products-sort-order,
#js-product-list-top {
  align-items:center;
}

@media (max-width: 767px) {
  .psf-qo-ref-sort-wrap {
    display:flex;
    width:100%;
    margin:8px 0 0;
    justify-content:flex-end;
  }
  #psf-qo-ref-sort {
    width:190px;
  }
}


/* V0.26 - second contrôle de stock depuis le panier */
.psf-qo-checkout-notice{margin:12px 0;padding:12px 14px;background:#fff;border-left:4px solid #25b9d7;box-shadow:0 1px 3px rgba(0,0,0,.12);font-weight:600;line-height:1.4}
.psf-qo-checkout-correct{background:#25b9d7;color:#fff;border:0;padding:10px 16px;font-weight:700;cursor:pointer}
.psf-qo-checkout-correct:disabled{opacity:.55;cursor:wait}
.psf-qo-checkout-newqty{width:74px;text-align:center;padding:6px}
.psf-qo-checking{opacity:.65;pointer-events:none}
