.menu-category-list { display: contents; }
.menu-category-item { display: inline-flex; position: relative; }
.menu-category-help { flex-basis: 100%; font-size: 14px; margin: 8px 0; }

/* Site-owned order panel is never rendered for visitors. */
.home-order-panel { max-width: 720px; margin: 24px auto; padding: 16px; background: var(--cream); color: var(--dark); border-radius: 8px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); }
.home-order-panel summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; }
.home-order-panel summary:focus-visible { outline: 2px solid #4054ef; outline-offset: 4px; }
.home-order-panel p { margin: 8px 0 16px; font-size: 14px; }
.home-order-row { min-height: 48px; padding: 12px 64px 12px 16px; margin: 4px 0; box-shadow: inset 0 -1px rgba(0,0,0,.1); }
.home-order-list .list-hide-btn, .home-order-list .list-delete-btn,
.home-order-list .list-item-add-btn, .home-order-list .list-add-btn { display: none !important; }
.home-order-list .list-drag-handle { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 760px) { .home-order-panel { margin: 16px; } }

/* The optional card leaves no empty grid column, including in edit mode. */
.atmosphere-photos.atmosphere-photos--single {
  grid-template-columns: minmax(0, 1fr);
}
.atmosphere-photos > .atmosphere-table[hidden],
.atmosphere-photos > [data-atmosphere-layout-state] {
  display: none !important;
}

/* Keep Nibbly's admin chrome, while Luna owns the public page shell. */
body.luna-page > .site-header,
body.luna-page > .footer,
body.luna-page > a.skip-link {
  display: none !important;
}

body.luna-page {
  margin: 0;
  overflow-x: hidden;
}

/* Nibbly's global `a:hover { color: blue }` must not leak into Luna. :where()
   keeps this at the same weight as Nibbly's rule (wins by load order), so Luna's
   own hovers (.primary-nav a:hover, .link-arrow:hover…) still take precedence. */
:where(body.luna-page) a:hover {
  color: inherit;
}
/* Nibbly's `a:hover` outranks Luna's .btn--* colour classes, so pin the button text
   to its design-system colour; on hover Luna buttons change only their background. */
body.luna-page a.btn--primary:hover,
body.luna-page a.btn--light:hover {
  color: var(--dark);
}
body.luna-page a.btn--dark:hover {
  color: var(--cream);
}

/* Edit mode only: booking dialog opens non-modally so editor modals stay on top. */
body.edit-mode-active .booking-dialog[open]:not(:modal) {
  position: fixed;
  inset: 0;
  z-index: 9000;
  margin: auto;
  height: fit-content;
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

/* Edit mode only: Nibbly's `.nibbly-editor-group-overlay { position: relative }`
   overrides the overlay's own `position: absolute` (with !important), so on hover the "Edit" button
   joins the text flow and stretches links/blocks. Keep it out of the flow. */
body.edit-mode-active.luna-page .editable-group-active > .editable-group-overlay {
  position: absolute !important;
}

/* Edit mode only: place the link-group "Edit" button beside the link. */
body.edit-mode-active a.editable-group-active > .editable-group-overlay {
  top: 50%;
  left: 100%;
  right: auto;
  margin-left: 6px;
  border-radius: 4px;
  transform: translateY(-50%);
  white-space: nowrap;
}
body.edit-mode-active a.editable-group-active {
  position: relative;
}

/* Edit mode only: Nibbly wraps images in an inline-block div, which breaks
   Luna's width:100% / absolute image layouts. Let the wrapper vanish from
   layout (events still bubble through it) and show the hover outline on the image. */
body.luna-page .editable-image-wrapper {
  display: contents !important;
}
body.edit-mode-active.luna-page .editable-image-wrapper > img:hover {
  outline: 2px dashed var(--editor-primary, #2563eb);
  outline-offset: -2px;
  cursor: pointer;
}

/* Edit mode only: list cards clip overflow for their rounded corners, which also
   cut off Nibbly's "+" button that hangs half below the item. Let it show and
   keep the photo corners rounded on the media block instead. */
body.edit-mode-active.luna-page .editable-list-item.dish-card,
body.edit-mode-active.luna-page .editable-list-item.card {
  overflow: visible;
}
body.edit-mode-active.luna-page .dish-card-media {
  border-radius: var(--radius) var(--radius) 0 0;
}
body.edit-mode-active.luna-page .editable-list-item .list-item-add-btn {
  z-index: 5;
}

/* Edit mode only: the dish dialog does not open while editing, so show its texts
   (description and rich-text details) right on the card, where Nibbly's inline
   editors (plain text and rich text with B / I / link) work. */
body.edit-mode-active.luna-page .dish-card-description[hidden],
body.edit-mode-active.luna-page .dish-card-details[hidden] {
  display: block;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--line);
}
body.edit-mode-active.luna-page .dish-card-description[hidden] {
  color: var(--muted);
  font-size: var(--fs-small);
}
body.edit-mode-active.luna-page .dish-card-description[hidden]::before,
body.edit-mode-active.luna-page .dish-card-details[hidden]::before {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--olive);
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
}
body.edit-mode-active.luna-page .dish-card-description[hidden]::before { content: "В окне блюда: описание"; }
body.edit-mode-active.luna-page .dish-card-details[hidden]::before { content: "В окне блюда: подробнее"; }
body.edit-mode-active.luna-page .dish-card-details .editable-field {
  display: block;
  min-height: 1.6em;
}
body.edit-mode-active.luna-page .dish-card-details .editable-field:empty::before {
  content: "Нажмите, чтобы добавить текст";
  color: var(--muted);
  font-style: italic;
}
