/* ===== Blog System Styles ===== */

.blog-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  direction: rtl;
}

.blog-header {
  text-align: center;
  margin-bottom: 40px;
}

.blog-header h1 {
  font-size: 32px;
  color: var(--text, #1a2530);
  margin-bottom: 8px;
}

.blog-header p {
  color: #64748b;
  font-size: 16px;
}

.blog-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.blog-tab {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
}

.blog-tab:hover, .blog-tab.active {
  background: var(--primary, #1a2530);
  color: #fff;
  border-color: var(--primary, #1a2530);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.blog-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #f1f5f9;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.blog-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}

.blog-card-image-placeholder .material-icons-outlined {
  font-size: 48px;
  color: #94a3b8;
}

.blog-card-body {
  padding: 20px;
}

.blog-card-category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.blog-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a2530;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.blog-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.blog-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.blog-empty .material-icons-outlined {
  font-size: 64px;
  margin-bottom: 16px;
}

/* ===== Single Post ===== */

.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
  direction: rtl;
}

.post-header {
  text-align: center;
  margin-bottom: 32px;
}

.post-header .post-category {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.post-header h1 {
  font-size: 32px;
  color: #1a2530;
  margin-bottom: 12px;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  color: #64748b;
  font-size: 14px;
  flex-wrap: wrap;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-featured-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 32px;
}

.post-content {
  font-size: 16px;
  line-height: 1.8;
  color: #334155;
}

.post-content h2 {
  font-size: 24px;
  color: #1a2530;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}

.post-content h3 {
  font-size: 20px;
  color: #1a2530;
  margin-top: 32px;
  margin-bottom: 12px;
}

.post-content p {
  margin-bottom: 16px;
}

.post-content ul, .post-content ol {
  margin-bottom: 16px;
  padding-right: 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content blockquote {
  border-right: 4px solid var(--primary, #1a2530);
  padding: 16px 20px;
  margin: 24px 0;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #475569;
}

.post-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.post-content table th, .post-content table td {
  padding: 12px;
  border: 1px solid #e2e8f0;
  text-align: right;
}

.post-content table th {
  background: #f8fafc;
  font-weight: 600;
}

/* ===== TOC ===== */

.toc-container {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 32px;
  border: 1px solid #e2e8f0;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  color: #1a2530;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 4px;
}

.toc-link {
  color: var(--primary, #1a2530);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
  display: block;
  transition: color 0.2s;
}

.toc-link:hover {
  color: var(--primary-dark, #0f172a);
  text-decoration: underline;
}

.toc-level-3 .toc-link { padding-right: 20px; font-size: 13px; }
.toc-level-4 .toc-link { padding-right: 36px; font-size: 13px; }

/* ===== FAQ ===== */

.faq-section {
  margin: 40px 0;
  padding: 24px;
  background: #f8fafc;
  border-radius: 12px;
}

.faq-title {
  font-size: 22px;
  margin-bottom: 20px;
  color: #1a2530;
}

.faq-item {
  border-bottom: 1px solid #e2e8f0;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #1a2530;
  text-align: right;
  font-weight: 500;
}

.faq-icon {
  transition: transform 0.3s;
}

.faq-open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.faq-open .faq-answer {
  max-height: 500px;
  padding-bottom: 16px;
}

/* ===== Reading Progress ===== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
}

.reading-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary, #1a2530), #3b82f6);
  transition: width 0.1s;
}

/* ===== Share ===== */

.share-section {
  margin: 32px 0;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.share-title {
  font-size: 16px;
  color: #1a2530;
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  gap: 8px;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.share-btn .material-icons-outlined {
  font-size: 20px;
  color: #fff;
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #000; }
.share-whatsapp { background: #25d366; }
.share-copy { background: #64748b; }

.share-btn:hover {
  transform: scale(1.1);
}

.share-btn.copied {
  background: #10b981;
}

/* ===== Related Products in Article ===== */

.related-products-section {
  margin: 40px 0;
}

.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.related-product-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.related-product-card:hover {
  transform: translateY(-2px);
}

.related-product-img {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.related-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-product-info {
  padding: 12px;
}

.related-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a2530;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary, #1a2530);
  display: block;
  margin-top: 4px;
}

.related-product-seller {
  font-size: 12px;
  color: #94a3b8;
}

/* ===== Product Block in Content ===== */

.content-product-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.product-block-loading {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* ===== Knowledge Center ===== */

.kc-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  direction: rtl;
}

.kc-header {
  text-align: center;
  margin-bottom: 48px;
}

.kc-header h1 {
  font-size: 32px;
  color: #1a2530;
  margin-bottom: 8px;
}

.kc-header p {
  color: #64748b;
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.kc-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.kc-section-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.kc-section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.kc-section-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.kc-section-icon .material-icons-outlined {
  font-size: 28px;
  color: #fff;
}

.kc-section-card h3 {
  font-size: 16px;
  color: #1a2530;
  margin-bottom: 4px;
}

.kc-section-card p {
  font-size: 13px;
  color: #64748b;
}

/* ===== Guide Cards ===== */

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.guide-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.guide-card-type {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.guide-type-buying { background: #dbeafe; color: #2563eb; }
.guide-type-how_to { background: #d1fae5; color: #059669; }
.guide-type-top_picks { background: #fef3c7; color: #d97706; }
.guide-type-review { background: #fce7f3; color: #db2777; }
.guide-type-tutorial { background: #ede9fe; color: #7c3aed; }
.guide-type-comparison { background: #e0f2fe; color: #0284c7; }

.guide-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a2530;
  margin-bottom: 8px;
}

.guide-card-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 16px;
  line-height: 1.5;
}

.guide-card-readmore {
  font-size: 13px;
  color: var(--primary, #1a2530);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Comparison Cards ===== */

.comparisons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.comparison-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.comparison-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.comparison-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #8b5cf6;
  margin-bottom: 12px;
}

.comparison-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a2530;
  margin-bottom: 8px;
}

.comparison-card-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.comparison-card-entities {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.comparison-entity {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #1a2530;
  padding: 8px;
  background: #f8fafc;
  border-radius: 8px;
}

.comparison-vs {
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  flex-shrink: 0;
}

.kc-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.kc-empty .material-icons-outlined {
  font-size: 64px;
  margin-bottom: 16px;
}

/* ===== Comparison Table ===== */

.comparison-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison-table th {
  background: #1a2530;
  color: #fff;
  padding: 16px;
  text-align: center;
  font-weight: 600;
}

.comparison-table th:first-child { text-align: right; }

.comparison-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
}

.comparison-table td:first-child {
  text-align: right;
  font-weight: 500;
  color: #1a2530;
}

.comp-winner {
  background: #dcfce7;
  color: #16a34a;
  font-weight: 600;
}

/* ===== Guide Steps ===== */

.guide-steps {
  margin: 40px 0;
}

.guide-steps-title {
  font-size: 22px;
  color: #1a2530;
  margin-bottom: 24px;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-item {
  display: flex;
  gap: 16px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary, #1a2530);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 16px;
  color: #1a2530;
  margin-bottom: 8px;
}

.step-text {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.step-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 12px;
}

/* ===== Landing Page Banner ===== */

.landing-banner {
  position: relative;
  min-height: 400px;
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 40px;
}

.landing-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.landing-banner-content {
  position: relative;
  z-index: 1;
  padding: 60px 40px;
  color: #fff;
  max-width: 600px;
}

.landing-banner-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.landing-banner-subtitle {
  font-size: 18px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.landing-banner-desc {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.85;
}

/* ===== Product Articles Section ===== */

.product-articles-section {
  margin: 32px 0;
}

.product-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.product-article-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.product-article-card:hover {
  transform: translateY(-2px);
}

.product-article-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.product-article-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-article-info {
  flex: 1;
  min-width: 0;
}

.product-article-info h4 {
  font-size: 14px;
  color: #1a2530;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-article-info p {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-cat {
  font-size: 11px;
  font-weight: 600;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-header h1 { font-size: 24px; }
  .kc-sections { grid-template-columns: repeat(2, 1fr); }
  .guides-grid { grid-template-columns: 1fr; }
  .comparisons-grid { grid-template-columns: 1fr; }
  .landing-banner-content { padding: 40px 20px; }
  .landing-banner-title { font-size: 28px; }
}

/* ===== Post Search ===== */

.blog-search {
  max-width: 500px;
  margin: 0 auto 32px;
}

.blog-search-input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.blog-search-input:focus {
  border-color: var(--primary, #1a2530);
}

/* ===== Post Navigation ===== */

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.post-nav-link {
  text-decoration: none;
  color: var(--primary, #1a2530);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-nav-link:hover {
  text-decoration: underline;
}

/* ===== Loading ===== */

.blog-loading {
  text-align: center;
  padding: 60px 20px;
}
