/* ==========================================================================
   Global Base & Typography System - Sadaf Optometry
   ========================================================================== */
@import url('../../assets/fonts/fonts.css');
@import url('ai-chat-widget.css');

:root{
  --header-h: 0px; /* با JS ست میشه */
  
  /* Brand Colors (Luxurious Classic Champagne Gold & Slate) */
  --primary: #D4AF37;
  --primary-hover: #B8860B;
  --primary-light: rgba(212, 175, 55, 0.1);
  --secondary: #E6B800;
  --dark: #1A1A2E;
  --dark-soft: #2E2E42;
  --dark-slate: #10101C;
  
  /* Neutral Colors */
  --bg-body: #FDFBF7;
  --bg-card: #FAF6F0;
  --bg-light: #FAF8F5;
  --bg-input: rgba(26, 26, 46, 0.04);
  
  /* Text Colors */
  --text-main: #1A1A2E;
  --text-muted: #6B6B7A;
  --text-light: #A0A0B0;
  --text-white: #FFFFFF;
  
  /* Borders & Dividers */
  --border-color: #E6DFD5;
  --border-glass: rgba(26, 26, 46, 0.08);
  
  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(26, 26, 46, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(26, 26, 46, 0.06), 0 2px 4px -2px rgba(26, 26, 46, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(26, 26, 46, 0.08), 0 4px 6px -4px rgba(26, 26, 46, 0.08);
  --shadow-glass: 0 8px 32px 0 rgba(26, 26, 46, 0.04);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* ==========================================================================
     Master Typography Design System (5 Tailored Web Font Families)
     ========================================================================== */
  --font-base: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Sahel', 'Shabnam', 'Vazirmatn', sans-serif;
  --font-display: 'Lalezar', 'Sahel', 'Shabnam', sans-serif;
  --font-subheading: 'Sahel', 'Vazirmatn', sans-serif;
  --font-ui: 'Shabnam', 'Vazirmatn', sans-serif;
  --font-friendly: 'Samim', 'Shabnam', 'Vazirmatn', sans-serif;
  --font-num: 'Shabnam FD', 'Sahel FD', 'Samim FD', 'Vazirmatn', sans-serif;
  --font-en: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html{
  /* برای لینک‌های anchor و اسکرول به بالا که زیر هدر نره */
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

html, body {
  /* جلوگیری از اسکرول افقی ناخواسته در موبایل */
  max-width: 100vw;
  overflow-x: clip;
}

body{
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-main);
  direction: rtl;
  background: #fff;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--header-h);
}

/* ==========================================================================
   Responsive Typography & Heading Scales (Mobile & Desktop)
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  color: var(--dark);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h1, .h1 {
  font-size: clamp(1.5rem, 3.5vw + 0.5rem, 2.5rem);
  font-weight: 800;
}

h2, .h2 {
  font-size: clamp(1.25rem, 2.5vw + 0.4rem, 1.875rem);
  font-weight: 700;
}

h3, .h3 {
  font-size: clamp(1.1rem, 1.8vw + 0.3rem, 1.45rem);
  font-weight: 700;
}

h4, .h4 {
  font-size: clamp(1rem, 1.2vw + 0.2rem, 1.2rem);
  font-weight: 600;
}

h5, .h5 {
  font-size: 1.05rem;
  font-weight: 600;
}

h6, .h6 {
  font-size: 0.95rem;
  font-weight: 600;
}

p {
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* UI Elements & Controls Typography */
button, input, select, textarea, .btn, .button {
  font-family: var(--font-ui);
}

/* Numbers & Prices Persian Normalization */
.price, .product-price, .amount, .phone-num, .count, .badge-num, .stat-num, .farsi-digits {
  font-family: var(--font-num) !important;
  font-feature-settings: "ss01", "ss02";
}

/* International Brand English Typography */
.brand-name, .en-text, .luxury-en, .product-code, .tech-tag {
  font-family: var(--font-en);
  direction: ltr;
  display: inline-block;
  letter-spacing: 0.04em;
}

/* Typography Helper Utility Classes */
.font-ui { font-family: var(--font-ui) !important; }
.font-heading { font-family: var(--font-heading) !important; }
.font-display { font-family: var(--font-display) !important; }
.font-subheading { font-family: var(--font-subheading) !important; }
.font-friendly { font-family: var(--font-friendly) !important; }
.font-base { font-family: var(--font-base) !important; }
.font-en { font-family: var(--font-en) !important; }

/* کانتینر مشترک */
.container{
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* جلوگیری از پرش چیدمان و سرریز */
img, svg, video, iframe, embed, object { max-width: 100%; }
img, video { height: auto; display: block; }
a{ color: inherit; text-decoration: none; }

/* جداول واکنش‌گرا */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Global Product Pagination Styling (Refined with Shabnam-FD UI)
   ========================================================================== */
.pagination-wrapper {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  direction: rtl;
  font-family: var(--font-ui);
}

.pagination-info {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-num);
}

.pagination-info strong {
  color: #1e293b;
  font-weight: 700;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-right: auto;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-num);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.page-link:hover:not(.disabled):not(.active):not(.ellipsis) {
  border-color: #d4af37;
  color: #b8860b;
  background: #fffdf5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.page-link.active {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #ffffff;
  border-color: #d4af37;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
  font-weight: 700;
  cursor: default;
}

.page-link.disabled {
  color: #cbd5e1;
  border-color: #f1f5f9;
  background: #f8fafc;
  cursor: not-allowed;
  opacity: 0.7;
}

.page-link.ellipsis {
  border: none;
  background: transparent;
  cursor: default;
  min-width: 28px;
  color: #94a3b8;
  box-shadow: none;
}

.page-link.prev-page,
.page-link.next-page {
  gap: 6px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 13.5px;
  font-family: var(--font-ui);
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
    line-height: 1.7;
  }

  .pagination-wrapper {
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    margin-top: 30px;
    padding-top: 20px;
  }

  .pagination {
    justify-content: center;
    margin-right: 0;
    width: 100%;
    gap: 6px;
  }

  .page-link {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 8px;
  }

  .page-link.prev-page,
  .page-link.next-page {
    padding: 0 12px;
  }

  .pagination-info {
    font-size: 12.5px;
    text-align: center;
  }
}