.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price-range-wrapper {
}

.range-slider {
  position: relative;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 9999px;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.range-fill {
  background: var(--primary);
  transition: all 0.1s ease;
}

.range-handle {
  border-radius: 50%;
  cursor: grab;
  z-index: 10;
  transition: all 0.2s ease;
  width: 14px;
  height: 14px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: var(--primary);
  border: none;
  box-shadow: none;
}

.range-handle:first-of-type {
  background: var(--primary);
  border: none;
  z-index: 11;
}

.range-handle:hover {
  transform: translate(-50%, -50%);
  box-shadow: none;
}

.range-handle.active {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: none;
  z-index: 15;
}

.range-handle:active,
.range-handle.dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: none;
  z-index: 20;
}

.price-tick-container {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 5;
}
.price-tick-line {
  width: 2px;
  height: 12px;
  background-color: #9ca3af;
  transition: all 0.3s ease;
  border-radius: 1px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.price-tick-line.active {
  background-color: var(--primary);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  box-shadow: none;
  transform: translate(-50%, -50%) scale(1.2);
  border: none;
  z-index: 15;
}

.price-tick-container:first-child .price-tick-line {
  background-color: var(--primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  box-shadow: none;
  transform: translate(-50%, -50%);
  border: none;
  z-index: 15;
}

.price-tick-container:nth-child(2) .price-tick-line {
  background-color: var(--primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  box-shadow: none;
  transform: translate(-50%, -50%);
  border: none;
  z-index: 15;
}

.price-tick-container:first-child .price-label {
  color: var(--primary);
  font-weight: 600;
  transform: translateX(-50%) scale(1.1);
}

.price-tick-container:nth-child(2) .price-label {
  font-weight: 400;
  color: #6b7280;
  transform: translateX(-50%) scale(1);
}

.price-label {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #6b7280;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.price-label.font-semibold {
  font-weight: 600;
  color: var(--primary);
  transform: translateX(-50%) scale(1.1);
}

.pagination-wrapper .pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-wrapper .page-item {
  margin: 0;
}

.pagination-wrapper .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 14px;
  color: #6b7280;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination-wrapper .page-link:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-wrapper .page-item.active .page-link {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-wrapper .page-item.disabled .page-link {
  color: #d1d5db;
  cursor: not-allowed;
}

.pagination-wrapper .page-item.disabled .page-link:hover {
  background-color: white;
  color: #d1d5db;
  border-color: #d1d5db;
}

/* Tablet styles */
@media (max-width: 1024px) and (min-width: 769px) {
  .max-w-\[1277px\] {
    max-width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .flex-wrap.md\:flex-wrap.lg\:flex-nowrap {
    flex-wrap: wrap;
  }
  
  .flex-1.min-w-\[120px\].lg\:min-w-\[80px\] {
    min-width: 140px;
    flex: 1 1 calc(50% - 3px);
  }
}

@media (max-width: 768px) {
  #mobile-filter-sidebar {
    background-color: rgba(0, 0, 0, 0.3);
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .max-w-\[1277px\] {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .lg\:flex {
    flex-direction: column;
  }

  .lg\:w-1\/4,
  .lg\:w-3\/4 {
    width: 100%;
  }

  .flex-between > div {
    justify-content: center;
  }

  .range-handle {
    width: 14px;
    height: 14px;
    border-width: 3px;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .range-slider {
    height: 6px;
  }

  .price-tick-line {
    height: 12px;
  }

  .price-tick-line.active {
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%) scale(1.2);
  }

  .price-tick-container:first-child .price-tick-line {
    width: 14px;
    height: 14px;
  }

  .price-tick-container:nth-child(2) .price-tick-line {
    width: 14px;
    height: 14px;
  }

  /* Mobile Filter and Sort Buttons Styling */
  .mobile-filter-sort-buttons-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    border-radius: 9999px; /* This makes the combined shape pill-like */
    overflow: hidden; /* Ensures content respects border-radius */
    background-color: white; /* White background for the wrapper */
    width: 100%; /* Ensure the wrapper takes full available width */
  }

  .mobile-filter-sort-buttons-wrapper #filter-btn-mobile,
  .mobile-filter-sort-buttons-wrapper #sort-btn-mobile {
    flex: 1;
    background: none;
    border: none;
    color: #1a202c; /* Text color for the buttons */
    height: 100%; /* Take full height of the wrapper */
    padding: 0 10px; /* Adjust padding as needed */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem; /* Equivalent to text-2 */
  }

  .mobile-filter-sort-buttons-wrapper #filter-btn-mobile {
    border-right: 1px solid #d1d5db; /* Vertical separator */
  }

  .mobile-filter-sort-buttons-wrapper #filter-btn-mobile:hover,
  .mobile-filter-sort-buttons-wrapper #sort-btn-mobile:hover {
    background-color: #f3f4f6; /* Light gray on hover */
  }

  /* Hide desktop filter sections on small screens */
  .lg\:flex.md\:flex.sm\:hidden.xs\:hidden {
    display: none !important;
  }

  /* Mobile filter sidebar specific styles */
  #mobile-filter-sidebar > div {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  #mobile-filter-sidebar.hidden {
    display: none;
  }

  #mobile-filter-sidebar:not(.hidden) > div {
    transform: translateX(0);
  }
}

input:focus,
select:focus,
button:focus {
  outline-offset: 2px;
}

.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@media (hover: none) and (pointer: coarse) {
  .range-handle {
    width: 14px;
    height: 14px;
    border-width: 3px;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .range-slider {
    height: 8px;
  }

  .price-tick-line {
    height: 14px;
  }

  .price-tick-line.active {
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%) scale(1.2);
  }

  .price-tick-container:first-child .price-tick-line {
    width: 14px;
    height: 14px;
  }

  .price-tick-container:nth-child(2) .price-tick-line {
    width: 14px;
    height: 14px;
  }
}

.range-slider *,
.range-handle,
.price-tick-line,
.range-fill {
  transition: all 0.2s ease;
}
