/**
 * CK17 CLEAN MODERN PRODUCT CATALOG STYLESHEET
 * Minimalist, High-Clarity Industrial Catalog UI (Matching Reference Images 1 & 2)
 *
 * @package Flatsome / vinatech-child
 */

:root {
  --ck17-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ck17-red: #d9363e;
  --ck17-black: #111111;
  --ck17-text: #222222;
  --ck17-muted: #666666;
  --ck17-card-bg: #f5f5f5;
  --ck17-card-hover: #ebebeb;
  --ck17-border: #e5e5e5;
}

.ck17-catalog-main,
.ck17-product-cat-main {
  font-family: var(--ck17-font) !important;
  color: var(--ck17-text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ck17-catalog-main h1,
.ck17-catalog-main h2,
.ck17-catalog-main h3,
.ck17-product-cat-main h1,
.ck17-product-cat-main h2,
.ck17-product-cat-main h3 {
  font-family: var(--ck17-font) !important;
  margin: 0;
}

/* Suppress Flatsome's default duplicated page titles */
.post-type-archive-product .page-title,
.tax-product_cat .page-title,
.shop-page-title-wrap,
.custom-page-title,
.category-page-title {
  display: none !important;
}

.ck17-wrap {
  width: min(100% - 32px, 1240px);
  margin-inline: auto;
}

/* ==========================================================================
   1. TOP "DANH MỤC" SECTION (MATCHING REFERENCE IMAGE 1)
   ========================================================================== */
.ck17-top-categories {
  background: #ffffff;
  padding: 44px 0 36px;
}

.ck17-top-cat-header {
  text-align: center;
  margin-bottom: 32px;
}

.ck17-top-cat-header h1 {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #000000 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  line-height: 1.25 !important;
  margin: 0 0 10px 0 !important;
}

.ck17-top-cat-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--ck17-muted);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.55;
}

.ck17-cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.ck17-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--ck17-card-bg);
  border-radius: 10px;
  padding: 24px 16px 20px;
  text-decoration: none !important;
  text-align: center;
  border: none;
  box-shadow: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.ck17-cat-card:hover {
  background: var(--ck17-card-hover);
  transform: translateY(-2px);
}

.ck17-cat-card-img {
  width: 100%;
  height: 165px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.ck17-cat-card-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.25s ease;
}

.ck17-cat-card:hover .ck17-cat-card-img img {
  transform: scale(1.04);
}

.ck17-cat-card-title {
  font-size: 15.5px !important;
  font-weight: 700 !important;
  color: var(--ck17-black) !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  text-transform: none !important;
}

/* ==========================================================================
   2. SIDEBAR ("Danh mục sản phẩm") + 4-COLUMN PRODUCT GRID (REFERENCE IMAGE 2)
   ========================================================================== */
.ck17-catalog-section {
  background: #ffffff;
  padding: 36px 0 64px;
  border-top: 1px solid #f0f0f0;
}

.ck17-catalog-section--category {
  border-top: none;
  padding-top: 36px;
}

.ck17-catalog-layout {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* Left Sidebar: Red Title + Thin Rule + Flat #f5f5f5 Blocks */
.ck17-sidebar {
  width: 100%;
}

.ck17-sidebar-title {
  font-size: 20px !important;
  font-weight: 500 !important;
  color: var(--ck17-red) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.3 !important;
  padding: 0 0 12px 0 !important;
  margin: 0 0 14px 0 !important;
  border-bottom: 1px solid var(--ck17-border) !important;
}

.ck17-sidebar-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ck17-sidebar-list li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.ck17-sidebar-list li a {
  display: block;
  background: var(--ck17-card-bg);
  color: #333333;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.45;
  padding: 11px 16px;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ck17-sidebar-list li a:hover,
.ck17-sidebar-list li a.is-active {
  background: var(--ck17-card-hover);
  color: var(--ck17-red);
}

.ck17-sidebar-list li a.is-active {
  font-weight: 600;
}

/* Right Main Area: Clean Category Header + 4-Column Borderless Product Grid */
.ck17-main-products {
  width: 100%;
  min-width: 0;
}

.ck17-cat-page-header {
  margin: 0 0 24px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ck17-border);
}

.ck17-cat-page-title {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--ck17-black) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  text-transform: none !important;
}

.ck17-prod-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 24px;
}

.ck17-prod-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.ck17-prod-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  padding: 6px;
  box-sizing: border-box;
  text-decoration: none !important;
  overflow: hidden;
}

.ck17-prod-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.ck17-prod-item:hover .ck17-prod-thumb img {
  transform: scale(1.04);
}

.ck17-prod-noimg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f9f9f9;
  color: #999999;
  font-size: 13px;
  font-weight: 600;
}

.ck17-prod-title {
  font-size: 14.5px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  color: var(--ck17-text) !important;
  margin: 12px 0 0 0 !important;
  text-align: center !important;
  text-transform: none !important;
}

.ck17-prod-title a {
  color: var(--ck17-text) !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.ck17-prod-title a:hover {
  color: var(--ck17-red) !important;
}

/* ==========================================================================
   3. PAGINATION & EMPTY NOTICE
   ========================================================================== */
.ck17-pagination {
  margin-top: 44px;
  display: flex;
  justify-content: center;
}

.ck17-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ck17-pagination .page-numbers li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.ck17-pagination .page-numbers li a,
.ck17-pagination .page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: #333333;
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  text-decoration: none !important;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ck17-pagination .page-numbers li a:hover {
  background: #e5e5e5;
  color: var(--ck17-red);
}

.ck17-pagination .page-numbers li span.current {
  background: var(--ck17-red);
  color: #ffffff;
}

.ck17-empty-notice {
  padding: 40px 20px;
  text-align: center;
  background: #f9f9f9;
  border-radius: 8px;
}

.ck17-empty-notice p {
  font-size: 15px;
  color: var(--ck17-muted);
  margin: 0 0 16px;
}

.ck17-btn-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  background: var(--ck17-red);
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  text-decoration: none !important;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .ck17-cat-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .ck17-catalog-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
  }

  .ck17-prod-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 18px;
  }
}

@media (max-width: 768px) {
  body.post-type-archive-product .bt-social,
  body.post-type-archive-product #menu-fixed,
  body.tax-product_cat .bt-social,
  body.tax-product_cat #menu-fixed {
    display: none !important;
  }

  .ck17-catalog-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ck17-sidebar-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ck17-sidebar-list li a {
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13.5px;
  }
}

@media (max-width: 599px) {
  .ck17-top-categories {
    padding: 28px 0 24px;
  }

  .ck17-top-cat-header {
    margin-bottom: 20px;
  }

  .ck17-top-cat-header h1 {
    font-size: 22px !important;
  }

  .ck17-top-cat-sub {
    font-size: 13px;
  }

  .ck17-cat-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .ck17-cat-card {
    padding: 16px 10px 14px;
    border-radius: 8px;
  }

  .ck17-cat-card-img {
    height: 115px;
    margin-bottom: 10px;
  }

  .ck17-cat-card-title {
    font-size: 13.5px !important;
  }

  .ck17-catalog-section {
    padding: 24px 0 44px;
  }

  /* 2 Columns on Mobile for Product Grid */
  .ck17-prod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px 14px !important;
  }

  .ck17-prod-title {
    font-size: 13.5px !important;
    margin-top: 8px !important;
  }
}
