/* ============================================================
   دوستان قصابی — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  /* ── Brand: Deep Red ── */
  --red-50:  #fdf2f3;
  --red-100: #fadddf;
  --red-200: #f4b4b9;
  --red-400: #d4444f;
  --red-500: #bf2430;
  --red-600: #A61B25;
  --red-700: #8a1620;
  --red-800: #6e111a;
  --red-900: #520c13;

  /* ── Brand: Cream/Beige ── */
  --cream-50:  #fdfcfb;
  --cream-100: #EBE1D8;
  --cream-200: #ddd0c4;
  --cream-300: #cfc0b0;
  --cream-400: #bfab99;

  /* ── Brand: Dark Green ── */
  --sage-50:  #f0f5f3;
  --sage-100: #d5e5de;
  --sage-200: #a7c9bb;
  --sage-300: #79ad99;
  --sage-400: #4d9178;
  --sage-500: #195740;
  --sage-600: #154d39;
  --sage-700: #114030;

  /* ── Neutral Darks ── */
  --brown-50:  #f8f6f4;
  --brown-100: #ede8e2;
  --brown-900: #1a1210;
  --brown-800: #2e201a;
  --brown-700: #4a3228;
  --brown-600: #664438;

  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* ── Semantic Mappings ── */
  --primary:         #A61B25;
  --primary-light:   #bf2430;
  --primary-dark:    #8a1620;
  --primary-glow:    rgba(166, 27, 37, 0.18);
  --secondary:       #195740;
  --secondary-light: #4d9178;
  --secondary-dark:  #154d39;
  --accent:          #ddd0c4;
  --bg-main:         #EBE1D8;
  --bg-card:         #ffffff;
  --bg-dark:         #0f1a13;
  --text-primary:    #1a1210;
  --text-secondary:  #4b5563;
  --text-muted:      #9ca3af;
  --text-inverse:    #ffffff;
  --border:          #ddd0c4;
  --border-soft:     #cfc0b0;
  --success:         #1a7a46;
  --warning:         #b8860b;
  --info:            #1a5276;
  --danger:          #A61B25;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);
  --shadow-2xl:0 24px 80px rgba(0,0,0,0.22);
  --shadow-red: 0 8px 24px rgba(166,27,37,0.28);
  --shadow-sage:0 8px 24px rgba(25,87,64,0.22);

  /* Typography */
  --font: 'Vazirmatn', 'Tahoma', sans-serif;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10:40px;
  --sp-12:48px;
  --sp-16:64px;
  --sp-20:80px;
  --sp-24:96px;

  /* Radius */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-xl:  32px;
  --r-2xl: 48px;
  --r-full:9999px;

  /* Transitions */
  --t-fast:  150ms cubic-bezier(0.4,0,0.2,1);
  --t-norm:  300ms cubic-bezier(0.4,0,0.2,1);
  --t-slow:  500ms cubic-bezier(0.4,0,0.2,1);
  --t-spring:400ms cubic-bezier(0.34,1.56,0.64,1);

  /* Z-index */
  --z-0:   0;
  --z-10:  10;
  --z-20:  20;
  --z-30:  30;
  --z-nav: 200;
  --z-cart:300;
  --z-modal:400;
  --z-toast:500;

  /* Navbar height */
  --nav-h: 72px;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; background: none; }
input, textarea, select {
  font-family: var(--font);
  direction: rtl;
  outline: none;
}

/* ─── Typography ────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; line-height: 1.2; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 800; line-height: 1.3; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); font-weight: 700; line-height: 1.4; }
h4 { font-size: 1.25rem; font-weight: 700; }
h5 { font-size: 1.1rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 1.875rem; }
.text-4xl  { font-size: 2.25rem; }

.font-light   { font-weight: 300; }
.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.font-extrabold{font-weight: 800; }
.font-black   { font-weight: 900; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-inverse   { color: var(--text-inverse); }
.text-red       { color: var(--primary); }
.text-sage      { color: var(--secondary); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }

/* ─── Layout ────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container-sm { max-width: 960px; margin: 0 auto; padding: 0 var(--sp-6); }
.container-lg { max-width: 1440px; margin: 0 auto; padding: 0 var(--sp-6); }

.section { padding: var(--sp-20) 0; }
.section-sm { padding: var(--sp-12) 0; }
.section-lg { padding: var(--sp-24) 0; }

.grid { display: grid; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--t-norm);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--red-600), var(--red-500));
  color: var(--white);
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--red-700), var(--red-600));
  box-shadow: 0 12px 32px rgba(166,27,37,0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--sage-500), var(--sage-400));
  color: var(--white);
  box-shadow: var(--shadow-sage);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, var(--sage-600), var(--sage-500));
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline-sage {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
}
.btn-outline-sage:hover {
  background: var(--secondary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: 0.85rem; border-radius: var(--r-sm); }
.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: 1.05rem; border-radius: var(--r-lg); }
.btn-xl { padding: var(--sp-5) var(--sp-10); font-size: 1.15rem; border-radius: var(--r-lg); }

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-sm { width: 36px; height: 36px; }
.btn-icon-lg { width: 52px; height: 52px; }

.btn-full { width: 100%; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--t-norm);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-glass {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* ─── Section Headers ───────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--sp-12);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--red-50);
  color: var(--primary);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--sp-4);
  border: 1px solid var(--red-100);
}

.section-title {
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
}

.section-title span {
  color: var(--primary);
  position: relative;
}

.section-title span::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--red-400));
  border-radius: var(--r-full);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-red  { background: var(--red-50); color: var(--red-600); border: 1px solid var(--red-100); }
.badge-sage { background: var(--sage-50); color: var(--sage-600); border: 1px solid var(--sage-100); }
.badge-cream{ background: var(--cream-200); color: var(--brown-700); border: 1px solid var(--cream-300); }
.badge-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-5); }

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.form-label .req { color: var(--primary); margin-right: 2px; }

.form-control {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all var(--t-fast);
  font-family: var(--font);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: var(--white);
}

.form-control::placeholder { color: var(--text-muted); font-family: var(--font); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  padding-left: 40px;
}

.form-textarea { resize: vertical; min-height: 100px; }

.form-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: var(--sp-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: var(--sp-1);
}

/* ─── Stars Rating ───────────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; direction: ltr; }
.star { color: #e5e7eb; font-size: 0.9rem; }
.star.filled { color: #f59e0b; }

/* ─── Divider ───────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream-100); }
::-webkit-scrollbar-thumb { background: var(--cream-400); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--sage-400); }

/* ─── Utilities ─────────────────────────────────────────── */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.aspect-square { aspect-ratio: 1/1; }
.aspect-video { aspect-ratio: 16/9; }
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.rounded { border-radius: var(--r-md); }
.rounded-full { border-radius: var(--r-full); }
.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pointer { cursor: pointer; }
.select-none { user-select: none; }
.p-4 { padding: var(--sp-4); }
.p-6 { padding: var(--sp-6); }
.p-8 { padding: var(--sp-8); }
.px-4 { padding-right: var(--sp-4); padding-left: var(--sp-4); }
.px-6 { padding-right: var(--sp-6); padding-left: var(--sp-6); }
.py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.py-3 { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.me-2 { margin-left: var(--sp-2); }
.ms-auto { margin-right: auto; }
.me-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }

/* ─── Overlay ───────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--z-cart) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-norm);
}
.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ─── Page Views ────────────────────────────────────────── */
.page-view {
  display: none;
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
}
.page-view.active { display: block; }

/* ─── Spinner ───────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ─── Responsive Breakpoints ────────────────────────────── */
@media (max-width: 1280px) {
  .container { padding: 0 var(--sp-5); }
}

@media (max-width: 1024px) {
  .lg\:hidden { display: none !important; }
  .lg\:block  { display: block !important; }
  .lg\:flex   { display: flex !important; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .container { padding: 0 var(--sp-4); }
  .section { padding: var(--sp-12) 0; }
  .section-lg { padding: var(--sp-16) 0; }
  .md\:hidden { display: none !important; }
  .md\:block  { display: block !important; }
  .md\:flex   { display: flex !important; }
  .md\:col-1  { grid-column: span 1; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.6rem; }
  .sm\:hidden { display: none !important; }
  .sm\:block  { display: block !important; }
  .sm\:col-1  { grid-column: span 1; }
}

