:root {
  --container: 1220px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* چیدمان صفحه: محتوای اصلی + فیلترها */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr); /* sidebar راست + main */
  grid-template-areas: "sidebar main";
  gap: 24px;
}
.layout > main {
  grid-area: main;
}
.layout > aside.filters {
  grid-area: sidebar;
}
#resultsWrap{
  min-height: 400px;
  position: relative;
  scroll-margin-top: calc(var(--header-h, 75px) + 20px);
}
#resultsWrap.is-loading::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(2px);
}
#resultsWrap.is-loading::before{
  content:"در حال اعمال فیلتر…";
  position:absolute;
  top:12px;
  right:12px;
  font-size:12px;
  padding:6px 10px;
  border:1px solid var(--c-border);
  border-radius:999px;
  background:#fff;
  z-index:2;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
  }
}

/* ==========================================================================
   Cheap Eyeglasses Promo Section - Premium Design
   ========================================================================== */
.cheap-promo-section {
  margin: 60px auto 40px;
  padding: 48px 40px;
  background: radial-gradient(circle at 10% 20%, rgba(248, 250, 252, 1) 0%, rgba(241, 245, 249, 0.7) 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  direction: rtl;
}

.cheap-promo-content {
  text-align: right;
}

.cheap-promo-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 20px;
  line-height: 1.4;
  position: relative;
  display: inline-block;
}

.cheap-promo-content h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 0;
  width: 60px;
  height: 3px;
  background-color: #3b82f6;
  border-radius: 2px;
}

.cheap-promo-content p {
  font-size: 15.5px;
  color: #475569;
  line-height: 1.95;
  margin-bottom: 0;
}

.cheap-promo-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cheap-promo-card {
  background: #ffffff;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.01);
  text-align: right;
}

.cheap-promo-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.cheap-promo-icon {
  width: 44px;
  height: 44px;
  background: #eff6ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 18px;
  flex-shrink: 0;
}

.cheap-promo-card:hover .cheap-promo-icon {
  background: #2563eb;
  color: #ffffff;
}

.cheap-promo-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cheap-promo-card h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.cheap-promo-card p {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 991px) {
  .cheap-promo-section {
    grid-template-columns: 1fr;
    padding: 36px 24px;
    gap: 30px;
  }
}

/* ==========================================================================
   Pagination Styling
   ========================================================================== */
.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;
}

.pagination-info {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.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;
  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;
}

@media (max-width: 640px) {
  .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;
  }
}

/* ==========================================================================
   Sports Eyeglasses Promo Section - Premium Design
   ========================================================================== */
.sports-promo-section {
  margin: 50px auto 30px;
  padding: 40px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 24px;
  color: #fff;
  direction: rtl;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.sports-promo-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 36px;
}

.sports-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 196, 182, 0.15);
  color: #2ec4b6;
  border: 1px solid rgba(46, 196, 182, 0.3);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.sports-promo-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
  line-height: 1.4;
}

.sports-promo-header p {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1.8;
}

.sports-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.sports-type-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.sports-type-card:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-4px);
  border-color: rgba(46, 196, 182, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sports-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2ec4b6 0%, #0284c7 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.sports-type-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
}

.sports-type-card p {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.7;
  flex-grow: 1;
  margin-bottom: 16px;
}

.sports-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #2ec4b6;
  background: rgba(46, 196, 182, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.sports-prescription-banner {
  background: rgba(2, 132, 199, 0.15);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 20px 24px;
}

.sports-rx-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sports-rx-content i {
  font-size: 32px;
  color: #38bdf8;
  flex-shrink: 0;
}

.sports-rx-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: #f0f9ff;
  margin-bottom: 6px;
}

.sports-rx-content p {
  font-size: 14px;
  color: #bae6fd;
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .sports-promo-section {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .sports-promo-header h2 {
    font-size: 20px;
  }

  .sports-rx-content {
    flex-direction: column;
    text-align: center;
  }
}
