.js-tooltip { position: relative; display: inline-block; .tooltip__handle { background-color: var(--color-dark); border-radius: 50%; height: 1.5rem; width: 1.5rem; line-height: 1.5rem; font-size: 1.2rem; color: white; display: inline-block; text-align: center; cursor: default; margin: 0 10px; } .tooltip__content { position: absolute; top: -10px; transform: translateY(-100%); left: 3px; width: 275px; z-index: 10; background-color: #fafafa; border-radius: 4px; padding: 13px 17px; box-shadow: 0 0 20px 4px rgba(0, 0, 0, 0.1); &.to-left { left: auto; right: 3px; &::after { left: auto; right: 10px; } } &::after { content: ''; width: 16px; height: 16px; background-color: #fafafa; transform: rotate(45deg); position: absolute; left: 10px; bottom: -8px; } } .hidden { display: none; } } @media (max-width: 768px) { .js-tooltip { display: block; margin-top: 10px; .tooltip__content { left: 3px; right: 3px; width: auto; } } }