/**
 * hastone_stockwarning — indicateurs feu vert / feu rouge.
 * L'état est porté par la couleur ET par une icône ET par un libellé texte.
 */

.hsw-indicator {
  --hsw-green: #1e7e34;
  --hsw-green-bg: #e9f6ec;
  --hsw-red: #b3261e;
  --hsw-red-bg: #fdecea;

  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin: 0.75em 0;
  padding: 0.5em 0.75em;
  border-left: 4px solid currentColor;
  border-radius: 3px;
  /* em et non rem : le thème fixe html à 10px, les rem donneraient un texte minuscule. */
  font-size: 1em;
  line-height: 1.4;
}

.hsw-indicator[hidden],
.hsw-indicator [hidden] {
  display: none !important;
}

.hsw-indicator--green {
  color: var(--hsw-green);
  background: var(--hsw-green-bg);
}

.hsw-indicator--red {
  color: var(--hsw-red);
  background: var(--hsw-red-bg);
}

/* Pastille « feu » avec pictogramme : ✓ en vert, ! en rouge. */
.hsw-indicator__light {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-top: 0.05em;
  border-radius: 50%;
  background: currentColor;
  font-size: 0.875em;
  font-weight: 700;
  line-height: 1;
}

.hsw-indicator__light::before {
  color: #fff;
}

.hsw-indicator--green .hsw-indicator__light::before {
  content: "\2713";
}

.hsw-indicator--red .hsw-indicator__light::before {
  content: "!";
}

.hsw-indicator__text {
  display: flex;
  flex-direction: column;
}

.hsw-indicator__label {
  font-weight: 600;
}

.hsw-indicator__backorder,
.hsw-indicator__qty {
  font-size: 0.9375em;
}

.hsw-indicator.hsw-is-loading {
  opacity: 0.6;
}

/* Panier : version compacte, replacée par hsw-cart.js entre le nom et le prix. */
.hsw-cart-line-indicator {
  margin: 0.25em 0 0.5em;
}

.hsw-indicator--cart {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 0;
  padding: 0.35em 0.6em;
  font-size: 0.9375em;
}

.hsw-indicator--cart .hsw-indicator__light {
  margin-top: 0;
}

.hsw-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
