/* ============================================================
   Younxin Search — Full Search Results Page
   ============================================================ */

/* ---------- Page container ---------- */
.sw-search-results-page {
  padding: 24px 0 60px;
  min-height: 60vh;
}

/* ---------- Breadcrumb ---------- */
.sw-search-breadcrumb {
  font-size: 13px;
  color: #9aa5b4;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.sw-search-breadcrumb a {
  color: #9aa5b4;
  text-decoration: none;
  transition: color .2s;
}
.sw-search-breadcrumb a:hover {
  color: #1E5BB8;
}
.sw-breadcrumb-sep {
  color: #d0d5dd;
}

/* ---------- Page header ---------- */
.sw-search-page-header {
  margin-bottom: 28px;
}
.sw-search-page-title {
  font-size: 26px;
  font-weight: 700;
  color: #0E1E3F;
  margin: 0 0 6px;
}
.sw-search-page-count {
  font-size: 14px;
  color: #9aa5b4;
  margin: 0 0 20px;
}

/* Search form */
.sw-search-page-form {
  display: flex;
  gap: 10px;
  max-width: 640px;
}
.sw-search-page-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.sw-search-page-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: #9aa5b4;
  pointer-events: none;
}
.sw-search-page-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 42px;
  border: 2px solid #e5e8ee;
  border-radius: 8px;
  font-size: 15px;
  color: #0E1E3F;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  background: #fff;
}
.sw-search-page-input:focus {
  border-color: #1E5BB8;
  box-shadow: 0 0 0 3px rgba(30, 91, 184, 0.1);
}
.sw-search-page-input::placeholder {
  color: #9aa5b4;
}
.sw-search-page-btn {
  height: 48px;
  padding: 0 24px;
  background: #1E5BB8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
  font-family: inherit;
}
.sw-search-page-btn:hover {
  background: #174a96;
}

/* ============================================================
   Layout: Sidebar + Main
   ============================================================ */
.sw-search-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

/* ---------- Sidebar ---------- */
.sw-search-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
}
.sw-search-filter-group {
  margin-bottom: 24px;
}
.sw-search-filter-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #0E1E3F;
  margin: 0 0 10px;
}

/* Sort buttons */
.sw-search-sort-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sw-search-sort-btn {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7a8d;
  background: #f5f7fa;
  border-radius: 16px;
  text-decoration: none;
  transition: all .2s;
}
.sw-search-sort-btn:hover {
  background: #edf2fa;
  color: #1E5BB8;
}
.sw-search-sort-btn.active {
  background: #1E5BB8;
  color: #fff;
}

/* Category filter list */
.sw-search-filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sw-search-filter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  font-size: 13px;
  color: #4a5568;
  text-decoration: none;
  border-radius: 6px;
  transition: all .15s;
}
.sw-search-filter-item:hover {
  background: #f5f7fa;
  color: #1E5BB8;
}
.sw-search-filter-item.active {
  background: #edf2fa;
  color: #1E5BB8;
  font-weight: 600;
}
.sw-search-filter-count {
  font-size: 12px;
  color: #9aa5b4;
  flex-shrink: 0;
}

/* ============================================================
   Results Grid
   ============================================================ */
.sw-search-main {
  flex: 1;
  min-width: 0;
}
.sw-search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ---------- Product Card ---------- */
.sw-search-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #edf2fa;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all .2s;
}
.sw-search-card:hover {
  border-color: #1E5BB8;
  box-shadow: 0 4px 16px rgba(14, 30, 63, 0.08);
  transform: translateY(-2px);
}

.sw-search-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f5f7fa;
  overflow: hidden;
}
.sw-search-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.sw-search-card:hover .sw-search-card-thumb img {
  transform: scale(1.05);
}
.sw-search-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d0d5dd;
}

.sw-search-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sw-search-card-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #F26B2C;
}
.sw-search-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #0E1E3F;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sw-search-card-sku {
  font-size: 12px;
  color: #9aa5b4;
  font-family: 'Courier New', monospace;
}
.sw-search-card-desc {
  font-size: 13px;
  color: #6b7a8d;
  line-height: 1.45;
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sw-search-card-link {
  font-size: 13px;
  font-weight: 600;
  color: #1E5BB8;
  margin-top: auto;
  padding-top: 8px;
  transition: color .2s;
}
.sw-search-card:hover .sw-search-card-link {
  color: #F26B2C;
}

/* ============================================================
   Pagination
   ============================================================ */
.sw-search-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #edf2fa;
}
.sw-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  background: #f5f7fa;
  border-radius: 8px;
  text-decoration: none;
  transition: all .2s;
}
.sw-page-btn:hover {
  background: #edf2fa;
  color: #1E5BB8;
}
.sw-page-btn.active {
  background: #1E5BB8;
  color: #fff;
}
.sw-page-prev,
.sw-page-next {
  font-size: 13px;
  padding: 0 14px;
}

/* ============================================================
   Empty state
   ============================================================ */
.sw-search-empty-page {
  text-align: center;
  padding: 60px 20px;
}
.sw-search-empty-page h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0E1E3F;
  margin: 16px 0 8px;
}
.sw-search-empty-page p {
  font-size: 15px;
  color: #9aa5b4;
  margin: 0 0 8px;
}
.sw-search-empty-tips a {
  color: #1E5BB8;
  text-decoration: none;
}
.sw-search-empty-tips a:hover {
  color: #F26B2C;
}

/* ============================================================
   Product Page Search Box (injected above archive listings)
   ============================================================ */
.sw-product-search-bar {
  background: #f5f7fa;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw-product-search-bar form {
  flex: 1;
  display: flex;
  gap: 8px;
  max-width: 560px;
}
.sw-product-search-bar input[type="text"] {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 2px solid #e5e8ee;
  border-radius: 8px;
  font-size: 14px;
  color: #0E1E3F;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
  background: #fff;
}
.sw-product-search-bar input[type="text"]:focus {
  border-color: #1E5BB8;
}
.sw-product-search-bar input[type="text"]::placeholder {
  color: #9aa5b4;
}
.sw-product-search-bar button {
  height: 42px;
  padding: 0 20px;
  background: #1E5BB8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
  font-family: inherit;
}
.sw-product-search-bar button:hover {
  background: #174a96;
}
.sw-product-search-label {
  font-size: 14px;
  font-weight: 600;
  color: #0E1E3F;
  white-space: nowrap;
}

/* ============================================================
   Responsive — Tablet
   ============================================================ */
@media (max-width: 1024px) {
  .sw-search-layout {
    flex-direction: column;
    gap: 20px;
  }
  .sw-search-sidebar {
    width: 100%;
    position: static;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
  }
  .sw-search-filter-group {
    margin-bottom: 0;
  }
  .sw-search-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 640px) {
  .sw-search-results-page {
    padding: 16px 0 40px;
  }
  .sw-search-page-title {
    font-size: 20px;
  }
  .sw-search-page-form {
    flex-direction: column;
  }
  .sw-search-page-btn {
    width: 100%;
  }
  .sw-search-sidebar {
    flex-direction: column;
    gap: 16px;
  }
  .sw-search-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .sw-search-pagination {
    flex-wrap: wrap;
  }
  .sw-product-search-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .sw-product-search-label {
    text-align: center;
  }
  .sw-product-search-bar form {
    max-width: none;
  }
}
