/*
 * AlterShops — listing availability chip (Lot I+ P3-a "dispo cross-canal").
 * A small qualitative "dispo à ma boutique" pill injected on each listing card
 * by pickup-availability.js. Loaded on listing controllers only when the
 * altercheckout PDP-unified flag is ON (OFF = not registered = byte-identical).
 * Colour vocabulary kept consistent with the P0 context bar open/closed dots.
 */

.apc-avail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  background: #f1f1f5;
  color: #2b2b35;
  max-width: 100%;
}

.apc-avail__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b6b78;
}

.apc-avail__txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* in stock — green */
.apc-avail--in { background: #eaf6ee; color: #157f3a; }
.apc-avail--in .apc-avail__dot { background: #1f9d4d; }

/* last pieces — amber */
.apc-avail--low { background: #fdf3e3; color: #9a6700; }
.apc-avail--low .apc-avail__dot { background: #d08700; }

/* unavailable here — muted red (a real confirmed zero, never an unknown) */
.apc-avail--out { background: #fbecea; color: #b53030; }
.apc-avail--out .apc-avail__dot { background: #c93434; }

/* indeterminate — neutral grey, NEVER rendered like a false "Indisponible" */
.apc-avail--unknown { background: #f0f0f4; color: #6b6b78; }
.apc-avail--unknown .apc-avail__dot { background: #9a9aa6; }

/* The unknown chip carries the longer canonical actionable wording
   ("Indéterminé · à vérifier en boutique", OMNI-LOT-18 / OT-OWN-F5). Let ONLY
   this chip wrap instead of ellipsis-truncating, so the "· à vérifier en
   boutique" hint is never hidden on a narrow card ; soften the radius for the
   multi-line tag and top-align the dot with the first line. The in/low/out
   chips stay single-line pills (byte-identical to <=1.30.0). */
.apc-avail--unknown {
  align-items: flex-start;
  border-radius: 12px;
}
.apc-avail--unknown .apc-avail__dot { margin-top: 5px; }
.apc-avail--unknown .apc-avail__txt { white-space: normal; }

/* ───────────── CX-03 optional "available in my boutique" filter ─────────────
   A second row of the listing context bar (.apc-bar--listing, styled in
   pickup-context-bar.css) holding a toggle + an honest live count + a reset.
   Tokens come from pickup-context-bar.css (loaded sitewide when the flag is ON,
   so present on every listing) ; literal fallbacks for safety. The toggle starts
   [hidden] and is revealed by pickup-availability.js only once chips exist. */
.apc-listing-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  flex-basis: 100%;
  margin-top: 2px;
  font-size: 13px;
}
.apc-listing-filter[hidden] { display: none; }

.apc-listing-filter__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  cursor: pointer;
  font-weight: 700;
  color: var(--apc-ink, #2b2b35);
}
.apc-listing-filter__cb {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--apc-amaranth, #e62249);
  cursor: pointer;
}
.apc-listing-filter__label { line-height: 1.3; }

/* honest live count — never silently drops products (the count and the reset
   stay visible so the client always knows what the toggle hid). */
.apc-listing-filter__count {
  color: var(--apc-muted, #6b6b78);
  font-weight: 600;
}

.apc-listing-filter__reset {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--apc-amaranth, #e62249);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.apc-listing-filter__reset:hover { color: #c11339; }
.apc-listing-filter__reset[hidden] { display: none; }

/* the toggle hides a card by collapsing its grid column (the miniature carries
   the col-* classes), so the row reflows with no empty gap. */
.js-product-miniature.apc-avail-hidden { display: none !important; }
