/*
 * Tooltips in the theme's look (web/js/satrunner-tooltip.js, owner, 4 November 2026): a dark bubble in
 * theme.secondary (#3B3A38) with white Montserrat 12px, 8px corners, 8 | 12px inside, a soft shadow and a pointer towards the element
 * (its position in --sr-tip-x); above the element, below it (sr-tip--below) when there's no room. Fades in.
 * Line breaks in the title are kept (the order list's delivery address shows one part per line).
 * Docs: docs/tooltips.html
 */
.sr-tip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    box-sizing: border-box;
    max-width: min(280px, calc(100vw - 16px));
    padding: 8px 12px;
    border-radius: 8px;
    background: #3b3a38;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    text-align: left;
    white-space: pre-line; /* a line break in the title starts a new line (e.g. an address, one part per line) */
    overflow-wrap: anywhere;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

.sr-tip.is-shown {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.sr-tip--below {
    transform: translateY(-4px);
}

/* The pointer: an 8px turned square half under the bubble (over it when the bubble is below); all sizes on the
   theme's 4px grid */
.sr-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--sr-tip-x, 50%);
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 0 0 2px 0;
    background: inherit;
    transform: rotate(45deg);
}

.sr-tip--below::after {
    top: auto;
    bottom: 100%;
    margin: 0 0 -4px -4px;
    border-radius: 2px 0 0 0;
}

@media (prefers-reduced-motion: reduce) {
    .sr-tip,
    .sr-tip.is-shown {
        transform: none;
        transition: none;
    }
}
