/* PrestaShop Web Design — stock row + fixed color bar */

.pswsb {
  --pswsb-track: #e6e2ec;
  --pswsb-bar-width: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 0;
  contain: layout style paint;
  clear: both;
  box-sizing: border-box;
}

.pswsb__label {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1.2;
  color: #222;
  white-space: nowrap;
}

.pswsb__track {
  flex: 0 0 var(--pswsb-bar-width);
  display: block;
  width: var(--pswsb-bar-width);
  max-width: var(--pswsb-bar-width);
  height: 12px;
  margin-left: auto;
  border-radius: 5px;
  background: var(--pswsb-track);
  overflow: hidden;
}

.pswsb__fill {
  display: block;
  width: calc(var(--pswsb-bar-width) * var(--pswsb-percent, 0) / 100);
  height: 100%;
  border-radius: inherit;
  background: var(--pswsb-color, #f59e0b);
  animation: pswsb-settle 1.35s cubic-bezier(0.25, 0.9, 0.35, 1) both;
  transition: width 0.45s cubic-bezier(0.25, 0.9, 0.35, 1), background-color 0.35s ease;
}

@keyframes pswsb-settle {
  0% {
    width: var(--pswsb-bar-width);
  }

  28% {
    width: var(--pswsb-bar-width);
  }

  100% {
    width: calc(var(--pswsb-bar-width) * var(--pswsb-percent, 0) / 100);
  }
}

.pswsb--listing {
  padding: 0;
  margin-top: 0;
}

.pswsb--listing .pswsb__label {
  font-size: 15px;
}

.pswsb--product {
  padding: 0;
}

.pswsb--product .pswsb__label {
  font-size: 15px;
}

/* Tight gap between Referencia (featuresBox) and stock bar */
.featuresBox {
  margin-bottom: 0;
  padding-bottom: 0;
  min-height: unset;
}

.featuresBox .header-bottom {
  margin-bottom: 0;
}

.product-miniature__infos .product-miniature__prices,
.product-price-and-shipping {
  margin-top: 0;
  padding-top: 0;
}

.featuresBox .pswsb,
.product-miniature__infos .pswsb,
.product-description .pswsb {
  margin-top: 0;
}

.product-price-and-shipping .pswsb,
.product__prices .pswsb,
.product-miniature__prices .pswsb {
  margin: 0;
  padding: 0 0 6px;
}

/* Product page — stock bar inline with Ref */
#product_details .details__item--reference-stock {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
}

#product_details .details__item--reference-stock .pswsb--product {
  width: auto;
  margin: 0;
  gap: 8px;
}

#product_details .details__item--stock {
  display: flex;
  align-items: center;
  padding: 5px 10px 0 0;
}

#product_details .details__item--stock .pswsb--product {
  width: auto;
  gap: 8px;
}

#product_details .details__list {
  flex-wrap: wrap;
  justify-content: flex-start;
}

@media (max-width: 575px) {
  #product_details .details__list {
    gap: 8px 12px;
  }

  #product_details .details__item--reference,
  #product_details .details__item--stock {
    flex: 0 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pswsb__fill {
    animation: none;
    width: calc(var(--pswsb-bar-width) * var(--pswsb-percent, 0) / 100);
    transition: width 0.2s ease, background-color 0.2s ease;
  }
}
