/* ==========================
   INFO TOOLTIP
   Small "(i)" disclosure button used to explain how a control works (Near Me,
   map filters/pins). Toggled by assets/js/info-tooltip.js on click/tap rather
   than driven by :hover like the single-shop share-button tooltips — this is
   meant to be readable on touch devices, where hover never fires.
========================== */

.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    padding: 0;
}

.info-tooltip__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(60, 40, 30, 0.25);
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
button.info-tooltip__btn {
    padding: 0;
}
.info-tooltip__btn:hover,
.info-tooltip__btn:focus-visible,
.info-tooltip.is-open .info-tooltip__btn {
    background: rgba(251, 146, 60, 0.14);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.info-tooltip__btn svg {
    width: 10px;
    height: 10px;
}

/* Floating variant sits directly on the map (no card behind it), so it needs
   its own shadow to read as a tappable control the way the filter pill next
   to it already does. */
.info-tooltip__btn--floating {
    width: 34px;
    height: 34px;
    background: var(--color-surface);
    border: 0;
    box-shadow: var(--shadow-card);
}

.info-tooltip__btn--floating svg {
    width: 15px;
    height: 15px;
}

.info-tooltip__bubble {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    width: max-content;
    max-width: 220px;
    background: var(--color-text-dark);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000000;
}

.info-tooltip__bubble::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--color-text-dark);
}

.info-tooltip.is-open .info-tooltip__bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Right-aligned variant for controls that sit near the right edge of the
   viewport (e.g. the floating map filter button) — a centered bubble would
   otherwise overflow off-screen. */
.info-tooltip--align-right .info-tooltip__bubble {
    left: auto;
    right: 0;
    transform: translateY(-4px);
}

.info-tooltip--align-right .info-tooltip__bubble::after {
    left: auto;
    right: 12px;
    transform: none;
}

.info-tooltip--align-right.is-open .info-tooltip__bubble {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .info-tooltip__bubble {
        max-width: 180px;
    }
}
