/* ==========================================================================
   Rotitoo — Mahmoud Web Product Admin Styles
   ========================================================================== */

/* Product Card Trigger Button */
.p-card-admin-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid #d4af37;
  color: #d4af37;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.p-card-admin-btn:hover {
  transform: scale(1.1);
  background: #d4af37;
  color: #141414;
}

/* Product Detail Page Admin Bar */
.mahmoud-product-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(35, 30, 22, 0.95));
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: mahmoudFadeIn 0.3s ease;
}
.mahmoud-bar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f7e7ce;
  font-weight: 700;
  font-size: 0.92rem;
}
.mahmoud-bar-icon {
  font-size: 1.15rem;
}
.btn-mahmoud-quick-edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #d4af37, #aa8214);
  color: #141414;
  border: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-mahmoud-quick-edit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
}
.btn-mahmoud-panel-link {
  color: #d4af37;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  transition: background 0.2s ease;
}
.btn-mahmoud-panel-link:hover {
  background: rgba(212, 175, 55, 0.15);
}

/* Modal Backdrop & Dialog */
.mahmoud-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mahmoud-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.mahmoud-modal-container {
  background: var(--bg, #ffffff);
  color: var(--fg, #1f1f1f);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  text-align: right;
  font-family: inherit;
}
.mahmoud-modal-overlay.is-active .mahmoud-modal-container {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.mahmoud-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(138, 109, 59, 0.18);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent);
}
.mahmoud-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mahmoud-header-thumb {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: #f4efe9;
}
.mahmoud-header-titles h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--fg, #141414);
}
.mahmoud-header-meta {
  font-size: 0.82rem;
  color: #78716c;
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.mahmoud-header-meta .tag-id {
  background: #e7e0d8;
  color: #44403c;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-family: monospace;
}
.mahmoud-btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #78716c;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.mahmoud-btn-close:hover {
  color: #b3261e;
  background: rgba(179, 38, 30, 0.08);
}

/* Modal Tabs Navigation */
.mahmoud-tabs-nav {
  display: flex;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  padding: 0 16px;
  overflow-x: auto;
  gap: 4px;
}
.mahmoud-tab-btn {
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #78716c;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.mahmoud-tab-btn:hover {
  color: #8a6d3b;
}
.mahmoud-tab-btn.is-active {
  color: #8a6d3b;
  border-bottom-color: #d4af37;
  background: rgba(212, 175, 55, 0.06);
}
.mahmoud-tab-count {
  background: #8a6d3b;
  color: #fff;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Modal Body */
.mahmoud-modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.mahmoud-tab-pane {
  display: none;
}
.mahmoud-tab-pane.is-active {
  display: block;
}

/* Form Styles */
.m-form-group {
  margin-bottom: 18px;
}
.m-form-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--fg, #292524);
}
.m-form-input, .m-form-select, .m-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d6d3d1;
  background: var(--bg-alt, #fafaf9);
  color: var(--fg, #1c1917);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.m-form-input:focus, .m-form-select:focus, .m-form-textarea:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}
.m-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 580px) {
  .m-form-grid-2 { grid-template-columns: 1fr; }
}

/* Quick Chips (Discounts & Stock) */
.m-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.m-chip-btn {
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  color: #44403c;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.m-chip-btn:hover {
  background: #d4af37;
  color: #141414;
  border-color: #d4af37;
}

/* Color Palette Selector */
.m-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.m-color-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e7e5e4;
  background: #fdfcfb;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.m-color-pill:hover {
  border-color: #d4af37;
}
.m-color-pill.is-selected {
  border-color: #d4af37;
  background: rgba(212, 175, 55, 0.12);
  font-weight: 800;
}
.m-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* Parent Product Link Card */
.m-parent-card {
  background: #f8f6f2;
  border: 1px dashed #d4af37;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.m-parent-info strong {
  display: block;
  font-size: 0.92rem;
  color: #141414;
}
.m-parent-info span {
  font-size: 0.8rem;
  color: #78716c;
}
.m-btn-unlink {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.m-btn-unlink:hover {
  background: #f87171;
  color: #fff;
}

/* Reviews Moderation Tab */
.m-reviews-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.m-btn-approve-all {
  background: #15803d;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.m-btn-approve-all:hover {
  background: #166534;
}
.m-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.m-review-item {
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 12px;
  background: #fafaf9;
}
.m-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.m-review-author {
  font-weight: 700;
  font-size: 0.9rem;
}
.m-review-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.m-review-badge.approved { background: #dcfce7; color: #15803d; }
.m-review-badge.pending { background: #fef3c7; color: #b45309; }
.m-review-body {
  font-size: 0.88rem;
  color: #44403c;
  line-height: 1.5;
  margin-bottom: 8px;
}
.m-review-actions {
  display: flex;
  gap: 8px;
}
.m-btn-rev-approve {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.m-btn-rev-delete {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Danger Zone (Delete) */
.m-danger-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 16px;
  color: #991b1b;
}
.m-danger-box h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.m-danger-box p {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.m-btn-delete-prod {
  background: #dc2626;
  color: #fff;
  border: none;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.m-btn-delete-prod:hover {
  background: #b91c1c;
}

/* Modal Footer */
.mahmoud-modal-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-alt, #fafaf9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m-footer-actions {
  display: flex;
  gap: 10px;
}
.m-btn-save {
  background: linear-gradient(135deg, #d4af37, #b28919);
  color: #141414;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.m-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}
.m-btn-cancel {
  background: transparent;
  color: #78716c;
  border: 1px solid #d6d3d1;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.m-btn-cancel:hover {
  background: #e7e5e4;
}

/* Status / Alert Messages */
.m-alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.88rem;
  display: none;
}
.m-alert.is-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.m-alert.is-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Skeleton Loading */
.m-modal-loading {
  text-align: center;
  padding: 50px 20px;
}
.m-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(212, 175, 55, 0.2);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: mSpin 0.75s linear infinite;
  margin: 0 auto 12px;
}
@keyframes mSpin {
  to { transform: rotate(360deg); }
}
@keyframes mahmoudFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
