/* Menu Manager — Front-End Staff Editor Styles
 * Matches the visual language of the Specials Manager (orange #e67e22 accent).
 */

.mm-editor-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  color: #2c3e50;
  box-sizing: border-box;
}
.mm-editor-wrap *, .mm-editor-wrap *::before, .mm-editor-wrap *::after { box-sizing: border-box; }

/* Card */
.mm-card {
  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
}

/* Typography */
.mm-title    { font-size: 26px; font-weight: 700; color: #2c3e50; margin: 0 0 6px 0; letter-spacing: 0.2px; }
.mm-subtitle { color: #7f8c8d; font-size: 14px; margin: 0 0 24px 0; }
.mm-label    { display: block; font-size: 13px; font-weight: 600; color: #2c3e50; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.6px; }
.mm-section-title {
  font-size: 18px; font-weight: 700; color: #2c3e50;
  margin: 28px 0 14px 0; padding-bottom: 8px;
  border-bottom: 2px solid #e67e22; display: inline-block;
}

/* Inputs */
.mm-input, .mm-textarea {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid #d8dde2; border-radius: 6px;
  background: #fff; color: #2c3e50; font-family: inherit;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.mm-textarea { resize: vertical; min-height: 70px; }
.mm-input:focus, .mm-textarea:focus {
  border-color: #e67e22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}
.mm-field { margin-bottom: 16px; }

/* Buttons */
.mm-btn {
  background: #e67e22; color: #ffffff; border: none;
  padding: 12px 22px; font-size: 16px; font-weight: 600;
  border-radius: 6px; cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 0.05s;
  touch-action: manipulation; min-height: 44px;
  -webkit-appearance: none; appearance: none;
}
.mm-btn:hover   { background: #d35400; }
.mm-btn:active  { transform: translateY(1px); }
.mm-btn:disabled { background: #bdc3c7; cursor: not-allowed; }

.mm-btn-secondary {
  background: transparent; color: #2c3e50;
  border: 1px solid #d8dde2;
}
.mm-btn-secondary:hover { background: #f4f6f8; }

.mm-btn-danger {
  background: transparent; color: #c0392b;
  border: 1px solid #e8c4bf;
}
.mm-btn-danger:hover { background: #fdf3f1; }

.mm-btn-small { padding: 6px 12px; font-size: 13px; min-height: 34px; }

/* Header bar */
.mm-header-bar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #ecedef;
}

/* Category tabs */
.mm-toggle-group {
  display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.mm-toggle-btn {
  background: #ffffff; color: #2c3e50;
  border: 1px solid #d8dde2; border-radius: 6px;
  padding: 7px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  touch-action: manipulation; min-height: 36px;
}
.mm-toggle-btn:hover { background: #f4f6f8; }
.mm-toggle-active, .mm-toggle-active:hover {
  background: #e67e22; color: #ffffff; border-color: #e67e22;
}

/* ── Sub-tab row ─────────────────────────────────────────────────────────── */
.mm-sub-tab-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e6e9ec;
}
.mm-sub-tab {
  font-size: 13px;
  padding: 5px 13px;
  min-height: 30px;
  border-radius: 4px;
  color: #5d6d7e;
  border-color: #e6e9ec;
}
.mm-sub-tab:hover { background: #f0f2f4; color: #2c3e50; }
.mm-sub-tab.mm-toggle-active,
.mm-sub-tab.mm-toggle-active:hover {
  background: #e67e22; color: #ffffff; border-color: #e67e22;
}

/* Item rows */
.mm-item-row {
  background: #fafbfc; border: 1px solid #ecedef;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  cursor: default;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mm-item-row[draggable="true"] { cursor: grab; }
.mm-item-row[draggable="true"]:active { cursor: grabbing; }
.mm-item-row.mm-drag-over {
  border-color: #e67e22;
  box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.25);
}
.mm-item-info { flex: 1; min-width: 0; }
.mm-item-name-row  { font-size: 16px; font-weight: 700; color: #2c3e50; margin: 0 0 4px 0; }
.mm-item-desc-row  { color: #5d6d7e; font-size: 14px; margin: 0 0 6px 0; line-height: 1.4; }
.mm-item-price-row { color: #e67e22; font-weight: 700; font-size: 15px; }
.mm-item-actions   { display: flex; gap: 8px; flex-shrink: 0; }

/* Drag handle — braille-dot icon ⠿ */
.mm-item-row .mm-drag-handle {
  color: #c5cdd5;
  font-size: 18px;
  line-height: 1;
  cursor: grab;
  flex-shrink: 0;
  align-self: center;
  user-select: none;
  -webkit-user-select: none;
  padding-right: 4px;
  transition: color 0.15s;
}
.mm-item-row:hover .mm-drag-handle { color: #95a5a6; }
.mm-item-row[draggable="true"]:active .mm-drag-handle { cursor: grabbing; }

/* Status messages */
.mm-status {
  margin-top: 12px; padding: 10px 14px; border-radius: 6px;
  font-size: 14px; display: none;
}
.mm-status-success { background: #eafaf1; color: #1e8449; border: 1px solid #c8ecd8; }
.mm-status-error   { background: #fdedec; color: #b03a2e; border: 1px solid #f5c6cb; }

/* Misc */
.mm-empty   { text-align: center; padding: 32px 16px; color: #7f8c8d; background: #fafbfc; border: 1px dashed #d8dde2; border-radius: 8px; font-size: 14px; }
.mm-loading { text-align: center; padding: 24px; color: #7f8c8d; font-size: 14px; }
.mm-hidden  { display: none !important; }
.mm-form-actions { margin-top: 8px; }
.mm-cancel-link {
  display: inline-block; margin-left: 12px; color: #7f8c8d;
  font-size: 14px; cursor: pointer; text-decoration: underline;
}
.mm-cancel-link:hover { color: #2c3e50; }

/* ── Save-to-library checkbox row ────────────────────────────────────────── */
.mm-save-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d8dde2;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.mm-save-row:hover { border-color: #e67e22; background: #fef9f5; }
.mm-save-row input[type="checkbox"] {
  margin-top: 3px; flex-shrink: 0;
  accent-color: #e67e22; width: 16px; height: 16px; cursor: pointer;
}
.mm-save-checked { border-color: #e67e22 !important; background: #fef5eb !important; }
.mm-save-title { font-size: 14px; font-weight: 600; color: #2c3e50; line-height: 1.3; }
.mm-save-hint  { font-size: 12px; color: #7f8c8d; margin-top: 3px; }

/* ── Saved tab button (sits inline with toggle-group) ────────────────────── */
.mm-saved-tab-btn {
  background: #ffffff; color: #2c3e50;
  border: 1px solid #d8dde2; border-radius: 6px;
  padding: 7px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  touch-action: manipulation; min-height: 36px;
  margin-top: 10px; margin-left: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
.mm-saved-tab-btn:hover { background: #f4f6f8; }
.mm-saved-tab-btn.mm-toggle-active,
.mm-saved-tab-btn.mm-toggle-active:hover {
  background: #e67e22; color: #ffffff; border-color: #e67e22;
}

/* Count pill on the Saved tab */
.mm-count-pill {
  background: #c0392b; color: #ffffff;
  font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; line-height: 1.5;
}
.mm-saved-tab-btn.mm-toggle-active .mm-count-pill {
  background: rgba(255, 255, 255, 0.35);
}

/* ── Saved library list ───────────────────────────────────────────────────── */
.mm-saved-intro { color: #7f8c8d; font-size: 14px; margin: 0 0 18px 0; line-height: 1.5; }

.mm-saved-item {
  background: #fafbfc; border: 1px solid #ecedef;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap;
}
.mm-saved-info { flex: 1; min-width: 0; }
.mm-saved-item-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0;
}

/* Quick Add button — orange primary, smaller */
.mm-quick-add-btn {
  background: #e67e22; color: #ffffff; border: none;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  border-radius: 6px; cursor: pointer; font-family: inherit;
  min-height: 34px; touch-action: manipulation;
  transition: background 0.15s;
  -webkit-appearance: none; appearance: none;
}
.mm-quick-add-btn:hover    { background: #d35400; }
.mm-quick-add-btn:disabled { background: #bdc3c7; cursor: not-allowed; }

/* ── Library add form ────────────────────────────────────────────────────── */
.mm-add-library-link {
  display: inline-block; margin-top: 16px;
  color: #e67e22; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: underline;
  user-select: none; -webkit-user-select: none;
}
.mm-add-library-link:hover { color: #d35400; }

.mm-library-form {
  margin-top: 16px; padding: 18px 18px 14px 18px;
  background: #fafbfc; border: 1px solid #ecedef; border-radius: 8px;
}
.mm-library-form-title {
  font-size: 13px; color: #7f8c8d; margin: 0 0 16px 0;
  font-style: italic; line-height: 1.4;
}

/* ── On/Off toggle switch ────────────────────────────────────────────────── */
.mm-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  transition: background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.mm-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s;
  pointer-events: none;
  display: block;
}
.mm-switch-on  { background: #27ae60; }
.mm-switch-off { background: #bdc3c7; }
.mm-switch-on  .mm-switch-thumb { transform: translateX(16px); }
.mm-switch-off .mm-switch-thumb { transform: translateX(0); }
.mm-switch:hover.mm-switch-off  { background: #a0a9b0; }
.mm-switch:disabled              { opacity: 0.4; cursor: not-allowed; }

/* Inactive item rows */
.mm-item-inactive {
  opacity: 0.45;
}
.mm-item-inactive .mm-item-name-row {
  text-decoration: line-through;
  color: #7f8c8d;
}

/* ── Grouped section headers ─────────────────────────────────────────────── */
.mm-section-group {
  margin-bottom: 30px;
}

.mm-section-group-header {
  font-size: 15px;
  font-weight: 700;
  color: #2c3e50;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid #e67e22;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.mm-section-general {
  font-size: 12px;
  font-weight: 400;
  color: #95a5a6;
  font-style: italic;
}

.mm-section-empty-note {
  color: #95a5a6;
  font-size: 13px;
  font-style: italic;
  padding: 8px 0 4px 2px;
}

/* Mobile */
@media (max-width: 540px) {
  .mm-editor-wrap { padding: 16px 12px; }
  .mm-card        { padding: 20px 16px; }
  .mm-item-row    { flex-direction: row; flex-wrap: wrap; }
  .mm-item-row .mm-drag-handle { order: -1; }
  .mm-item-info   { width: calc(100% - 36px); }
  .mm-item-actions { width: 100%; order: 3; }
  .mm-header-bar  { flex-direction: column; align-items: flex-start; gap: 12px; }
  .mm-saved-item  { flex-direction: column; }
  .mm-saved-item-actions { width: 100%; flex-wrap: wrap; }
  .mm-quick-cat-select { width: 100% !important; min-width: 0 !important; }
}
