/* Allergen Information Icon Tooltip Styles */
.allergen-info-icon {
    position: relative;
    flex-shrink: 0;
    z-index: 10;
}

.allergen-info-icon svg {
    transition: transform 0.2s ease, color 0.2s ease;
}

.allergen-info-icon:hover svg {
    transform: scale(1.1);
}

/* Tooltip box - teleported to body, positioned fixed */
.allergen-tooltip-box {
    z-index: 99999;
    min-width: 170px;
    max-width: 250px;
    padding: 0.5rem 0.6rem;
    background-color: #111827;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    border-radius: 0.75rem;
    box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    white-space: normal;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
}

/* Tooltip arrow */
.allergen-tooltip-box.tooltip-top::after,
.allergen-tooltip-box.tooltip-bottom::after {
    content: '';
    position: absolute;
    left: var(--tooltip-arrow-left, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.allergen-tooltip-box.tooltip-top::after {
    top: 100%;
    border-top: 8px solid #111827;
}

.allergen-tooltip-box.tooltip-bottom::after {
    bottom: 100%;
    border-bottom: 8px solid #111827;
}

.allergen-tooltip-box.tooltip-side-left::after,
.allergen-tooltip-box.tooltip-side-right::after {
    display: none;
}

/* Hide by default with x-cloak */
[x-cloak] {
    display: none !important;
}

/* Ensure tooltip text is readable */
.allergen-tooltip-box strong {
    display: inline;
    margin-bottom: 0;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Prevent tooltip from causing layout shifts */
.allergen-info-icon {
    line-height: 0;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .allergen-tooltip-box {
        max-width: min(260px, calc(100vw - 16px));
    }
}

