/* --- Action menu «…» (Figma «Lidfly дизайн-система» → Menu / Panel + Menu / Option) ---
   Rare actions of a row: a Button / Icon trigger and a panel of actions. The panel looks like
   the .lf-select list; destructive actions are red and go last after a divider.
   Markup and behaviour: public/js/lidfly-ui-menu.js, docs/DESIGN-SYSTEM.md → «Меню действий». */

.lf-menu {
  position: relative;
  display: inline-flex;
}

.lf-menu__panel {
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 2px;
  min-width: 240px;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-element);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-card);
}

.lf-menu__panel[hidden] {
  display: none;
}

.lf-menu--end .lf-menu__panel {
  right: 0;
  left: auto;
}

.lf-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.lf-menu__item:hover,
.lf-menu__item:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--color-brand) 12%, transparent);
  color: var(--color-brand-text);
}

.lf-menu__item--danger,
.lf-menu__item--danger:hover,
.lf-menu__item--danger:focus-visible {
  color: var(--btn-danger-fg);
}

.lf-menu__item--danger:hover,
.lf-menu__item--danger:focus-visible {
  background: var(--btn-danger-plain-hover);
}

.lf-menu__item:disabled {
  color: var(--color-text-muted);
  cursor: default;
  opacity: 0.6;
}

.lf-menu__divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--color-border);
}
