/*
 * Wimakeit_StockStatus — the status line.
 *
 * Plain CSS loaded from the layout rather than LESS partials: those reach Luma
 * through its auto-bundle and Hyvä through a Tailwind rebuild in the theme, and
 * a status that renders unstyled on a Hyvä storefront is a coloured promise
 * with no colour. Twenty lines with no theme coupling do not justify a build
 * step on six sites.
 *
 * The colour arrives as a custom property set per product by the template, so
 * one rule paints its own marker without a stylesheet per rule.
 */
.wm-stock-status {
    --wm-stock-status-color: currentColor;

    align-items: center;
    color: var(--wm-stock-status-color);
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    gap: 6px;
    line-height: 1.3;
}

.wm-stock-status[hidden] {
    display: none;
}

.wm-stock-status__mark {
    align-items: center;
    display: inline-flex;
}

/* The icons are stroke-based and inherit the colour, so one value drives both
   the mark and the words. */
.wm-stock-status__icon {
    height: 1em;
    width: 1em;
}

.wm-stock-status__mark:empty {
    display: none;
}

/*
 * Standing down the theme's own availability line.
 *
 * A page that shows both says two things at once, and this is the module's
 * decision to make, not the theme's: the theme cannot know whether a rule
 * matched without asking, and asking in a template means the same three-line
 * conditional copied into every place a status appears — a product page, a
 * listing card, a search result — each free to get it subtly wrong.
 *
 * So the theme states its intent once, by marking its own line
 * `wm-stock-fallback` and placing it after the status block, and the module
 * decides. A product no rule matched renders no status at all, the selector
 * does not match, and the theme's line stays exactly as it was — which is the
 * behaviour a shop wants, since a page silent about availability is worse than
 * one saying it in the theme's own words.
 *
 * `.wm-stock-replace` is the merchant's choice, put on the body by the status
 * block: Display > Native Stock Information, "replace" rather than "after".
 * Without that scope this stylesheet quietly replaced on every install,
 * whatever the setting said — the setting was still in the admin, still
 * documented, and no longer connected to anything.
 *
 * Listings drawn asynchronously need more than this, because there the answer
 * is not on the page yet — see Wimakeit_StockStatusMeilisearch.
 */
.wm-stock-replace .wm-stock-status ~ .wm-stock-fallback {
    display: none;
}
