/* KS Article Product Template — adapted from universal_product_article_template_system */

body.ks-article-template {
  --ks-brand: #dc2626;
  --ks-brand-dark: #b91c1c;
  --ks-zalo: #0068ff;
  --ks-slate: #1e293b;
  --ks-muted: #64748b;
  --ks-border: #e2e8f0;
  --ks-bg: #f1f5f9;
  background: var(--ks-bg);
}

body.ks-article-template #secondary,
body.ks-article-template .blog-sidebar,
body.ks-article-template #post-sidebar,
body.ks-article-template .large-3.col {
  display: none !important;
}

body.ks-article-template .post-sidebar,
body.ks-article-template .large-9.col,
body.ks-article-template .large-12.col {
  max-width: 100% !important;
  flex: 0 0 100% !important;
  width: 100% !important;
}

body.ks-article-template .entry-header,
body.ks-article-template .entry-title {
  display: none !important; /* title shown in ks-article-head via theme title still - keep theme H1 */
}

/* Keep theme H1 visible above layout if present */
body.ks-article-template .entry-header {
  display: block !important;
  margin-bottom: 0.5rem;
}
body.ks-article-template .entry-header .entry-divider,
body.ks-article-template .entry-meta {
  display: none !important;
}

.ks-article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto 5.5rem;
  padding: 0 4%;
}

@media (min-width: 992px) {
  .ks-article-layout {
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 2rem;
    padding: 0;
  }
}

.ks-article-main {
  min-width: 0;
}

.ks-article-head {
  margin-bottom: 1rem;
}

.ks-breadcrumb {
  font-size: 12px;
  color: var(--ks-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.ks-breadcrumb a { color: var(--ks-muted); text-decoration: none; }
.ks-breadcrumb a:hover { text-decoration: underline; }
.ks-breadcrumb .sep { opacity: 0.5; }
.ks-breadcrumb .current {
  color: var(--ks-slate);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ks-badge-row { margin-bottom: 0.5rem; }
.ks-badge-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
}

.ks-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 12px;
  color: var(--ks-muted);
  border-bottom: 1px solid var(--ks-border);
  padding-bottom: 0.85rem;
  margin-top: 0.5rem;
}
.ks-meta-stock { color: #059669; font-weight: 600; }

.ks-article-body {
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: 1rem;
  padding: 1.25rem 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  line-height: 1.65;
  font-size: 15px;
  color: #334155;
}
.ks-article-body img {
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
}

/* Product card */
.ks-product-card {
  position: relative;
  background: #fff;
  border: 2px solid rgba(220, 38, 38, 0.28);
  border-radius: 1rem;
  padding: 1.15rem;
  margin: 1.25rem 0;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.ks-product-card__badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--ks-brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-bottom-left-radius: 0.75rem;
}
.ks-product-card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: center;
}
@media (min-width: 640px) {
  .ks-product-card__grid {
    grid-template-columns: 5fr 7fr;
  }
}
.ks-product-card__media {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--ks-border);
}
.ks-product-card__media img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.ks-product-card__media:hover img {
  transform: scale(1.04);
}
.ks-product-card__ship {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
}
.ks-product-card__title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  color: var(--ks-slate);
}
.ks-product-card__title a {
  color: inherit;
  text-decoration: none;
}
.ks-product-card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.ks-card-price {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--ks-brand);
}
.ks-card-oldprice {
  font-size: 0.875rem;
  color: #94a3b8;
  text-decoration: line-through;
}
.ks-card-discount {
  font-size: 11px;
  font-weight: 700;
  color: var(--ks-brand);
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
}
.ks-product-card__features {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #475569;
}
.ks-product-card__features li {
  margin: 0.35rem 0;
}
.ks-product-card__features .fa {
  color: #10b981;
  margin-right: 0.35rem;
}
.ks-product-card__variants {
  background: #f8fafc;
  border: 1px solid var(--ks-border);
  border-radius: 0.75rem;
  padding: 0.65rem;
  margin-top: 0.75rem;
}
.ks-product-card__variants label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 0.4rem;
}
.ks-variant-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.ks-variant-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.45rem 0.5rem;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
}
.ks-variant-btn.is-active,
.ks-variant-btn:hover {
  border-color: var(--ks-brand);
  color: var(--ks-brand);
  background: #fef2f2;
}
.ks-product-card__cta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
@media (min-width: 480px) {
  .ks-product-card__cta {
    flex-direction: row;
  }
}

.ks-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 12px;
  padding: 0.75rem 1rem;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.ks-btn-buy {
  flex: 1;
  background: var(--ks-brand);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}
.ks-btn-buy:hover { background: var(--ks-brand-dark); color: #fff !important; }
.ks-btn-zalo {
  flex: 1;
  background: var(--ks-zalo);
  color: #fff !important;
}
.ks-btn-zalo:hover { opacity: 0.92; color: #fff !important; }
.ks-btn-quote {
  width: 100%;
  background: #059669;
  color: #fff !important;
}
.ks-btn-quote:hover { background: #047857; }
.ks-btn-call {
  background: #ecfdf5;
  color: #047857 !important;
  border: 1px solid #a7f3d0;
}

.ks-guide-block {
  margin-top: 1.25rem;
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: 1rem;
  padding: 1.15rem 1.25rem;
}
.ks-guide-block h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--ks-slate);
}
.ks-guide-block p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

/* Sidebar */
.ks-article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.ks-side-card {
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: 1rem;
  padding: 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ks-side-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
}
.ks-side-card__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ks-slate);
}
.ks-side-card__head p {
  margin: 0.15rem 0 0;
  font-size: 11px;
  color: var(--ks-muted);
}
.ks-online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  margin-top: 0.35rem;
}
.ks-quick-quote label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin: 0.45rem 0 0.25rem;
}
.ks-quick-quote input {
  width: 100%;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
}
.ks-quick-quote input[readonly] {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}
.ks-secure {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin: 0.5rem 0 0;
}
.ks-hotline-box {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ks-hotline-box p {
  margin: 0;
  font-size: 11px;
  color: var(--ks-muted);
}
.ks-hotline-box strong {
  display: block;
  font-size: 1.05rem;
  color: var(--ks-brand);
  font-weight: 800;
}
.ks-hotline-call {
  background: #fef2f2;
  color: var(--ks-brand);
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ks-promo-card {
  background: #0f172a;
  border-color: #1e293b;
  color: #fff;
}
.ks-promo-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  background: #f59e0b;
  color: #0f172a;
  padding: 0.15rem 0.45rem;
  border-radius: 0.3rem;
  margin-bottom: 0.45rem;
}
.ks-promo-card h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
}
.ks-promo-card p {
  margin: 0.5rem 0 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}
.ks-promo-card strong { color: #fbbf24; }
.ks-side-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}
.ks-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ks-cat-list li {
  border-bottom: 1px solid #f8fafc;
}
.ks-cat-list a {
  display: block;
  padding: 0.45rem 0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}
.ks-cat-list a:hover { color: var(--ks-brand); }

/* Sticky dock */
.ks-sticky-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--ks-border);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
  padding: 0.55rem 0.75rem;
}
body.ks-article-template.has-sticky-footer-bar .ks-sticky-dock {
  bottom: 58px; /* avoid conflict with contact bar if present */
}
.ks-sticky-dock__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ks-sticky-dock__info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.ks-sticky-dock__info img {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
  border: 1px solid var(--ks-border);
  display: none;
}
@media (min-width: 640px) {
  .ks-sticky-dock__info img { display: block; }
}
.ks-sticky-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ks-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.ks-sticky-price {
  font-size: 12px;
  font-weight: 800;
  color: var(--ks-brand);
}
.ks-sticky-dock__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.ks-sticky-dock__actions .ks-btn {
  padding: 0.55rem 0.7rem;
  font-size: 11px;
}
.ks-sticky-dock__actions .ks-btn span {
  display: none;
}
@media (min-width: 768px) {
  .ks-sticky-dock__actions .ks-btn span { display: inline; }
}

.ks-embed-missing {
  padding: 0.75rem;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 0.5rem;
  font-size: 13px;
}
