/**
 * Stork Stock Status — info tooltip.
 *
 * Everything is scoped under `.stork-stock-status` so it cannot leak into the
 * theme. The badge stays color-able by the theme via the
 * `.stork-stock-status--{token}` modifier classes (untouched here). LTR only —
 * all store locales are left-to-right.
 *
 * Reveal logic (three OR'd triggers):
 *   - mouse hover         → `:hover` on the trigger
 *   - keyboard focus      → `:focus-within` on the wrapper
 *   - tap / click toggle  → `[aria-expanded="true"]` set by the JS
 */

.stork-stock-status {
    position: relative;          /* positioning context for the tooltip */
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

/* The "i" trigger — reset native button chrome. */
.stork-stock-status__info {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.stork-stock-status__info:focus {
    outline: none;               /* show a ring only for keyboard users (below) */
}

.stork-stock-status__info:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 50%;
}

/* The round "i" glyph. */
.stork-stock-status__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.75em;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    opacity: 0.75;
}

.stork-stock-status__info:hover .stork-stock-status__icon,
.stork-stock-status__info:focus-visible .stork-stock-status__icon {
    opacity: 1;
}

/* The tooltip bubble — hidden by default, opens upward to dodge clipping. */
.stork-stock-status__tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0.25em);
    margin-bottom: 0.5em;
    z-index: 10;
    max-width: 220px;
    width: max-content;
    padding: 0.4em 0.6em;
    border-radius: 6px;
    background: #1f2933;
    color: #fff;
    font-size: 0.8125em;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}

/* Little arrow under the bubble. */
.stork-stock-status__tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2933;
}

/* Reveal states. */
.stork-stock-status__info:hover + .stork-stock-status__tooltip,
.stork-stock-status:focus-within .stork-stock-status__tooltip,
.stork-stock-status__info[aria-expanded="true"] + .stork-stock-status__tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
