.jcauto-filter-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 30px 0;
  padding: 0 20px;
}

.jcauto-filter {
  background: #000;
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  width: 100%;
}

.jcauto-filter select {
  flex: 1;
  min-width: 150px;
  height: 44px;
  padding: 0 16px;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.jcauto-filter select:hover {
  background-color: #f8f8f8;
}

.jcauto-filter select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(203, 43, 43, 0.3);
}

.jcauto-filter select:disabled {
  background: #fff;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

#jcauto-search {
  background: #cb2b2b;
  color: #fff;
  border: none;
  padding: 0 32px;
  height: 44px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#jcauto-search:hover {
  background: #b02525;
}

#jcauto-search:active {
  transform: scale(0.98);
}

#jcauto-clear {
  background: #3a3a3a;
  color: #fff;
  border: none;
  padding: 0 24px;
  height: 44px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#jcauto-clear:hover {
  background: #4a4a4a;
}

#jcauto-clear:active {
  transform: scale(0.98);
}

.jcauto-content-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 20px auto 30px;
  padding: 0 12px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.jcauto-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.jcauto-sidebar h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #000;
}

.jcauto-filter-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.jcauto-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.jcauto-filter-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
}

.jcauto-filter-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

.jcauto-filter-section input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.jcauto-count {
  color: #666;
  font-weight: normal;
}

.jcauto-price-info {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #666;
}

.jcauto-price-inputs {
  display: flex;
  gap: 8px;
}

.jcauto-price-inputs input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.jcauto-results-area {
  flex: 1;
  min-width: 0;
  position: relative;
}

.jcauto-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.jcauto-results-header #jcauto-results-count {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.jcauto-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jcauto-sort label {
  font-size: 13px;
  color: #666;
  font-weight: 400;
  white-space: nowrap;
}

.jcauto-sort select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #333;
  cursor: pointer;
  min-width: 200px;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.jcauto-sort select:hover {
  border-color: #999;
}

.jcauto-sort select:focus {
  outline: none;
  border-color: #cb2b2b;
  box-shadow: 0 0 0 2px rgba(203, 43, 43, 0.1);
}

#jcauto-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.jcauto-product {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.jcauto-product:hover {
  border-color: #6b1b1b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.jcauto-thumb {
  width: 100%;
  background: #f9f9f9;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  position: relative;
  text-decoration: none;
  transition: background 0.3s ease;
}

.jcauto-thumb:hover {
  background: #f0f0f0;
}

.jcauto-thumb img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

/* Sale badge */
.jcauto-product.on-sale .jcauto-thumb::before {
  content: 'SALE';
  position: absolute;
  top: 10px;
  left: 10px;
  background: #dc3545;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  z-index: 1;
}

.jcauto-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  flex: 1;
}

.jcauto-brand {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.jcauto-title {
  color: #333;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.jcauto-title:hover {
  color: #6b1b1b;
  text-decoration: none;
}

.jcauto-stock {
  color: #28a745;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.jcauto-stock::before {
  content: '✓';
  font-weight: 700;
}

.jcauto-stock.out-of-stock {
  color: #dc3545;
}

.jcauto-stock.out-of-stock::before {
  content: '✕';
}

.jcauto-price {
  color: #333;
  font-size: 16px;
  font-weight: 700;
  margin-top: auto;
}

.jcauto-price del {
  color: #999;
  font-size: 14px;
  font-weight: 400;
  margin-right: 8px;
}

.jcauto-empty,
.jcauto-error {
  background: #f8f9fa;
  color: #333;
  padding: 40px;
  border-radius: 8px;
  text-align: center;
  grid-column: 1 / -1;
  border: 1px solid #e0e0e0;
}

#jcauto-load-more {
  margin: 24px auto 0;
  display: none;
  padding: 10px 24px;
  background: #6b1b1b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

#jcauto-load-more:hover {
  background: #5a1515;
}

#jcauto-load-more:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Loading spinner overlay */
.jcauto-loading-overlay {
  position: absolute;
  top: 70px;
  /* Start below the results header */
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  border-radius: 8px;
  min-height: 200px;
  /* Ensure minimum height */
}

.jcauto-loading-overlay.active {
  display: flex;
}

.jcauto-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #6b1b1b;
  border-radius: 50%;
  animation: jcauto-spin 0.8s linear infinite;
}

@keyframes jcauto-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Filter item states for show more/less */
.jcauto-filter-item {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.jcauto-filter-item.hidden {
  display: none;
}

/* Highlighted state for available product types */
.jcauto-filter-item.jcauto-filter-highlighted {
  background-color: #e8f5e9;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: -8px;
  margin-right: -8px;
  border-left: 3px solid #4caf50;
}

/* Disabled state for unavailable product types */
.jcauto-filter-item.jcauto-filter-disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: -8px;
  margin-right: -8px;
}

.jcauto-filter-item.jcauto-filter-disabled input[type="checkbox"] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Filter controls container */
.jcauto-filter-controls {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Show More/Less button */
.jcauto-show-toggle {
  background: transparent;
  color: #6b1b1b;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.jcauto-show-toggle:hover {
  color: #8b2b2b;
}

/* Reset button */
.jcauto-reset-btn {
  background: #e0e0e0;
  color: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}

.jcauto-reset-btn:hover {
  background: #d0d0d0;
}

/* --- CHOSEN-STYLE DROPDOWN STYLES --- */
.chosen-container {
  position: relative;
  width: 100%;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: left;
}

.chosen-choices {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 4px 8px;
  width: 100%;
  height: auto !important;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 6px;
  cursor: text;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  transition: border-color 0.2s ease;
}

.chosen-container-active .chosen-choices {
  border-color: #cb2b2b;
  box-shadow: 0 0 0 2px rgba(203, 43, 43, 0.1);
}

/* Search Field (Input) */
.chosen-choices li.search-field {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  flex: 1;
  min-width: 60px;
}

.chosen-choices li.search-field input {
  width: 100% !important;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none;
  color: #333;
  font-size: 100%;
  font-family: sans-serif;
}

.chosen-choices li.search-field input::placeholder {
  color: #999;
}

/* Selected Tags */
.chosen-choices li.search-choice {
  position: relative;
  margin: 0;
  padding: 4px 24px 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f0f0f0;
  color: #333;
  line-height: 1.4;
  cursor: default;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.chosen-choices li.search-choice .search-choice-close {
  position: absolute;
  top: 50%;
  right: 6px;
  display: block;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 1l10 10m0-10L1 11' stroke='%23999' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center center;
  font-size: 1px;
  cursor: pointer;
}

.chosen-choices li.search-choice .search-choice-close:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 1l10 10m0-10L1 11' stroke='%23cb2b2b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Dropdown */
.chosen-drop {
  position: absolute;
  top: 100%;
  left: -9999px;
  z-index: 1010;
  width: 100%;
  border: 1px solid #cb2b2b;
  border-top: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 6px 6px;
  margin-top: -1px;
}

.chosen-with-drop .chosen-drop {
  left: 0;
}

/* Results List */
.chosen-results {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  max-height: 240px;
  -webkit-overflow-scrolling: touch;
  list-style: none;
}

.chosen-results li {
  display: none;
  margin: 0;
  padding: 8px 12px;
  list-style: none;
  line-height: 1.4;
  word-wrap: break-word;
  -webkit-touch-callout: none;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background-color 0.1s;
  display: flex;
  /* Flex for checkbox alignment */
  align-items: center;
}

.chosen-results li.active-result {
  display: flex;
  cursor: pointer;
}

.chosen-results li.disabled-result {
  display: flex;
  color: #ccc;
  cursor: default;
}

.chosen-results li.highlighted,
.chosen-results li:hover {
  background-color: #cb2b2b;
  color: #fff;
}

.chosen-results li:hover .jcauto-count {
  color: rgba(255, 255, 255, 0.8);
}

.chosen-results li input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

/* Actions (Select All / Clear) */
.jcauto-dropdown-actions {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #eee;
  background: #f9f9f9;
  border-radius: 0 0 6px 6px;
}

.jcauto-dropdown-action-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.jcauto-dropdown-action-btn:hover {
  color: #cb2b2b;
}

@media (max-width: 768px) {
  .jcauto-content-wrapper {
    flex-direction: column;
  }

  .jcauto-sidebar {
    width: 100%;
  }

  .jcauto-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .jcauto-filter-controls {
    width: 100%;
  }

  .jcauto-show-toggle,
  .jcauto-reset-btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  /* Product grid - 2 columns on tablet */
  #jcauto-results {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Large tablets */
@media (max-width: 1024px) and (min-width: 769px) {
  #jcauto-results {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile */
@media (max-width: 480px) {
  #jcauto-results {
    grid-template-columns: 1fr;
  }
}