/* Enable sticky elements across all browsers by preventing hidden-overflow scroll-clipping */
html,
body,
html body.dx-store {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

html body.dx-store :is(header, .dx-header, .header-area) {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1001 !important;
}

/* Stargo-identical 2-column article layout with sticky cover & related products */
.dx-editorial-main {
  background: #ffffff !important;
  padding: 16px 0 60px;
}

.dx-stargo-article-container {
  width: 100%;
  max-width: var(--dx-width);
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.dx-stargo-layout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
}

/* LEFT COLUMN: Featured Image + Sticky Related Products Box on Desktop */
.dx-stargo-left-col {
  padding-right: 28px;
  position: relative;
}
.dx-stargo-sticky-sidebar {
  position: relative;
  height: 100%;
}

/* Stargo vertical cover card */
.dx-stargo-cover-card {
  margin: 0 0 24px;
  border-radius: 20px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.dx-stargo-cover-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Khung sản phẩm liên quan đến chủ đề bài viết */
.dx-stargo-products-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

@media (min-width: 992px) {
  /* Trên PC: Khung sản phẩm đứng yên cố định (sticky) đi theo cuộn chuột */
  .dx-stargo-products-card {
    position: sticky !important;
    top: 104px !important;
    z-index: 15;
  }
}
@media (max-width: 991px) {
  /* Trên Mobile: Giữ nguyên luồng tĩnh bình thường */
  .dx-stargo-products-card {
    position: static !important;
    top: auto !important;
  }
}
.dx-stargo-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.dx-stargo-products-title {
  font-size: 16.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dx-stargo-products-title i {
  color: #0284c7;
}
.dx-stargo-products-more {
  font-size: 14.5px !important;
  font-weight: 600 !important;
  color: #0284c7 !important;
  text-decoration: none;
}
.dx-stargo-products-more:hover {
  text-decoration: underline;
}
.dx-stargo-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dx-stargo-p-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #f1f5f9;
}
.dx-stargo-p-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dx-stargo-p-thumb {
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dx-stargo-p-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dx-stargo-p-body {
  flex: 1;
  min-width: 0;
}
.dx-stargo-p-name {
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: #1e293b !important;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.dx-stargo-p-name:hover {
  color: #0284c7 !important;
}
.dx-stargo-p-price {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dx-p-sale {
  font-size: 16.5px !important;
  font-weight: 700 !important;
  color: #e11d48 !important;
}
.dx-p-origin {
  font-size: 13px !important;
  color: #94a3b8 !important;
  text-decoration: line-through;
}

/* Nút xem thêm sản phẩm trên Mobile */
.dx-stargo-products-toggle {
  display: none;
}

@media (max-width: 991px) {
  .dx-stargo-left-col {
    padding-right: 15px !important;
    margin-bottom: 28px !important;
  }
  .dx-stargo-right-col {
    padding-left: 15px !important;
  }
  /* Ẩn các sản phẩm từ vị trí thứ 2 trở đi trên mobile nếu chưa bấm Xem thêm */
  .dx-stargo-products-card:not(.dx-products-expanded) .dx-p-more-mobile {
    display: none !important;
  }
  .dx-stargo-products-card:not(.dx-products-expanded) .dx-stargo-p-item:first-child {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  .dx-stargo-products-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 14px;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0284c7 !important;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .dx-stargo-products-toggle:hover,
  .dx-stargo-products-toggle:active {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0369a1 !important;
  }
}

/* RIGHT COLUMN: Stargo Content */
.dx-stargo-right-col {
  padding-left: 20px;
}

/* Stargo Breadcrumb */
.dx-stargo-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15.5px !important;
  color: #64748b;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.dx-stargo-bc-icon {
  color: #0284c7;
  margin-right: 4px;
}
.dx-stargo-breadcrumb a {
  color: #475569;
  text-decoration: none;
  font-size: inherit !important;
}
.dx-stargo-breadcrumb a:hover {
  color: #0284c7 !important;
}
.dx-stargo-bc-sep {
  color: #cbd5e1;
}

/* Stargo Title */
.dx-stargo-article-title {
  font-size: clamp(30px, 3.2vw, 42px) !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.3 !important;
  margin: 0 0 24px !important;
  letter-spacing: -0.02em;
}

/* Stargo Table of Contents Box (Viền đậm bo góc, chữ to rõ, nút Xem thêm) */
.dx-stargo-toc-wrap {
  border: 2px solid #000000 !important;
  border-radius: 16px !important;
  padding: 24px 28px !important;
  background: #fafafa !important;
  margin-bottom: 28px !important;
}
.dx-stargo-toc-heading {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-bottom: 16px !important;
}
.dx-stargo-toc-nav {
  max-height: 190px;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.dx-stargo-toc-nav.dx-toc-expanded {
  max-height: 1500px;
}
.dx-stargo-toc-list {
  padding-left: 24px;
  margin: 0;
  list-style: decimal;
}
.dx-stargo-toc-list li {
  margin: 9px 0 !important;
  font-size: 17.5px !important;
  line-height: 1.65 !important;
  color: #1e293b !important;
}
.dx-stargo-toc-list a {
  color: #1e293b !important;
  text-decoration: none;
  font-size: inherit !important;
  line-height: inherit !important;
}
.dx-stargo-toc-list a:hover {
  color: #0284c7 !important;
  text-decoration: underline !important;
}
.dx-stargo-toc-toggle {
  background: transparent;
  border: 0;
  padding: 12px 0 0;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dx-stargo-toc-toggle:hover {
  text-decoration: underline !important;
}

/* Sapo / Description: In đậm nghiêng to rõ như Stargo */
.dx-stargo-sapo,
.dx-stargo-sapo * {
  font-size: 19.5px !important;
  line-height: 1.75 !important;
  color: #0f172a !important;
  font-style: italic !important;
  font-weight: 700 !important;
}
.dx-stargo-sapo {
  margin-bottom: 26px !important;
}
.dx-stargo-sapo p {
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  font-weight: inherit !important;
  font-style: inherit !important;
  margin: 0 !important;
}

/* Stargo Content Styling - Chữ to rõ hiện đại (19px) */
.dx-story-reading .ck-content p,
.dx-story-reading .ck-content p *,
.dx-story-reading .ck-content div:not(.dx-story-toc):not(.dx-stargo-toc-wrap),
.dx-story-reading .ck-content div:not(.dx-story-toc):not(.dx-stargo-toc-wrap) *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.dx-story-reading .ck-content li,
.dx-story-reading .ck-content li * {
  font-size: 19px !important;
  line-height: 1.85 !important;
  color: #1e293b !important;
}

.dx-story-reading .ck-content p {
  margin: 0 0 1.35em !important;
}

.dx-story-reading .ck-content :is(strong, b, [style*="font-weight: 700"], [style*="font-weight:700"], [style*="font-weight: bold"], [style*="font-weight:bold"]) {
  font-weight: 700 !important;
  color: #0f172a !important;
}

.dx-story-reading .ck-content :is(em, i) {
  font-style: italic !important;
}

/* Stargo H2: Thanh đứng màu xanh "| Tiêu đề" và toàn bộ chữ màu xanh */
.dx-story-reading .ck-content h2,
.dx-story-reading .ck-content h2 * {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
  line-height: 1.35 !important;
}
.dx-story-reading .ck-content h2 {
  margin: 38px 0 16px !important;
  position: relative !important;
  padding-left: 16px !important;
  background: none !important;
  border: 0 !important;
}
.dx-story-reading .ck-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  background: #0284c7;
  border-radius: 3px;
}

.dx-story-reading .ck-content h3,
.dx-story-reading .ck-content h3 * {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.4 !important;
  margin: 28px 0 14px !important;
}

.dx-story-reading .ck-content :is(ul, ol) {
  padding-left: 1.8em;
  margin-bottom: 1.5em;
  font-size: 19px !important;
  line-height: 1.85 !important;
  color: #1e293b;
}
.dx-story-reading .ck-content li {
  margin: 8px 0;
}

.dx-story-reading .ck-content :is(figure, img, iframe, video, table) {
  max-width: 100% !important;
}
.dx-story-reading .ck-content img {
  height: auto !important;
  display: block;
  margin: 20px auto;
  border-radius: 12px;
}

/* Share & Comments */
.dx-stargo-share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin: 36px 0;
  font-size: 14px;
  color: #64748b;
}
.dx-stargo-share-bar span:first-child {
  font-weight: 700;
  color: #0f172a;
  margin-right: 6px;
}
.dx-stargo-share-bar a, .dx-stargo-share-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.dx-stargo-share-bar a:hover, .dx-stargo-share-bar button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.dx-stargo-comments {
  margin-top: 32px;
}

/* Related articles */
.dx-stargo-related {
  margin-top: 50px;
  padding-top: 36px;
  border-top: 1px solid #e2e8f0;
}
.dx-story-related-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.dx-story-related-heading h2 {
  font-size: 24px !important;
  font-weight: 800 !important;
  margin: 0;
}
.dx-story-related-heading > a {
  font-size: 14px;
  font-weight: 600;
  color: #0284c7;
  text-decoration: none;
}
.dx-story-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.dx-story-related-grid > article {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.dx-story-related-grid > article:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.dx-story-related-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.dx-story-related-grid > article > div {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.dx-story-related-grid time {
  font-size: 12px;
  color: #94a3b8;
}
.dx-story-related-grid h3 {
  font-size: 17px !important;
  line-height: 1.4 !important;
  margin: 8px 0 10px !important;
  font-weight: 700;
}
.dx-story-related-grid h3 a {
  color: #0f172a;
  text-decoration: none;
}
.dx-story-related-grid h3 a:hover {
  color: #0284c7;
}
.dx-story-related-grid p {
  color: #64748b;
  font-size: 14px !important;
  line-height: 1.5;
  margin: 0 0 14px;
  flex: 1;
}
.dx-story-more {
  font-size: 13px;
  font-weight: 700;
  color: #0284c7;
  text-decoration: none;
  margin-top: auto;
}

/* Responsive */
@media(max-width: 991px) {
  .dx-stargo-left-col {
    padding-right: 0;
    margin-bottom: 30px;
  }
  .dx-stargo-right-col {
    padding-left: 0;
  }
  .dx-stargo-sticky-sidebar {
    position: static;
  }
  .dx-story-related-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width: 767px) {
  .dx-stargo-article-container {
    padding-left: 18px;
    padding-right: 18px;
  }
  .dx-stargo-article-title {
    font-size: 24px !important;
  }
  .dx-stargo-cover-card img {
    aspect-ratio: 16 / 10;
  }
}
