/* General Widget Styles */
.wc-essential-filter-widget {
  margin-bottom: 35px;
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #f0f0f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wc-essential-filter-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.wc-essential-filter-widget .widget-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  position: relative;
  padding-bottom: 12px;
  letter-spacing: -0.02em;
}

.wc-essential-filter-widget .widget-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: #000;
  border-radius: 2px;
}

.filter-group {
  margin-bottom: 0;
}

/* Checkbox Styles (Category, Stock, Sale) */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 15px;
  color: #555;
  transition: all 0.2s ease;
  padding: 4px 0;
}

.filter-checkbox:last-child {
  margin-bottom: 0;
}

.filter-checkbox:hover {
  color: #000;
  transform: translateX(5px);
}

.filter-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filter-checkbox input[type="checkbox"]:checked {
  background-color: #000;
  border-color: #000;
}

.filter-checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
}

/* Color Filters */
.color-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.color-option {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.color-option input[type="checkbox"] {
  display: none;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 1;
}

.color-option input[type="checkbox"]:checked + .color-swatch {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #000;
  border-color: transparent;
}

.color-option:hover .color-swatch {
  transform: scale(1.1);
}

/* Tooltip for Colors */
.color-option::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: #000;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.color-option::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  border: 5px solid transparent;
  border-top-color: #000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.color-option:hover::before,
.color-option:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}

/* Size Filters */
.size-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.size-option {
  cursor: pointer;
}

.size-option input[type="checkbox"] {
  display: none;
}

.size-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 45px;
  padding: 0 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  transition: all 0.2s ease;
  background: #fff;
}

.size-option input[type="checkbox"]:checked + .size-label {
  background: #000;
  color: #fff;
  border-color: #000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.size-option:hover .size-label {
  border-color: #000;
  color: #000;
}

/* Price Filter */
.price-inputs {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
}

.price-inputs input {
  flex: 1;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}

.price-inputs input:focus {
  outline: none;
  border-color: #000;
}

.price-inputs span {
  color: #999;
  font-weight: 600;
}

/* Sort Filter */
.wc-essential-filter-widget select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  transition: border-color 0.2s;
}

.wc-essential-filter-widget select:focus {
  outline: none;
  border-color: #000;
}

/* Buttons */
.wc-essential-filter-button,
.wc-essential-reset-button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.wc-essential-filter-button {
  background: #000;
  color: #fff;
  margin-bottom: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.wc-essential-filter-button:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wc-essential-reset-button {
  background: #f5f5f5;
  color: #333;
  border: 1px solid transparent;
}

.wc-essential-reset-button:hover {
  background: #fff;
  border-color: #ddd;
  color: #000;
}

/* Product Grid Results */
.wc-essential-filter-results {
  position: relative;
  min-height: 300px;
}

.wc-essential-filter-results.loading {
  opacity: 0.6;
  pointer-events: none;
}

.wc-essential-filter-results.loading::after {
  content: "";
  position: absolute;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) rotate(360deg);
  }
}

.wc-essential-products-grid {
  display: grid;
  gap: 30px;
}

.wc-essential-products-grid.columns-1 {
  grid-template-columns: 1fr;
}
.wc-essential-products-grid.columns-2 {
  grid-template-columns: repeat(2, 1fr);
}
.wc-essential-products-grid.columns-3 {
  grid-template-columns: repeat(3, 1fr);
}
.wc-essential-products-grid.columns-4 {
  grid-template-columns: repeat(4, 1fr);
}
.wc-essential-products-grid.columns-5 {
  grid-template-columns: repeat(5, 1fr);
}
.wc-essential-products-grid.columns-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Result Count */
.wc-essential-result-count {
  margin-bottom: 25px;
  font-size: 15px;
  color: #666;
  font-weight: 500;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

/* Pagination */
.wc-essential-pagination {
  margin-top: 50px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.wc-essential-pagination ul {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 8px;
}

.wc-essential-pagination li {
  display: inline-block;
}

.wc-essential-pagination a,
.wc-essential-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e0e0e0;
  border-radius: 50%; /* Circular pagination */
  color: #555;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #fff;
}

.wc-essential-pagination a:hover,
.wc-essential-pagination span.current {
  background: #000;
  color: #fff;
  border-color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.wc-essential-no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  font-size: 18px;
  color: #666;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px dashed #ddd;
}

/* Responsive */
@media (max-width: 1024px) {
  .wc-essential-products-grid.columns-4,
  .wc-essential-products-grid.columns-5,
  .wc-essential-products-grid.columns-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .wc-essential-products-grid.columns-3,
  .wc-essential-products-grid.columns-4,
  .wc-essential-products-grid.columns-5,
  .wc-essential-products-grid.columns-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .wc-essential-filter-widget {
    padding: 20px;
    margin-bottom: 25px;
  }
}

@media (max-width: 480px) {
  .wc-essential-products-grid.columns-2,
  .wc-essential-products-grid.columns-3,
  .wc-essential-products-grid.columns-4,
  .wc-essential-products-grid.columns-5,
  .wc-essential-products-grid.columns-6 {
    grid-template-columns: 1fr;
  }
}
