/* ===================================
   Product category / archive pages
   =================================== */

.cat-archive {
  background: #f5f6f8;
  padding: 20px 0 56px;
  color: #0f1111;
  min-height: 60vh;
}

.cat-archive .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Breadcrumb */
.cat-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #565959;
  margin-bottom: 16px;
}

.cat-breadcrumb a {
  color: #2162a1;
  text-decoration: none;
}

.cat-breadcrumb a:hover {
  color: #c45500;
  text-decoration: underline;
}

.cat-breadcrumb .sep {
  color: #aaa;
}

.cat-breadcrumb .current {
  color: #0f1111;
  font-weight: 500;
}

/* Hero */
.cat-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 32px;
  background: #fff;
  border: 1px solid #e3e6e6;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.04);
}

.cat-hero-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e47911;
}

.cat-hero-title {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: #0f1111;
}

.cat-hero-desc {
  margin: 0;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.55;
  color: #565959;
}

.cat-hero-desc-muted {
  color: #6b7280;
}

.cat-hero-desc p {
  margin: 0;
}

.cat-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.cat-stat {
  min-width: 92px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fffaf3 0%, #fff 100%);
  border: 1px solid #f0e0cc;
  border-radius: 10px;
  text-align: center;
}

.cat-stat-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #c45500;
  line-height: 1.2;
}

.cat-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #565959;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Layout */
.cat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* Sidebar */
.cat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 88px;
}

.cat-side-card {
  background: #fff;
  border: 1px solid #e3e6e6;
  border-radius: 10px;
  padding: 14px 14px 12px;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.03);
}

.cat-side-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  font-weight: 700;
  color: #0f1111;
}

.cat-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-side-list li {
  margin: 0;
}

.cat-side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 -4px;
  border-radius: 8px;
  text-decoration: none;
  color: #0f1111;
  font-size: 13px;
  line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease;
}

.cat-side-list a:hover {
  background: #f7fafa;
  color: #c45500;
}

.cat-side-list li.is-current a {
  background: #fff4e5;
  color: #c45500;
  font-weight: 600;
}

.cat-side-name {
  flex: 1;
  min-width: 0;
}

.cat-side-count {
  flex-shrink: 0;
  min-width: 28px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f0f2f2;
  color: #565959;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.cat-side-list li.is-current .cat-side-count {
  background: #ffd814;
  color: #0f1111;
}

.cat-side-empty {
  padding: 8px;
  font-size: 13px;
  color: #888;
}

.cat-clear-filters {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: #2162a1;
  text-decoration: none;
}

.cat-clear-filters:hover {
  color: #c45500;
  text-decoration: underline;
}

/* Main column */
.cat-main {
  min-width: 0;
}

.cat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  background: #fff;
  border: 1px solid #e3e6e6;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.03);
}

.cat-results {
  margin: 0;
  font-size: 14px;
  color: #0f1111;
}

.cat-results strong {
  font-weight: 700;
}

.cat-page-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: #565959;
}

.cat-sort-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-sort-form label {
  font-size: 13px;
  color: #565959;
  white-space: nowrap;
}

.cat-sort-form select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 180px;
  padding: 8px 32px 8px 12px;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  background: #f0f2f2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555555' d='M6 8L0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 10px 6px;
  font-size: 13px;
  color: #0f1111;
  cursor: pointer;
}

.cat-sort-form select:focus {
  outline: 2px solid #ff9900;
  outline-offset: 1px;
  border-color: #e47911;
}

/* Product grid */
.cat-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cat-products-grid .product-card,
.cat-products-grid .amz-rel-card {
  background: #fff;
  border: 1px solid #e3e6e6;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.04);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.cat-products-grid .product-card:hover,
.cat-products-grid .amz-rel-card:hover {
  border-color: #d5d9d9;
  box-shadow: 0 8px 24px rgba(15, 17, 17, 0.1);
  transform: translateY(-2px);
}

.cat-products-grid .amz-rel-media,
.cat-products-grid .product-card-image {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fafafa;
  overflow: hidden;
}

.cat-products-grid .amz-rel-img,
.cat-products-grid .product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.25s ease;
}

.cat-products-grid .product-card:hover .amz-rel-img {
  transform: scale(1.04);
}

.cat-products-grid .amz-rel-body,
.cat-products-grid .product-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
  flex: 1;
}

.cat-products-grid .amz-rel-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  min-height: 2.7em;
}

.cat-products-grid .amz-rel-title a {
  color: #0f1111;
  text-decoration: none;
}

.cat-products-grid .amz-rel-title a:hover {
  color: #c45500;
}

.cat-products-grid .amz-rel-cat {
  font-size: 11px;
  color: #565959;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cat-products-grid .amz-rel-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 4px;
  background: #cc0c39;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* Pagination */
.cat-pagination {
  margin-top: 28px;
  padding: 18px 16px;
  background: #fff;
  border: 1px solid #e3e6e6;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.03);
}

.cat-page-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-page-item a,
.cat-page-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d5d9d9;
  background: #fff;
  color: #0f1111;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cat-page-item a:hover {
  background: #f7fafa;
  border-color: #ed8800;
  color: #c45500;
}

.cat-page-item.is-current span,
.cat-page-item .current {
  background: linear-gradient(180deg, #ffd814 0%, #f7ca00 100%);
  border-color: #f0c14b;
  color: #0f1111;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.cat-page-item.is-dots span {
  border: none;
  background: transparent;
  min-width: 24px;
  color: #888;
}

.cat-page-jump {
  margin: 12px 0 0;
  font-size: 13px;
  color: #565959;
}

/* Empty */
.cat-empty {
  background: #fff;
  border: 1px dashed #d5d9d9;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
}

.cat-empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.cat-empty h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.cat-empty p {
  margin: 0 0 18px;
  color: #565959;
  font-size: 14px;
}

.cat-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.cat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}

.cat-btn-primary {
  color: #0f1111 !important;
  background: linear-gradient(180deg, #ffd814 0%, #f7ca00 100%);
  border: 1px solid #f0c14b;
}

.cat-btn-primary:hover {
  filter: brightness(1.03);
}

.cat-btn-ghost {
  color: #0f1111 !important;
  background: #fff;
  border: 1px solid #d5d9d9;
}

.cat-btn-ghost:hover {
  background: #f7fafa;
}

/* All-products archive reuses same classes via archive-rc_product */
.archive-rc_product .cat-archive,
.tax-product_category .cat-archive {
  /* hook for body classes if needed */
}

/* Responsive */
@media (max-width: 1100px) {
  .cat-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cat-layout {
    grid-template-columns: 1fr;
  }

  .cat-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .cat-hero-title {
    font-size: 24px;
  }
}

@media (max-width: 720px) {
  .cat-sidebar {
    grid-template-columns: 1fr;
  }

  .cat-hero {
    padding: 16px;
  }

  .cat-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .cat-sort-form {
    width: 100%;
    justify-content: space-between;
  }

  .cat-sort-form select {
    flex: 1;
  }

  .cat-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cat-products-grid .amz-rel-excerpt {
    display: none;
  }

  .cat-products-grid .amz-rel-title {
    font-size: 13px;
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .cat-products-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Brand archive extras
   =================================== */

.brand-archive .brand-hero {
  background: linear-gradient(135deg, #ffffff 0%, #fff8f0 55%, #fff 100%);
  border-color: #f0e6d8;
}

.brand-archive .cat-hero-kicker {
  color: #c45500;
}

.brand-archive .cat-hero-title {
  letter-spacing: -0.02em;
}

.brand-archive .cat-side-list li.is-current > a {
  background: #fff6e8;
  border-color: #f3d6a8;
  color: #c45500;
  font-weight: 600;
}

.brand-archive .cat-side-list li.is-current .cat-side-count {
  background: #f3d6a8;
  color: #8a3b00;
}

.brand-archive .cat-products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .brand-archive .cat-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .brand-archive .cat-products-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Search results pagination (same as category)
   =================================== */

.search-archive .search-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

/* Search page has no left sidebar — 4 columns on desktop */
.search-archive .search-products-grid .product-card,
.search-archive .search-products-grid .amz-rel-card {
  min-width: 0;
}

@media (max-width: 1100px) {
  .search-archive .search-products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.search-page-header .search-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c45500;
}

.search-page-header .search-results-meta {
  margin: 8px 0 0;
  color: #565959;
  font-size: 14px;
}

.search-pagination {
  margin-top: 28px;
}

/* Hard reset: kill default WP list bullets on any leftover pagination */
.pagination,
.pagination ul,
nav.pagination ul,
.search-results-wrapper .pagination,
.search-results-wrapper .page-numbers {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.pagination li,
.pagination ul li {
  list-style: none !important;
  display: inline-block;
  margin: 0 4px;
}

/* Shared page number buttons (covers WP default + our markup) */
.cat-pagination .page-numbers,
.search-pagination .page-numbers,
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d5d9d9;
  background: #fff;
  color: #0f1111 !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cat-pagination a.page-numbers:hover,
.search-pagination a.page-numbers:hover,
.pagination a.page-numbers:hover {
  background: #f7fafa;
  border-color: #ed8800;
  color: #c45500 !important;
}

.cat-pagination .page-numbers.current,
.cat-page-item.is-current .page-numbers,
.search-pagination .page-numbers.current,
.pagination .page-numbers.current {
  background: linear-gradient(180deg, #ffd814 0%, #f7ca00 100%) !important;
  border-color: #f0c14b !important;
  color: #0f1111 !important;
  cursor: default;
}

.cat-pagination .page-numbers.dots,
.search-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  min-width: 28px;
}

.cat-page-item.is-current a,
.cat-page-item.is-current span {
  background: linear-gradient(180deg, #ffd814 0%, #f7ca00 100%);
  border-color: #f0c14b;
  color: #0f1111;
}

@media (max-width: 900px) {
  .search-archive .search-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .search-archive .search-products-grid {
    grid-template-columns: 1fr;
  }
}
