/* Munica Discounts — dashboard buttons/modals + public menu discount UI */

/* ---------- Dashboard buttons ---------- */
.munica-section-head .munica-btn.munica-discount-btn,
.munica-section-head .munica-btn.munica-discount-manage-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.munica-section-head .munica-btn.munica-discount-btn:hover,
.munica-section-head .munica-btn.munica-discount-manage-btn:hover {
  background: #dbeafe;
}
.munica-section-head .munica-btn.munica-discount-manage-btn {
  background:var(--mm-w2,#f8fafc);
  color: #334155;
  border-color: #e2e8f0;
}

/* ---------- Modal ---------- */
.mun-disc-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: munDiscFade .15s ease-out;
}
@keyframes munDiscFade { from { opacity: 0 } to { opacity: 1 } }
.mun-disc-modal {
  background:var(--mm-w,#fff);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
  direction: rtl;
  font-family: inherit;
}
.mun-disc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.mun-disc-head h3 { margin: 0; font-size: 16px; color: #0f172a; }
.mun-disc-close {
  background: transparent; border: none; cursor: pointer;
  color: #64748b; font-size: 20px; line-height: 1;
  width: 32px; height: 32px; border-radius: 8px;
}
.mun-disc-close:hover { background:var(--mm-w2,#f1f5f9); color: #0f172a; }
.mun-disc-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.mun-disc-foot {
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex; gap: 8px; justify-content: flex-end;
  background:var(--mm-w2,#fafafa);
}
.mun-disc-foot .munica-btn { min-width: 120px; }

.mun-disc-field { margin-bottom: 14px; }
.mun-disc-field label {
  display: block; font-size: 13px; color: #334155;
  margin-bottom: 6px; font-weight: 600;
}
.mun-disc-field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  background:var(--mm-w,#fff);
}
.mun-disc-field input[type="number"]:focus { border-color: #3b82f6; }
.mun-disc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.mun-disc-items-hint {
  font-size: 12px; color: #64748b; margin: 6px 0 10px;
}
.mun-disc-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
}
.mun-disc-search:focus { border-color: #3b82f6; }

.mun-disc-menu-group {
  margin-bottom: 12px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
}
.mun-disc-menu-group h4 {
  margin: 0;
  padding: 8px 12px;
  background:var(--mm-w2,#f8fafc);
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}
.mun-disc-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 10px;
}
.mun-disc-item-chip {
  border: 2px solid #e2e8f0;
  background:var(--mm-w,#fff);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all .12s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-family: inherit;
  text-align: right;
}
.mun-disc-item-chip:hover { border-color: #93c5fd; background:var(--mm-w2,#f8fafc); }
.mun-disc-item-chip.is-selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.mun-disc-item-chip .mun-disc-item-title {
  font-size: 13px; font-weight: 600; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.mun-disc-item-chip .mun-disc-item-price {
  font-size: 11px; color: #64748b;
}
.mun-disc-item-chip.is-already {
  opacity: .5; pointer-events: none;
  background: #fef3c7; border-color: #fde68a;
}

.mun-disc-selected-count {
  font-size: 12px;
  color: #1d4ed8;
  font-weight: 600;
}

/* ---------- Manage list ---------- */
.mun-disc-list-empty {
  text-align: center; padding: 32px 16px;
  color: #94a3b8; font-size: 14px;
}
.mun-disc-list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  margin-bottom: 8px;
  gap: 12px;
}
.mun-disc-list-row .mun-disc-row-main { flex: 1; min-width: 0; }
.mun-disc-list-row .mun-disc-row-badge {
  background: #eff6ff; color: #1d4ed8;
  border-radius: 999px; padding: 4px 10px;
  font-size: 13px; font-weight: 700;
  min-width: 52px; text-align: center;
}
.mun-disc-list-row .mun-disc-row-meta {
  font-size: 12px; color: #64748b; margin-top: 4px;
}
.mun-disc-list-row .mun-disc-row-items {
  font-size: 12px; color: #334155; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mun-disc-list-row .mun-disc-remove {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca; border-radius: 8px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.mun-disc-list-row .mun-disc-remove:hover { background: #fee2e2; }

/* ---------- Public menu discount display ---------- */
.mm-item-price.mm-item-price-disc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mm-item-price-strike {
  color: #94a3b8;
  text-decoration: none;
  position: relative;
  font-size: .85em;
  font-weight: 500;
  display: inline-block;
}
.mm-item-price-strike::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  top: 50%;
  height: 2px;
  background: #3b82f6;
  transform: rotate(-6deg);
  border-radius: 2px;
}
.mm-item-price-new {
  color: #1d4ed8;
  font-weight: 700;
}
.mm-item-disc-badge {
  background: #3b82f6;
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  margin-inline-start: 2px;
}

/* variant rows */
.mm-niv-price.mm-item-price-disc,
.mm-item-price.mm-item-price-disc { line-height: 1.4; }

/* toast */
.mun-disc-toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 9999999;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: munDiscToast .25s ease-out;
}
@keyframes munDiscToast { from { opacity: 0; transform: translate(-50%, 10px) } to { opacity: 1; transform: translate(-50%, 0) } }
.mun-disc-toast.is-error { background: #b91c1c; }
