/* Common styles */
.cursor-pointer {
  cursor: pointer;
}

.search-wrapper {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.search-focused {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-wrapper .input-group {
  border-radius: 6px;
  overflow: hidden;
}

.search-wrapper .form-control {
  transition: all 0.2s ease;
  height: 38px;
}

.search-wrapper .form-control:focus {
  box-shadow: none;
  border-color: #ced4da;
}

.search-wrapper .input-group-text {
  transition: all 0.2s ease;
}

.search-focused .input-group-text {
  border-color: #ced4da;
}

.btn-clear {
  transition: all 0.2s;
  z-index: 5;
}

.btn-clear:hover {
  transform: translateY(-50%) scale(1.2);
  color: #dc3545 !important;
}

.search-no-results {
  padding: 0 0 4px;
  color: #6c757d;
  font-style: italic;
}

.highlight {
  background-color: rgba(255, 230, 0, 0.4);
  font-weight: 500;
  border-radius: 2px;
  padding: 0 2px;
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #ddd #f5f5f5;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #ddd;
  border-radius: 10px;
}

/* Desktop Filter Styles */
.desktop-filter-container {
  transition: all 0.3s ease;
}

.desktop-filter-header {
  padding: 10px 0;
}

.desktop-filter-clear-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.desktop-applied-filters {
  border-radius: 8px;
  transition: all 0.3s ease;
}

.desktop-category-badges,
.desktop-supplier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.desktop-category-badge,
.desktop-supplier-badge {
  border-radius: 30px;
  padding: 6px 12px;
  transition: all 0.3s ease;
}

.desktop-category-badge .btn-close,
.desktop-supplier-badge .btn-close {
  opacity: 0.8;
  transition: all 0.2s ease;
}

.desktop-category-badge .btn-close:hover,
.desktop-supplier-badge .btn-close:hover {
  opacity: 1;
  transform: scale(1.2);
}

.desktop-category-filter,
.desktop-supplier-filter {
  border-radius: 8px;
  transition: all 0.3s ease;
}

.desktop-category-collapse-btn,
.desktop-supplier-collapse-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.desktop-category-collapse-btn:hover,
.desktop-supplier-collapse-btn:hover {
  background-color: rgba(59, 183, 126, 0.1);
}

.desktop-category-content,
.desktop-supplier-content {
  position: relative;
}

.desktop-category-search,
.desktop-supplier-search {
  margin-bottom: 15px;
}

.desktop-filter-search-input {
  border: 0 !important;
}

.desktop-search-clear {
  cursor: pointer;
}

.desktop-category-item,
.desktop-supplier-item {
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.desktop-category-item:hover,
.desktop-supplier-item:hover {
  background-color: rgba(238, 238, 238, 0.6);
}

.desktop-category-checkbox,
.desktop-supplier-checkbox {
  cursor: pointer;
}

.desktop-category-label,
.desktop-supplier-label {
  margin-bottom: 0;
}

.desktop-no-results {
  font-style: italic;
  color: #6c757d;
}

/* Mobile Filter Styles */
.mobile-filter-button {
  position: fixed !important;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--green-primary-site);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 999999 !important;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  font-size: 15px;
  pointer-events: auto;
  isolation: isolate;
}

.mobile-filter-button.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

.mobile-filter-button:active {
  transform: translateX(-50%) scale(0.96);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-filter-badge {
  background-color: white;
  color: var(--green-primary-site);
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-left: 8px;
  font-weight: bold;
}

/* Z-index fixes */
.product-cart-wrap,
.featured_swiper_slide,
.product-img-action-wrap {
  z-index: 1 !important; /* Lower z-index than the filter button */
}

/* Make sure the button is always visible and interactive */
body .mobile-filter-button {
  position: fixed !important;
  z-index: 9999999 !important;
  bottom: 80px !important;
}

.filter-modal-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
}

.filter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
  position: relative;
}

.filter-modal-header h5 {
  margin: 0;
  text-align: center;
  flex-grow: 1;
  font-weight: 600;
  font-size: 18px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.clear-all-btn {
  background: transparent;
  border: none;
  color: var(--green-primary-site);
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.clear-all-btn:hover {
  background-color: rgba(59, 183, 126, 0.1);
}

.applied-filters {
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #444;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: flex;
  align-items: center;
  background-color: rgba(59, 183, 126, 0.1);
  color: var(--green-primary-site);
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 13px;
  gap: 6px;
  transition: transform 0.2s;
}

.filter-chip button {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  padding: 2px;
  font-size: 14px;
}

.supplier-chip {
  background-color: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.filter-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.filter-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 16px 8px;
  font-size: 15px;
  font-weight: 500;
  color: #777;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn.active {
  color: var(--green-primary-site);
  font-weight: 600;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--green-primary-site);
}

.tab-badge {
  background-color: var(--green-primary-site);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.filter-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.filter-section {
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.search-box {
  position: relative;
  margin-bottom: 16px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: all 0.2s;
  background-color: #f8f8f8;
}

.search-box.focused {
  border-color: var(--green-primary-site);
  box-shadow: 0 0 0 2px rgba(59, 183, 126, 0.15);
  background-color: white;
}

.search-icon {
  color: #999;
  font-size: 16px;
  margin-right: 8px;
}

.search-box.focused .search-icon {
  color: var(--green-primary-site);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 15px;
  width: 100%;
  outline: none;
}

.clear-search {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  display: flex;
  padding: 6px;
  font-size: 16px;
  border-radius: 50%;
  transition: all 0.2s;
}

.clear-search:hover {
  color: #666;
  background-color: rgba(0, 0, 0, 0.05);
}

.filter-options {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-option {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.checkbox-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  position: absolute;
  z-index: 2;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
  background-color: var(--green-primary-site);
  border-color: var(--green-primary-site);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.filter-option label {
  flex: 1;
  cursor: pointer;
  font-size: 14px;
  margin: 0;
  color: #444;
}

.no-results {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: 14px;
  padding: 24px 0;
  justify-content: center;
}

.filter-footer {
  padding: 16px;
  border-top: 1px solid #eee;
  background-color: white;
}

.apply-filter-btn {
  width: 100%;
  background-color: var(--green-primary-site);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.apply-filter-btn:hover {
  background-color: #2a9f64;
}

.apply-filter-btn:active {
  transform: scale(0.98);
}

.filter-count {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Bootstrap overrides */
.desktop-filter-search-input {
  border: none;
  background-color: transparent;
  box-shadow: none;
  padding-right: 2rem;
}

.desktop-filter-search-input:focus {
  box-shadow: none;
}

.desktop-search-clear {
  z-index: 5;
}

/* Highlight style */
:global(.highlight) {
  background-color: rgba(255, 230, 0, 0.4);
  font-weight: 500;
  border-radius: 2px;
  padding: 0 2px;
}
