/* =========================================================
   MANIZ DESIGN SYSTEM — Phase 1
   حفظ هویت بصری فعلی مانیز، فقط استاندارد و یکپارچه‌سازی UI
   این فایل هیچ منطق PHP/Query/URL را تغییر نمی‌دهد.
   ========================================================= */

:root {
  /* --- Brand Colors (حفظ‌شده از پروژه فعلی) --- */
  --mz-navy: #0b2947;
  --mz-navy-light: #163a5e;
  --mz-gold: #b28a52;
  --mz-gold-dark: #96713f;
  --mz-gold-light: #d4b48a;
  --mz-bg: #f7f3ed;
  --mz-text: #142235;
  --mz-muted: #6b7583;

  /* --- Semantic --- */
  --mz-success: #3a8a52;
  --mz-success-bg: #e9f6ee;
  --mz-error: #c0392b;
  --mz-error-bg: #fdecea;
  --mz-warning: #b8860b;
  --mz-warning-bg: #fbf3df;
  --mz-border: #e3ddd2;
  --mz-white: #ffffff;

  /* --- Spacing / Radius / Shadow --- */
  --mz-radius-sm: 6px;
  --mz-radius-md: 10px;
  --mz-radius-lg: 16px;
  --mz-shadow-sm: 0 1px 3px rgba(11, 41, 71, 0.08);
  --mz-shadow-md: 0 4px 14px rgba(11, 41, 71, 0.1);
  --mz-shadow-lg: 0 10px 30px rgba(11, 41, 71, 0.14);

  /* --- Motion --- */
  --mz-transition: 150ms ease;

  /* --- Touch target --- */
  --mz-touch: 44px;
}

/* =========================================================
   TYPOGRAPHY (فارسی)
   -----------------------------------------------------------
   عمداً روی تگ‌های خام body/h1/h2/h3/p اعمال نمی‌شه (تا وقتی
   خودتون تصمیم بگیرید صفحات رو مهاجرت بدید) — فقط از طریق
   کلاس‌های mz-* که opt-in هستن قابل استفاده‌ست، تا لینک کردن
   این فایل به همه‌ی صفحات هیچ تغییر بصری فوری ایجاد نکنه.
   ========================================================= */
.mz-body {
  color: var(--mz-text);
  background: var(--mz-bg);
  line-height: 1.85;
  font-size: 16px;
}

.mz-article,
.mz-prose {
  max-width: 760px;
  margin-inline: auto;
  line-height: 2;
}

.mz-h1 { font-size: 1.9rem; line-height: 1.5; font-weight: 800; margin-block-end: .6em; }
.mz-h2 { font-size: 1.5rem; line-height: 1.5; font-weight: 700; margin-block-end: .55em; }
.mz-h3 { font-size: 1.2rem; line-height: 1.5; font-weight: 700; margin-block-end: .5em; }
.mz-p { margin-block-end: 1em; }

.mz-muted { color: var(--mz-muted); }
.mz-price { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--mz-navy); }
.mz-price-lg { font-size: 1.4rem; }

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
a, button, input, select, textarea, [tabindex] {
  outline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--mz-gold-dark);
  outline-offset: 2px;
  border-radius: var(--mz-radius-sm);
}
.mz-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* =========================================================
   BUTTON SYSTEM (Primary / Secondary / Tertiary)
   ========================================================= */
.mz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: var(--mz-touch);
  padding-inline: 1.4em;
  padding-block: .6em;
  border-radius: var(--mz-radius-md);
  font-weight: 700;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--mz-transition), border-color var(--mz-transition), transform var(--mz-transition), box-shadow var(--mz-transition);
  text-decoration: none;
}
.mz-btn:disabled, .mz-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.mz-btn-primary {
  background: var(--mz-gold);
  color: var(--mz-white);
  box-shadow: var(--mz-shadow-sm);
}
.mz-btn-primary:hover:not(:disabled) { background: var(--mz-gold-dark); box-shadow: var(--mz-shadow-md); }

.mz-btn-secondary {
  background: var(--mz-white);
  color: var(--mz-navy);
  border-color: var(--mz-navy);
}
.mz-btn-secondary:hover:not(:disabled) { background: var(--mz-bg); }

.mz-btn-tertiary {
  background: transparent;
  color: var(--mz-muted);
  padding-inline: .8em;
}
.mz-btn-tertiary:hover:not(:disabled) { color: var(--mz-text); text-decoration: underline; }

.mz-btn-block { width: 100%; }

/* Loading state for buttons (Add to cart, Login, Payment...) */
.mz-btn.is-loading { color: transparent; pointer-events: none; position: relative; }
.mz-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  animation: mz-spin .7s linear infinite;
}
.mz-btn-secondary.is-loading::after,
.mz-btn-tertiary.is-loading::after {
  border-color: rgba(11,41,71,.25); border-top-color: var(--mz-navy);
}
@keyframes mz-spin { to { transform: rotate(360deg); } }

/* =========================================================
   BADGES / STATUS
   ========================================================= */
.mz-badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .25em .7em;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.mz-badge-success { background: var(--mz-success-bg); color: var(--mz-success); }
.mz-badge-error   { background: var(--mz-error-bg);   color: var(--mz-error); }
.mz-badge-warning { background: var(--mz-warning-bg); color: var(--mz-warning); }
.mz-badge-muted   { background: var(--mz-bg); color: var(--mz-muted); border: 1px solid var(--mz-border); }

.mz-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mz-status-dot.available { background: var(--mz-success); }
.mz-status-dot.unavailable { background: var(--mz-error); }

/* =========================================================
   ALERTS
   ========================================================= */
.mz-alert {
  border-radius: var(--mz-radius-md);
  padding: .9em 1.1em;
  font-size: .92rem;
  border: 1px solid transparent;
  display: flex; gap: .6em; align-items: flex-start;
}
.mz-alert-success { background: var(--mz-success-bg); color: var(--mz-success); border-color: rgba(58,138,82,.25); }
.mz-alert-error   { background: var(--mz-error-bg);   color: var(--mz-error);   border-color: rgba(192,57,43,.25); }
.mz-alert-warning { background: var(--mz-warning-bg); color: var(--mz-warning); border-color: rgba(184,134,11,.25); }
.mz-alert-info    { background: #eef4fb; color: var(--mz-navy); border-color: rgba(11,41,71,.15); }

/* =========================================================
   CARD / PRODUCT CARD / COURSE CARD
   ========================================================= */
.mz-card {
  background: var(--mz-white);
  border: 1px solid var(--mz-border);
  border-radius: var(--mz-radius-lg);
  overflow: hidden;
  transition: box-shadow var(--mz-transition), transform var(--mz-transition);
}
.mz-card:hover { box-shadow: var(--mz-shadow-md); transform: translateY(-2px); }

.mz-product-card, .mz-course-card {
  display: flex;
  flex-direction: column;
}
.mz-card-img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--mz-bg);
}
.mz-card-body { padding: 1em; display: flex; flex-direction: column; gap: .45em; flex: 1; }
.mz-card-title { font-weight: 700; font-size: 1rem; }
.mz-card-desc { color: var(--mz-muted); font-size: .85rem; }
.mz-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: .4em; }

/* Course card specific rows (distinct from product card) */
.mz-course-meta {
  display: flex; flex-wrap: wrap; gap: .5em 1em;
  font-size: .8rem; color: var(--mz-muted);
}
.mz-course-meta span { display: inline-flex; align-items: center; gap: .3em; }

/* =========================================================
   FORMS (Default / Focus / Error / Loading / Success)
   ========================================================= */
.mz-field { display: flex; flex-direction: column; gap: .4em; margin-block-end: 1.1em; }
.mz-label { font-size: .88rem; font-weight: 700; color: var(--mz-text); }
.mz-input, .mz-select, .mz-textarea {
  min-height: var(--mz-touch);
  padding-inline: .9em;
  padding-block: .55em;
  border-radius: var(--mz-radius-sm);
  border: 1px solid var(--mz-border);
  background: var(--mz-white);
  color: var(--mz-text);
  font-size: .95rem;
  transition: border-color var(--mz-transition), box-shadow var(--mz-transition);
}
.mz-input:focus, .mz-select:focus, .mz-textarea:focus {
  border-color: var(--mz-navy);
  box-shadow: 0 0 0 3px rgba(11,41,71,.12);
  outline: none;
}
.mz-field.has-error .mz-input,
.mz-field.has-error .mz-select,
.mz-field.has-error .mz-textarea {
  border-color: var(--mz-error);
  box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}
.mz-field.has-success .mz-input {
  border-color: var(--mz-success);
}
.mz-field-error { color: var(--mz-error); font-size: .8rem; }
.mz-field-hint { color: var(--mz-muted); font-size: .8rem; }

/* =========================================================
   EMPTY STATE / LOADING STATE
   ========================================================= */
.mz-empty {
  text-align: center;
  padding: 3em 1em;
  color: var(--mz-muted);
}
.mz-empty-title { color: var(--mz-text); font-weight: 700; margin-block-end: .3em; }
.mz-empty .mz-btn { margin-block-start: 1em; }

.mz-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 2em; color: var(--mz-muted); gap: .6em;
}
.mz-skeleton {
  background: linear-gradient(90deg, var(--mz-border) 25%, #ece6da 37%, var(--mz-border) 63%);
  background-size: 400% 100%;
  animation: mz-shimmer 1.4s ease infinite;
  border-radius: var(--mz-radius-sm);
}
@keyframes mz-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* =========================================================
   BREADCRUMB / PAGINATION / TABLE / MODAL
   ========================================================= */
.mz-breadcrumb { display: flex; align-items: center; gap: .5em; font-size: .85rem; color: var(--mz-muted); flex-wrap: wrap; }
.mz-breadcrumb a { color: var(--mz-muted); text-decoration: none; }
.mz-breadcrumb a:hover { color: var(--mz-navy); }
.mz-breadcrumb .sep { opacity: .5; }

.mz-pagination { display: flex; gap: .4em; align-items: center; justify-content: center; }
.mz-pagination a, .mz-pagination span {
  min-width: var(--mz-touch); min-height: var(--mz-touch);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--mz-radius-sm); border: 1px solid var(--mz-border);
  color: var(--mz-text); text-decoration: none; font-size: .85rem;
}
.mz-pagination .is-active { background: var(--mz-navy); border-color: var(--mz-navy); color: #fff; }

.mz-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mz-table th { text-align: start; color: var(--mz-muted); font-weight: 700; padding-block: .7em; border-block-end: 1px solid var(--mz-border); }
.mz-table td { padding-block: .8em; border-block-end: 1px solid var(--mz-border); }

.mz-modal-backdrop {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(11,41,71,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1em; z-index: 1000;
  animation: mz-fade .15s ease;
}
.mz-modal {
  background: var(--mz-white); border-radius: var(--mz-radius-lg);
  max-width: 480px; width: 100%; box-shadow: var(--mz-shadow-lg);
  padding: 1.4em; animation: mz-pop .15s ease;
}
@keyframes mz-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mz-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

/* =========================================================
   RTL — Logical Properties (پیش‌فرض کل سایت راست‌چین است)
   ========================================================= */
[dir="rtl"] .mz-icon-flip { transform: scaleX(-1); }

/* =========================================================
   MOBILE / TOUCH
   ========================================================= */
@media (max-width: 480px) {
  .mz-card-body { padding: .85em; }
  .mz-h1 { font-size: 1.5rem; }
}
.mz-sticky-cta {
  position: sticky;
  inset-block-end: 0;
  background: var(--mz-white);
  border-block-start: 1px solid var(--mz-border);
  padding: .75em 1em;
  box-shadow: 0 -4px 14px rgba(11,41,71,.08);
  z-index: 50;
}
