/* 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(4, 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 */
.cpc-filter-form .filter-list input[type="checkbox"],
.cpc-filter-form .filter-list input[type="radio"],
.cpc-onsale-toggle input[type="checkbox"] {
  accent-color: #111827;
}
.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: #111827; color: #fff; border-color: #111827; }
.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(3, 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(2, 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, 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: 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: rgba(11, 94, 215, 0.08);
  color: #0b5ed7;
  border: 1px solid rgba(11, 94, 215, 0.35);
  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%;
}

