/* ==========================================================================
   فروشگاه حبوبات خوشپز (Khoshpaz) - استایل اختصاصی، هویت بصری مدرن و RTL
   ========================================================================== */

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

:root {
  --primary: #226b48;
  --primary-dark: #164e33;
  --primary-light: #2e8b57;
  --primary-surface: #edf7f0;
  
  --orange: #f97316;
  --orange-hover: #ea580c;
  --orange-light: #fff7ed;
  --orange-dark: #c2410c;
  --orange-surface: #ffedd5;
  --orange-border: #fdba74;

  --cream-bg: #faf7f2;
  --cream-card: #ffffff;
  --cream-darker: #f3ece0;
  --cream-border: #e8e0d2;
  
  --gold: #f97316;
  --gold-light: #fff7ed;
  --gold-dark: #ea580c;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --danger: #ea580c;
  --danger-light: #ffedd5;
  --success: #226b48;
  --warning: #f97316;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-subtle: 0 4px 20px -2px rgba(22, 78, 51, 0.05);
  --shadow-card: 0 10px 25px -5px rgba(22, 78, 51, 0.07), 0 8px 10px -6px rgba(22, 78, 51, 0.04);
  --shadow-hover: 0 20px 35px -8px rgba(234, 88, 12, 0.15), 0 10px 15px -7px rgba(22, 78, 51, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--cream-bg);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--cream-bg);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-dark);
  font-weight: 800;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Brand Logo Typography */
.brand-title {
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--primary-dark);
}

.brand-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

/* Card Styling */
.khoshpaz-card {
  background: var(--cream-card);
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.khoshpaz-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px -6px rgba(234, 88, 12, 0.12), 0 8px 16px -4px rgba(22, 78, 51, 0.08);
  border-color: rgba(234, 88, 12, 0.35);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 10px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(22, 78, 51, 0.2);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  box-shadow: 0 6px 16px rgba(22, 78, 51, 0.28);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-weight: 800;
  border-radius: var(--radius-md);
  padding: 11px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.35);
  transition: all 0.2s ease;
}
.btn-orange:hover {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
  transform: translateY(-2px);
}
.btn-orange:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #ffffff;
  color: var(--primary-dark);
  border: 1.5px solid var(--cream-border);
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 9px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: var(--cream-bg);
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #b87b22 100%);
  color: #ffffff;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 10px 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(201, 138, 44, 0.25);
  transition: all 0.2s ease;
}
.btn-gold:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Pulse category chips */
.category-chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--cream-border);
  background: white;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-surface);
}
.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 107, 72, 0.25);
}

/* Weight Selector Buttons */
.weight-btn {
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.weight-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.weight-btn.selected {
  border-color: var(--primary);
  background: var(--primary-surface);
  color: var(--primary-dark);
  font-weight: 700;
}

/* Discount Badge */
.discount-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35);
}

/* Modal Backdrops & Containers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Cart Drawer */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: white;
  z-index: 95;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.active {
  transform: translateX(0);
}

/* Order timeline */
.timeline-item {
  position: relative;
  padding-right: 28px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 6px;
  bottom: -16px;
  width: 2px;
  background: #e2e8f0;
}
.timeline-item:last-child::before {
  display: none;
}
.timeline-dot {
  position: absolute;
  top: 6px;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

/* Print Invoice Style */
@media print {
  body * {
    visibility: hidden;
  }
  #invoice-printable, #invoice-printable * {
    visibility: visible;
  }
  #invoice-printable {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    margin: 0;
    box-shadow: none !important;
    border: none !important;
  }
  .no-print {
    display: none !important;
  }
}



/* Cart Badge Styling - Ensure Orange Number with High Contrast */
#header-cart-badge {
  background-color: #ffffff !important;
  color: #ea580c !important;
  border: 2px solid #ea580c !important;
  font-weight: 900 !important;
}
