/* Search Results Component */
.search-highlight {
  background-color: #fef9c3;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
}

.dark .search-highlight {
  background-color: #713f12;
}

/* Search Result Item */
.search-result-item {
  transition: all 0.2s ease-in-out;
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.search-result-item__image {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  background-color: #f9fafb;
}

.search-result-item__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-item__image img {
  transform: scale(1.05);
}

.search-result-item__title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0 0 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8em;
}

.search-result-item__snippet {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0.5rem 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item__price {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0.5rem 0;
}

/* Dark mode styles */
.dark .search-result-item {
  background-color: #1f2937;
  border-color: #374151;
}

.dark .search-result-item__title {
  color: #f9fafb;
}

.dark .search-result-item__snippet {
  color: #d1d5db;
}

.dark .search-result-item__price {
  color: #f9fafb;
}

/* Pagination */
.pager__item a,
.pager__item.is-active a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: all 0.2s;
}

.pager__item a:hover {
  background-color: #e5e7eb;
}

.dark .pager__item a:hover {
  background-color: #374151;
}

.pager__item.is-active a {
  background-color: #3b82f6;
  color: white;
}

/* Responsive adjustments */
@media (min-width: 640px) {
  .search-result-item__title {
    font-size: 1.125rem;
  }

  .pager__item a,
  .pager__item.is-active a {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.search-result__info {
  font-size: 0.75rem; /* tw-text-xs */
  color: #6b7280; /* tw-text-gray-500 */
  margin-top: 0.5rem; /* tw-mt-2 */
}

.dark .search-result__info {
  color: #9ca3af; /* dark:tw-text-gray-400 */
}

/* Search form focus states */
.search-form input:focus {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
  --tw-ring-color: rgb(59 130 246 / 0.5); /* tw-ring-blue-500 */
  --tw-ring-offset-width: 0px;
  border-color: transparent; /* tw-border-transparent */
}

/* Search results grid */
.search-results-grid {
  display: grid; /* tw-grid */
  grid-template-columns: repeat(1, minmax(0, 1fr)); /* tw-grid-cols-1 */
  gap: 1.5rem; /* tw-gap-6 */
}

@media (min-width: 640px) {
  .search-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* sm:tw-grid-cols-2 */
  }
}

@media (min-width: 1024px) {
  .search-results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* lg:tw-grid-cols-3 */
  }
}

@media (min-width: 1280px) {
  .search-results-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* xl:tw-grid-cols-4 */
  }
}

/* Search result item */
.search-result-item {
  background-color: #ffffff; /* tw-bg-white */
  border-radius: 0.5rem; /* tw-rounded-lg */
  overflow: hidden; /* tw-overflow-hidden */
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* tw-shadow-md */
  transition-property: all; /* tw-transition-all */
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms; /* tw-duration-300 */
  border-width: 1px; /* tw-border */
  border-color: #e5e7eb; /* tw-border-gray-200 */
}

.dark .search-result-item {
  background-color: #1f2937; /* dark:tw-bg-gray-800 */
  border-color: #374151; /* dark:tw-border-gray-700 */
}

.search-result-item:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* hover:tw-shadow-lg */
}

.search-result-item__image {
  position: relative; /* tw-relative */
  width: 100%; /* tw-w-full */
  overflow: hidden; /* tw-overflow-hidden */
  padding-top: 100%; /* Aspect ratio 1:1 */
}

.search-result-item__image-content {
  position: absolute; /* tw-absolute */
  top: 0; /* tw-inset-0 */
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%; /* tw-w-full */
  height: 100%; /* tw-h-full */
  object-fit: cover; /* tw-object-cover */
}

.search-result-item__body {
  padding: 1rem; /* tw-p-4 */
}

.search-result-item__title {
  font-size: 1rem; /* tw-text-base */
  font-weight: 500; /* tw-font-medium */
  color: #111827; /* tw-text-gray-900 */
  margin-bottom: 0.5rem; /* tw-mb-2 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .search-result-item__title {
  color: #ffffff; /* dark:tw-text-white */
}

.search-result-item__price {
  font-size: 1.125rem; /* tw-text-lg */
  font-weight: 700; /* tw-font-bold */
  color: #111827; /* tw-text-gray-900 */
}

.dark .search-result-item__price {
  color: #ffffff; /* dark:tw-text-white */
}

/* Search pagination */
.search-pagination {
  display: flex; /* tw-flex */
  justify-content: center; /* tw-justify-center */
  margin-top: 2rem; /* tw-mt-8 */
}

.search-pagination .pager__item a,
.search-pagination .pager__item.is-active a {
  padding-left: 1rem; /* tw-px-4 */
  padding-right: 1rem; /* tw-px-4 */
  padding-top: 0.5rem; /* tw-py-2 */
  padding-bottom: 0.5rem; /* tw-py-2 */
  margin-left: 0.25rem; /* tw-mx-1 */
  margin-right: 0.25rem; /* tw-mx-1 */
  border-radius: 0.25rem; /* tw-rounded */
  color: #374151; /* tw-text-gray-700 */
  text-decoration: none; /* tw-no-underline */
  background-color: #ffffff; /* tw-bg-white */
  border: 1px solid; /* tw-border */
  border-color: #d1d5db; /* tw-border-gray-300 */
  transition-property: background-color, border-color, color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.dark .search-pagination .pager__item a,
.dark .search-pagination .pager__item.is-active a {
  color: #e5e7eb; /* dark:tw-text-gray-200 */
  background-color: #1f2937; /* dark:tw-bg-gray-800 */
  border-color: #4b5563; /* dark:tw-border-gray-600 */
}

.search-pagination .pager__item a:hover {
  background-color: #f3f4f6; /* hover:tw-bg-gray-100 */
}

.dark .search-pagination .pager__item a:hover {
  background-color: #374151; /* dark:hover:tw-bg-gray-700 */
}

.search-pagination .pager__item.is-active a {
  background-color: #2563eb; /* tw-bg-blue-600 */
  color: #ffffff; /* tw-text-white */
  border-color: #2563eb; /* tw-border-blue-600 */
}

/* Search filters */
.search-filters {
  margin-bottom: 2rem; /* tw-mb-8 */
  padding: 1rem; /* tw-p-4 */
  background-color: #f9fafb; /* tw-bg-gray-50 */
  border-radius: 0.5rem; /* tw-rounded-lg */
}

.dark .search-filters {
  background-color: #1f2937; /* dark:tw-bg-gray-800 */
}

.search-filters__title {
  font-size: 1.125rem; /* tw-text-lg */
  font-weight: 500; /* tw-font-medium */
  margin-bottom: 1rem; /* tw-mb-4 */
  color: #111827; /* tw-text-gray-900 */
}

.dark .search-filters__title {
  color: #ffffff; /* dark:tw-text-white */
}

.search-filters__list {
  display: flex; /* tw-flex */
  flex-direction: column; /* tw-flex-col */
  gap: 0.5rem; /* tw-space-y-2 */
}

.search-filters__item {
  display: flex; /* tw-flex */
  align-items: center; /* tw-items-center */
}

.search-filters__item input[type="checkbox"] {
  height: 1rem; /* tw-h-4 */
  width: 1rem; /* tw-w-4 */
  color: #2563eb; /* tw-text-blue-600 */
  border-color: #d1d5db; /* tw-border-gray-300 */
  border-radius: 0.25rem; /* tw-rounded */
}

.dark .search-filters__item input[type="checkbox"] {
  border-color: #4b5563; /* dark:tw-border-gray-600 */
}

.search-filters__item input[type="checkbox"]:focus {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
  --tw-ring-color: rgb(59 130 246 / 0.5); /* focus:tw-ring-blue-500 */
  --tw-ring-offset-width: 2px;
}

.search-filters__item label {
  margin-left: 0.5rem; /* tw-ml-2 */
  font-size: 0.875rem; /* tw-text-sm */
  color: #374151; /* tw-text-gray-700 */
}

.dark .search-filters__item label {
  color: #d1d5db; /* dark:tw-text-gray-300 */
}
