/* Product search page — clean marketplace layout */
.ps-page {
  --ps-ink: #17233c;
  --ps-muted: #5b6b82;
  --ps-line: #e5eaf3;
  --ps-surface: #fff;
  --ps-page: #f5f7fb;
  --ps-primary: var(--theme-color, #00acee);
  --ps-radius: 12px;
  padding: 28px 0 64px;
  background: var(--ps-page);
  color: var(--ps-ink);
  font-family: "Inter", Arial, sans-serif;
}

.ps-page a {
  text-decoration: none;
  color: inherit;
}

.ps-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ps-filters {
  position: sticky;
  top: 96px;
  background: var(--ps-surface);
  border: 1px solid #ebebeb;
  border-radius: 4px;
  padding: 14px 14px 12px;
  box-shadow: none;
}

.ps-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e5e5;
}

.ps-filters__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111827;
}

.ps-filters__reset {
  border: 0;
  background: transparent;
  color: var(--ps-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.ps-filter {
  padding: 12px 0;
  border-bottom: 1px solid #ececec;
}

.ps-filter:last-of-type {
  border-bottom: 0;
  padding-bottom: 4px;
}

.ps-filter__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #1e3a5f;
}

.ps-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.ps-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.ps-check__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ps-check input[type="checkbox"],
.ps-check input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ps-primary);
  flex: 0 0 auto;
  cursor: pointer;
  border-radius: 2px;
}

.ps-check__text {
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  line-height: 1.35;
}

.ps-check__count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.ps-check__stars {
  display: inline-flex;
  gap: 2px;
  color: #cbd5e1;
  font-size: 11px;
}

.ps-check__stars .is-on {
  color: #f59e0b;
}

.ps-price-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}

.ps-price-row input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ps-ink);
  background: #fff;
  outline: none;
}

.ps-price-row input:focus {
  border-color: var(--ps-primary);
  background: #fff;
}

.ps-price-row span {
  color: var(--ps-muted);
  font-weight: 600;
  font-size: 12px;
}

.ps-price-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ps-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ps-chip.is-active,
.ps-chip:hover {
  border-color: var(--ps-primary);
  color: var(--ps-primary);
  background: rgba(0, 172, 238, 0.06);
}

.ps-filters__actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ps-btn--primary {
  background: #00acee;
  border-color: #00acee;
  color: #fff;
}

.ps-btn--primary:hover {
  background: #0095d0;
  border-color: #0095d0;
  color: #fff;
}

.ps-btn--ghost {
  background: #fff;
  border-color: var(--ps-line);
  color: #334155;
}

.ps-main {
  min-width: 0;
}

.ps-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-radius);
}

.ps-toolbar__count {
  margin: 0;
  color: var(--ps-muted);
  font-size: 14px;
  font-weight: 600;
}

.ps-toolbar__count strong {
  color: var(--ps-ink);
  font-weight: 800;
}

.ps-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ps-view {
  display: inline-flex;
  gap: 6px;
}

.ps-view a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--ps-line);
  background: #fff;
  color: #64748b;
}

.ps-view a.active,
.ps-view a:hover {
  border-color: var(--ps-primary);
  color: var(--ps-primary);
  background: rgba(0, 172, 238, 0.08);
}

.ps-view a svg path {
  fill: currentColor;
}

.ps-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ps-sort label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ps-muted);
}

.ps-sort select {
  min-height: 36px;
  border: 1px solid var(--ps-line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: var(--ps-ink);
}

#search_box.ps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

#search_box.ps-grid .ps-card,
#search_box.ps-grid .tp_single_grid {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: none;
}

.ps-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-radius);
  overflow: hidden;
}

.ps-card__media {
  display: block;
  aspect-ratio: 3 / 4;
  background: #eef2f7;
  overflow: hidden;
}

.ps-card__media img,
.ps-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ps-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.ps-card__media--empty .material-symbols-outlined {
  font-size: 64px;
}

.ps-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  flex: 1;
}

.ps-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.ps-card__title a:hover {
  color: var(--ps-primary);
}

.ps-card__meta {
  margin: 0;
  color: var(--ps-muted);
  font-size: 13px;
}

.ps-card__price {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #b45309;
}

.ps-card__price.is-free {
  color: #15803d;
}

.ps-card__price del {
  margin-right: 6px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.ps-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.ps-card__actions .ps-btn {
  width: 100%;
}

.ps-card__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ps-card__cart,
.ps-card__wish {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--ps-line);
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.ps-card__cart:hover {
  color: #00acee;
  border-color: #00acee;
}

.ps-card__wish i.active,
.ps-card__wish:hover {
  color: #e11d48;
}

.ps-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: #fff;
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-radius);
}

.ps-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.ps-loadmore .ps-btn {
  min-width: 160px;
}

/* Soften legacy search banner under header */
.cm-search-banner {
  background: linear-gradient(115deg, #0039a6 0%, #0066d6 48%, #1a8cff 100%) !important;
  padding: 36px 0 !important;
}

.cm-search-banner .tp_banner_heading h2 {
  color: #fff !important;
  font-size: 28px !important;
  font-weight: 800 !important;
}

.cm-search-banner .tp_banner_heading p {
  color: rgba(255, 255, 255, 0.9) !important;
}

.cm-search-banner .tp_search_box {
  max-width: 720px;
  margin: 18px auto 0;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.cm-search-banner .tp_niceselect_box {
  display: none !important;
}

.cm-search-banner .tp_search_box input {
  flex: 1;
  border: 0 !important;
  outline: 0;
  min-height: 44px;
  padding: 0 14px !important;
  font-size: 15px;
  font-weight: 600;
  background-image: none !important;
  background-repeat: no-repeat;
}

.cm-search-banner .tp_search_box .tp_btn {
  min-height: 44px;
  border-radius: 10px;
  background: #00acee !important;
  border-color: #00acee !important;
}

@media (max-width: 1399px) {
  #search_box.ps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  #search_box.ps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .ps-layout {
    grid-template-columns: 1fr;
  }

  .ps-filters {
    position: static;
  }

  .ps-check-list {
    max-height: none;
  }

  #search_box.ps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #search_box.ps-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ps-card {
    flex-direction: row;
    align-items: stretch;
  }

  .ps-card__media {
    flex: 0 0 118px;
    width: 118px;
    min-height: 0;
    aspect-ratio: auto;
    align-self: stretch;
    border-right: 1px solid var(--ps-line);
  }

  .ps-card__media img,
  .ps-card__media video {
    object-fit: cover;
    object-position: center top;
  }

  .ps-card__media--empty .material-symbols-outlined {
    font-size: 40px;
  }

  .ps-card__body {
    gap: 6px;
    padding: 10px 12px;
    min-width: 0;
  }

  .ps-card__title {
    font-size: 14px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ps-card__meta {
    font-size: 12px;
  }

  .ps-card__price {
    font-size: 15px;
  }

  .ps-card__actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
  }

  .ps-card__actions .ps-btn {
    flex: 1 1 auto;
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .ps-card__row {
    flex: 0 0 auto;
    grid-template-columns: 34px 34px;
    gap: 6px;
  }

  .ps-card__cart,
  .ps-card__wish {
    min-height: 34px;
    width: 34px;
  }

  .ps-toolbar {
    align-items: flex-start;
  }
}
