/* Archive products page layout */
.page-products { 
    margin: 16px 0; 
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cpc-products-layout { 
    display: grid; 
    grid-template-columns: 250px 1fr; 
    gap: 15px; 
    align-items: start;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cpc-products-filter { 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    background: #fff; 
    padding: 16px; 
    position: sticky; 
    top:1.5rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.cpc-filter-form h3 { margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size:1.2rem}
.cpc-filter-reset { border: 0; background: transparent; padding: 4px; line-height: 1; border-radius: 6px; cursor: pointer; color: #6b7280; }
.cpc-filter-reset .material-icons { font-size: 20px; }
.cpc-filter-reset:hover { background: #f3f4f6; color: #111827; }
.cpc-filter-reset:focus { outline: 2px solid #93c5fd; outline-offset: 2px; }

.cpc-filter-form .filter-group { 
    margin-bottom: 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cpc-filter-form label { 
    display: block; 
    font-weight: 500; 
    margin-bottom: 6px; 
    font-size: 13px;
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cpc-filter-form input[type="search"],
.cpc-filter-form input[type="number"] { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #d1d5db; 
    border-radius: 6px;
    box-sizing: border-box;
    max-width: 100%;
}

.cpc-filter-form .filter-list { 
    max-height: 200px; 
    overflow: auto; 
    border: 1px solid #e5e7eb; 
    border-radius: 6px; 
    padding: 8px; 
    margin-top: 6px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cpc-filter-form .filter-list label { 
    display: flex; 
    gap: 6px; 
    align-items: center; 
    margin: 4px 0;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.cpc-filter-form .price-range { display: flex; gap: 8px; align-items: center; }

.cpc-filter-form .actions { display: flex; gap: 8px; }

.cpc-products-grid .entry-title { 
    margin: 0 0 12px;
    font-size: 1.2rem;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.products-grid { 
    display: grid; 
    grid-template-columns: repeat(5, minmax(0, 1fr)); 
    gap: 15px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cpc-products-grid { 
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.cpc-ajax-loader { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,0.6); z-index: 10; }
.cpc-ajax-loader .spinner { width: 32px; height: 32px; border: 3px solid #e5e7eb; border-top-color: #111827; border-radius: 9999px; animation: cpc-spin .8s linear infinite; }
@keyframes cpc-spin { to { transform: rotate(360deg); } }

.cpc-sort { 
    display: flex; 
    align-items: center; 
    gap: 8px;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.cpc-sort-select { 
    min-width: 160px; 
    padding: 8px 10px; 
    border: 1px solid #d1d5db; 
    border-radius: 8px; 
    background: #fff; 
    color: #111827; 
    font-size: 14px; 
    line-height: 1.2;
    box-sizing: border-box;
    max-width: 100%;
}
.cpc-sort-select:hover { border-color: #9ca3af; }
.cpc-sort-select:focus { outline: 2px solid #93c5fd; outline-offset: 2px; border-color: #93c5fd; }
.cpc-onsale-toggle input[type="checkbox"] { width: 16px; height: 16px; }
.cpc-onsale-toggle span { font-size: 14px; color: #111827; }

/* Checkbox/Radio styling - custom đẹp hơn */
.cpc-filter-form .filter-list input[type="checkbox"],
.cpc-filter-form .filter-list input[type="radio"],
.cpc-onsale-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  display: inline-block;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

/* Radio bo tròn */
.cpc-filter-form .filter-list input[type="radio"] {
  border-radius: 999px;
}

.cpc-filter-form .filter-list input[type="checkbox"]:hover,
.cpc-filter-form .filter-list input[type="radio"]:hover,
.cpc-onsale-toggle input[type="checkbox"]:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.cpc-filter-form .filter-list input[type="checkbox"]:checked,
.cpc-onsale-toggle input[type="checkbox"]:checked {
  border-color: #111827;
  background: #111827;
}

.cpc-filter-form .filter-list input[type="checkbox"]:checked::after,
.cpc-onsale-toggle input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cpc-filter-form .filter-list input[type="radio"]:checked {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(15,23,42,0.12);
}

.cpc-filter-form .filter-list label:hover {
  background: #f9fafb;
  border-radius: 6px;
}

.cpc-filter-form .filter-list input[type="checkbox"]:focus-visible,
.cpc-filter-form .filter-list input[type="radio"]:focus-visible,
.cpc-onsale-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.cpc-products-grid .posts-navigation { 
    margin-top: 24px; 
    clear: both; 
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}
.cpc-products-grid .posts-navigation .nav-links { 
    display: flex; 
    justify-content: center; 
    flex-direction: row;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
}

/* Pagination */
.cpc-products-grid .navigation .nav-links ul.pagination { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.cpc-products-grid .navigation .nav-links ul.pagination li { list-style: none; }
/* Keep generic fallback too */
.cpc-products-grid .pagination { list-style: none; display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 0; margin: 12px 0 0; }
.cpc-products-grid .pagination li { list-style: none; }
.cpc-products-grid .pagination a,
.cpc-products-grid .pagination span { display: inline-block; min-width: 36px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; text-decoration: none; line-height: 1; text-align: center; }
.cpc-products-grid .pagination a:hover { background: #f9fafb; border-color: #9ca3af; color: #111827; }
.cpc-products-grid .pagination .current,
.cpc-products-grid .pagination li.active > span { background: #0d60ff; color: #fff; }
.cpc-products-grid .pagination a:focus { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* Support WP default markup: <ul class="page-numbers"> ... */
.cpc-products-grid ul.page-numbers { list-style: none; display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 0; margin: 12px 0 0; }
.cpc-products-grid ul.page-numbers li { list-style: none; }
.cpc-products-grid ul.page-numbers a,
.cpc-products-grid ul.page-numbers span { display: inline-block; min-width: 36px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; text-decoration: none; line-height: 1; text-align: center; }
.cpc-products-grid ul.page-numbers a:hover { background: #f9fafb; border-color: #9ca3af; color: #111827; }
.cpc-products-grid ul.page-numbers .current { background: #111827; color: #fff; border-color: #111827; }
.cpc-products-grid ul.page-numbers a:focus { outline: 2px solid #93c5fd; outline-offset: 2px; }

@media (max-width: 1024px) {
  .cpc-products-layout { 
    grid-template-columns: 200px 1fr; 
    gap: 12px;
  }
  .products-grid { 
    grid-template-columns: repeat(4, minmax(0, 1fr)); 
    gap: 12px;
  }
  .cpc-products-filter {
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .cpc-products-layout { 
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cpc-products-filter {
    position: static;
    top: auto;
  }
  .products-grid { 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 12px;
  }
  .cpc-sort {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .cpc-sort-select {
    width: 100%;
    min-width: auto;
  }
  .cpc-grid-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

@media (max-width: 640px) {
  .page-products {
    margin: 12px 0;
  }
  .products-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 10px;
  }
  .cpc-products-filter {
    padding: 12px;
  }
  .cpc-filter-form h3 {
    font-size: 1.1rem;
  }
  .cpc-products-grid .entry-title {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .products-grid { 
    grid-template-columns: minmax(0, 1fr); 
    gap: 12px;
  }
  .cpc-products-filter {
    padding: 10px;
  }
  .cpc-filter-form .filter-list {
    max-height: 150px;
  }
}

/* Product card styles have been moved to assets/css/product-card.css */

/* Toast notifications moved to assets/css/toast.css */

/* Active filter chips */
.cpc-active-filters { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}
.cpc-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 9999px;
    background: #f2f7ff;
    color: #0d60ff;
    border: 1px solid #0d60ff;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.cpc-filter-chip:hover { background: rgba(11, 94, 215, 0.12); border-color: rgba(11, 94, 215, 0.5); }
.cpc-filter-chip:focus-within { outline: 2px solid #93c5fd; outline-offset: 2px; }

.cpc-filter-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  color: #0b5ed7;
  margin-left: 4px;
  cursor: pointer;
}
.cpc-filter-remove:hover { background: rgba(11, 94, 215, 0.15); }
.cpc-filter-remove:focus { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* Ensure the filter group title spacing works nicely */
.cpc-filter-form .filter-group > strong + .cpc-active-filters { margin-top: 8px; }

/* Filter group visibility */
.cpc-filter-form .filter-group.is-hidden {
    display: none;
}

/* Active filters container */
.cpc-active-filters {
    margin-top: 8px;
}

/* Tax search inputs */
.cpc-tax-search {
    margin-top: 6px;
}

/* Grid header */
.cpc-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.cpc-grid-header .entry-title {
    flex: 0 1 auto;
    margin: 0;
    min-width: 0;
}

/* Sort label */
.cpc-sort label[for="cpc-sort-select"] {
    margin-right: 6px;
}

/* On sale toggle */
.cpc-onsale-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

/* Hidden checkbox for on_sale */
.cpc-on-sale-hidden {
    display: none !important;
}

/* Tax search inputs styling */
.cpc-tax-search {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    max-width: 100%;
}

/* Override default filter-list styles globally */
.cpc-filter-form .filter-group strong {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
    color: #111;
}
.cpc-filter-form .filter-group .cpc-tax-search {
    margin-bottom: 10px;
}
.cpc-filter-form .filter-list {
    max-height: none;
    overflow: visible;
    border: none;
    padding: 0;
}
/* Styling for all labels to look like simple links */
.cpc-filter-form .filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    margin: 2px 0;
    transition: background 0.2s;
}
.cpc-filter-form .filter-list label:hover {
    background: #f8fafc;
}
/* Hide checkboxes and radios */
.cpc-filter-form .filter-list input[type="checkbox"],
.cpc-filter-form .filter-list input[type="radio"] {
    display: none;
}
/* Text styling */
.cpc-filter-form .filter-list input[type="checkbox"] + span,
.cpc-filter-form .filter-list input[type="radio"] + span {
    font-size: 14px;
    color: #334155;
    font-weight: 400;
    transition: color 0.2s, font-weight 0.2s;
}
/* Active/Selected state */
.cpc-filter-form .filter-list input[type="checkbox"]:checked + span,
.cpc-filter-form .filter-list input[type="radio"]:checked + span {
    color: #2563eb !important;
    font-weight: 600;
}

/* Specific accordion overrides (if any remaining) */
.cpc-cat-item-row:hover .cpc-cat-toggle { background: #e2e8f0; }
.cpc-cat-toggle:hover { color: #0f172a !important; }

/* Category Accordion Tree Styles */
.cpc-cat-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cpc-cat-root > .cpc-cat-item {
    border-bottom: 1px solid #f1f5f9;
}
.cpc-cat-child > .cpc-cat-item {
    border-bottom: none;
    padding: 4px 0;
}
.cpc-cat-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.cpc-cat-item-row.is-expanded.is-root-row {
    background: #f1f5f9;
}
.cpc-cat-item-row label {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}
.cpc-cat-item-row input[type="checkbox"] {
    margin-right: 8px;
    display: none;
}
.cpc-cat-item-row span.cpc-cat-name {
    font-size: 14px;
    color: #334155;
    font-weight: 400;
}
.cpc-cat-item-row.is-selected span.cpc-cat-name {
    font-weight: 600;
}
.cpc-cat-toggle {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.cpc-cat-toggle .material-icons {
    font-size: 18px;
}
.cpc-cat-children-wrap {
    padding-left: 16px;
    margin-top: 4px;
    display: none;
}
.cpc-cat-children-wrap.is-expanded {
    display: block;
}


.cpc-hide-scrollbar::-webkit-scrollbar { display: none; }
.cpc-hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ====== EXTRACTED INLINE STYLES ====== */
.cpc-category-main-title {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.cpc-category-main-title h1 {
    margin: 0;
    font-size: 24px;
    color: #111;
    font-weight: 700;
}

.cpc-category-banner {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}
.cpc-category-banner .slider-home,
.cpc-category-banner .home-hero {
    margin: 0;
}
.cpc-category-banner .home-hero {
    display: block;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}
.cpc-category-banner .hero-left {
    width: 100%;
}
.cpc-category-banner .hero-viewport {
    border-radius: 8px;
}
.cpc-category-banner .hero-slide img {
    border-radius: 8px;
}

.cpc-category-children-blocks {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}
.cpc-category-children-blocks h2 {
    font-size: 16px;
    margin: 0 0 20px;
    color: #111;
    font-weight: 700;
}
.cpc-category-children-blocks .cpc-hide-scrollbar {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.cpc-child-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 90px;
    text-align: center;
    transition: transform 0.2s;
    text-decoration: none;
}
.cpc-child-item:hover {
    transform: scale(1.05);
}
.cpc-child-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    padding: 2px;
}
.cpc-child-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    padding: 2px;
}
.cpc-child-placeholder .material-icons {
    font-size: 28px;
    color: #9ca3af;
}
.cpc-child-name {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    line-height: 1.3;
}

.cpc-brands-quick-filter {
    margin-top: 16px;
    margin-bottom: 24px;
}
.cpc-brands-quick-filter > span {
    font-size: 13px;
    color: #6b7280;
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
}
.cpc-brands-chips-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
}
.cpc-brands-chips-inner {
    display: flex;
    gap: 10px;
    overflow: hidden;
    flex-wrap: nowrap;
    max-width: calc(100% - 40px);
    align-items: center;
}
.cpc-brand-chip {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
}
.cpc-brand-chip.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}
.cpc-brands-expand-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.cpc-brands-expand-btn .material-icons {
    font-size: 20px;
}

.cpc-grid-header .entry-title {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
}
.cpc-grid-header .cpc-product-count {
    font-weight: 400;
    font-size: 14px;
    color: #6b7280;
}
