.t1-search {
  padding: 20px 20px 40px;
  background: var(--theme-bg, #fff);
}

/* Top bar: title + sort */
.t1-search-top {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.t1-search-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--theme-text, #333);
}

.t1-search-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Filter dropdown (sort only) */
.t1-search-filter-wrap {
  position: relative;
}

.t1-search-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--theme-radius, 6px);
  border: 1px solid var(--theme-border, #ccc);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #333);
  cursor: pointer;
  font-size: 14px;
}

.t1-search-filter-toggle:hover {
  background: var(--theme-bg-muted, #f5f5f5);
}

.t1-search-filter-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  padding: 16px;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-border, #e7e7e7);
  border-radius: var(--theme-radius, 8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.t1-search-filter-dropdown[hidden] {
  display: none !important;
}

.t1-search-filter-block {
  margin-bottom: 16px;
}

.t1-search-filter-block label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--theme-text, #333);
}

.t1-pl-sort-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.t1-pl-sort-btn {
  padding: 8px 12px;
  border: 1px solid var(--theme-border, #ccc);
  border-radius: var(--theme-radius, 6px);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #333);
  font-size: 13px;
  cursor: pointer;
}

.t1-pl-sort-btn:hover {
  background: var(--theme-bg-muted, #f5f5f5);
}

.t1-pl-sort-btn.is-selected {
  background: var(--theme-primary, #333);
  color: #fff;
  border-color: var(--theme-primary, #333);
}

.t1-pl-filter-submit {
  margin-top: 12px;
  width: 100%;
  padding: 10px 16px;
  background: var(--theme-primary, #333);
  color: #fff;
  border: none;
  border-radius: var(--theme-radius, 6px);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.t1-pl-filter-submit:hover {
  opacity: 0.9;
}

/* Search form */
.t1-search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  max-width: 600px;
}

.t1-search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--theme-border, #ccc);
  border-radius: var(--theme-radius, 6px);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #333);
  font-size: 14px;
}

.t1-search-input::placeholder {
  color: var(--theme-muted, #999);
}

.t1-search-btn {
  padding: 10px 18px;
  background: var(--theme-primary, #333);
  color: #fff;
  border: none;
  border-radius: var(--theme-radius, 6px);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.t1-search-btn:hover {
  opacity: 0.9;
}

/* Results grid */
.t1-search-grid {
  --cols-desktop: 4;
  --cols-tablet: 3;
  --cols-mobile: 2;

  display: grid;
  gap: 24px;
  grid-template-columns: repeat(var(--cols-desktop), 1fr);
}

.t1-search-item {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-border, #e7e7e7);
  border-radius: var(--theme-radius, 8px);
  overflow: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

/* Scope under .t1-search-item so these rules do not leak onto /products cards */
.t1-search-item .t1-pl-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.t1-search-item .t1-pl-img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--theme-bg-muted, #f5f5f5);
}

.t1-search-item .t1-pl-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.t1-search-item .t1-pl-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  min-height: 0;
  text-align: left;
}

.t1-search-item .t1-pl-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.t1-search-item .t1-pl-description {
  font-size: 13px;
  color: var(--theme-text-muted, #666);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.t1-search-item .t1-pl-price {
  font-weight: 600;
  font-size: 14px;
  margin-top: 4px;
}

.t1-search-item .t1-pl-btn {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: var(--theme-radius, 6px);
  text-decoration: none;
  cursor: pointer;
  margin-top: 8px;
  text-align: center;
  border: none;
  width: 100%;
}

.t1-search-item .t1-pl-btn-view {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-border, #ccc);
  color: var(--theme-text, #333);
}

.t1-search-item .t1-pl-btn-add {
  background: #16a34a;
  color: #fff;
}
.t1-search-item .t1-pl-btn-add:hover {
     background: #147a3a !important;
    transform: translateY(-1px) !important;
}

/* Pagination */
.t1-search-pagination {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.t1-search-pagination button {
  padding: 8px 14px;
  border: 1px solid var(--theme-border, #ccc);
  border-radius: var(--theme-radius, 6px);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #333);
  cursor: pointer;
  font-size: 14px;
}

.t1-search-pagination button:hover:not(:disabled) {
  background: var(--theme-bg-muted, #f5f5f5);
}

.t1-search-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 992px) {
  .t1-search-grid {
    grid-template-columns: repeat(var(--cols-tablet), 1fr);
  }
}

@media (max-width: 768px) {
  .t1-search-grid {
    grid-template-columns: repeat(var(--cols-mobile), 1fr);
  }

  .t1-search-form {
    flex-direction: column;
  }
}