/* MATISA Premium Palette - Warm Peach Theme (پورت globals.css) */
:root {
  --color-primary: #2C2018;
  --color-text: #1C1510;
  --color-brand: #D4956A;
  --color-btn: #E8A88E;
  --color-section: #FAD7C8;
  --color-bg: #FFFAF7;
  --color-muted: #635548;
  --color-gold: #C4956F;

  --font-vazir: 'Vazirmatn', Tahoma, Arial, sans-serif;
  --font-playfair: 'Playfair Display', Georgia, serif;

  --shadow-sm: 0 1px 3px rgba(44, 32, 24, 0.06), 0 1px 2px rgba(44, 32, 24, 0.04);
  --shadow-md: 0 4px 12px rgba(44, 32, 24, 0.08), 0 2px 4px rgba(44, 32, 24, 0.04);
  --shadow-lg: 0 10px 30px rgba(44, 32, 24, 0.10), 0 4px 8px rgba(44, 32, 24, 0.05);
  --shadow-xl: 0 20px 50px rgba(44, 32, 24, 0.12), 0 8px 16px rgba(44, 32, 24, 0.06);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

/* جلوگیری از اسکرول افقی کل صفحه بدون شکستن هدر sticky
   (clip برخلاف hidden ظرف اسکرول نمی‌سازد) */
html, body { overflow-x: clip; }

body {
  background: #FFFAF7;
  color: #1C1510;
  font-family: var(--font-vazir), Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, textarea, select, button { font-size: 16px; font-family: inherit; }

.font-brand { font-family: var(--font-playfair), Georgia, serif; }

/* فونت نشان‌های روی عکس محصول (تخفیف، پرفروش، جدید) */
.font-badge { font-family: 'Lalezar', var(--font-vazir); line-height: 1.6; }

/* Section heading decoration */
.section-heading { position: relative; display: inline-block; }
.section-heading::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #D4956A, #E8A88E);
  border-radius: 2px;
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: #E8A88E; color: #fff;
  padding: 0.875rem 1.75rem; border-radius: 9999px; font-weight: 500;
  transition: all 300ms; box-shadow: var(--shadow-sm); border: none; cursor: pointer;
}
.btn-primary:hover { background: #2C2018; box-shadow: var(--shadow-lg); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #2C2018; color: #2C2018;
  padding: 0.875rem 1.75rem; border-radius: 9999px; font-weight: 500;
  transition: all 300ms; background: transparent; cursor: pointer;
}
.btn-secondary:hover { background: #2C2018; color: #fff; }

.btn-brand {
  display: inline-flex; align-items: center; justify-content: center;
  background: #D4956A; color: #fff;
  padding: 0.875rem 1.75rem; border-radius: 9999px; font-weight: 500;
  transition: all 300ms; box-shadow: var(--shadow-sm); border: none; cursor: pointer;
}
.btn-brand:hover { background: #C4956F; box-shadow: var(--shadow-lg); }
.btn-brand:active { transform: scale(0.97); }

/* Product card */
.card-product {
  background: #fff; border-radius: 1rem; overflow: hidden;
  transition: all 300ms; border: 1px solid rgba(250, 215, 200, 0.5);
  box-shadow: var(--shadow-sm);
}
.card-product:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: rgba(212, 149, 106, 0.3);
}

.safe-pb { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }

/* Better touch targets on small screens */
@media (max-width: 640px) {
  .btn-primary, .btn-secondary { min-height: 48px; width: 100%; text-align: center; }
}

/* Fade-in animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeUp 0.6s var(--ease-out-expo) both; }

.stagger-children > * { opacity: 0; animation: fadeUp 0.5s var(--ease-out-expo) both; }
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 80ms; }
.stagger-children > *:nth-child(3) { animation-delay: 160ms; }
.stagger-children > *:nth-child(4) { animation-delay: 240ms; }
.stagger-children > *:nth-child(5) { animation-delay: 320ms; }
.stagger-children > *:nth-child(6) { animation-delay: 400ms; }
.stagger-children > *:nth-child(7) { animation-delay: 480ms; }
.stagger-children > *:nth-child(8) { animation-delay: 560ms; }

/* Glassmorphism for header */
.glass-header {
  background: rgba(255, 250, 247, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(250, 215, 200, 0.35);
}
.glass-header.scrolled {
  background: rgba(255, 250, 247, 0.88);
  box-shadow: 0 1px 24px rgba(44, 32, 24, 0.06);
}

/* Gradient text for brand */
.gradient-text {
  background: linear-gradient(135deg, #D4956A 0%, #C4956F 50%, #E8A88E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile horizontal product carousel */
.product-scroll-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0.75rem;
  overflow-x: auto !important;
  overflow-y: hidden;
  padding-bottom: 0.5rem;
  margin-left: 0; margin-right: 0;
  padding-left: 0; padding-right: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.product-scroll-row::-webkit-scrollbar { display: none; }
.product-scroll-row .product-card-link {
  width: 38vw !important;
  min-width: 150px !important;
  max-width: 170px !important;
  flex: 0 0 auto !important;
  scroll-snap-align: start;
}
.product-scroll-row .card-product [class*="aspect-"] { aspect-ratio: 1 / 1 !important; }
.product-scroll-row .card-product { font-size: 0.75rem; }
@media (min-width: 640px) {
  .product-scroll-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible !important;
    margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0;
    gap: 1.5rem;
    scroll-snap-type: none;
    flex-wrap: unset !important;
  }
  .product-scroll-row .product-card-link {
    width: auto !important; min-width: 0 !important; max-width: none !important; flex: unset !important;
  }
}
@media (min-width: 1024px) {
  .product-scroll-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Toast notifications */
.matisa-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2C2018; color: #fff; padding: 0.85rem 1.5rem; border-radius: 9999px;
  box-shadow: var(--shadow-lg); z-index: 200; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: all 300ms var(--ease-out-expo);
  max-width: 90vw; text-align: center;
}
.matisa-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.matisa-toast.error { background: #b91c1c; }
.matisa-toast.success { background: #15803d; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-fade-up, .stagger-children > * { animation: none !important; opacity: 1 !important; transform: none !important; }
  .card-product:hover { transform: none; }
}
