/**
 * PrestaHU
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Commercial License
 * you can't distribute, modify or sell this code
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file
 * If you need help please contact info@presta.hu
 *
 * @author    PrestaHU <info@presta.hu>
 * @copyright PrestaHU
 * @license   commercial
 */

/* Badges: PrestaShop 1.7.6+ puts them into .product-flags; colour and icon of each badge come from the inline style. */
.pshufb {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .25em .6em;
  font-size: var(--pshufb-size, .875rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  border-radius: var(--pshufb-radius, 4px);
  box-sizing: border-box;
}

.product-flags .pshufb,
.product-flag.pshufb {
  position: relative;
  margin: 0 0 .25rem;
}

.pshufb-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .35rem 0;
}

.pshufb-inline {
  position: static;
}

/* Corners: the list of flags sits in the corner of the image; the badge says on which side it wants to stand. */
.product-flags li.pshufb-tr,
.product-flags li.pshufb-br {
  align-self: flex-end;
  margin-left: auto;
}

.product-flags:has(.pshufb-tr, .pshufb-br) {
  display: flex;
  flex-direction: column;
}

.product-flags li.pshufb-bl,
.product-flags li.pshufb-br {
  order: 2;
}

/* Stock bar: segments plus the text of the level, so the colour is never the only sign. */
.pshufb-stock {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .5rem 0;
  font-size: .875rem;
  line-height: 1.3;
}

.pshufb-stock__bar {
  display: inline-flex;
  gap: 3px;
  flex: 0 0 auto;
}

.pshufb-stock__seg {
  display: block;
  width: 1.4rem;
  height: .5rem;
  border-radius: 2px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--pshufb-level, currentColor);
}

.pshufb-stock__seg.is-on {
  background: var(--pshufb-level, currentColor);
}

.pshufb-stock--list {
  font-size: .8125rem;
  margin: .25rem 0;
}

.pshufb-stock--list .pshufb-stock__seg {
  width: 1rem;
}

@media (forced-colors: active) {
  .pshufb {
    border: 1px solid CanvasText;
  }

  .pshufb-stock__seg {
    border: 1px solid CanvasText;
    box-shadow: none;
  }

  .pshufb-stock__seg.is-on {
    background: Highlight;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pshufb-stock__seg {
    transition: background-color .2s ease;
  }
}
