/* ==========================================================================
   YIWU JUNLE ELECTRIC EQUIPMENT CO.,LIMITED - Products & Explorer (Mintify Style)
   ========================================================================== */

.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  background-color: var(--xamei-white);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--xamei-border);
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-box input {
  padding-left: 2.75rem;
  border-radius: var(--radius-full);
  background-color: var(--xamei-cream);
  border: 1px solid var(--xamei-border);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--xamei-muted);
}

.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.filter-btn {
  background: var(--xamei-surface-light);
  border: 1px solid transparent;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--xamei-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--xamei-dark);
  color: var(--xamei-green);
}

/* Product Card - Mintify Style */
.product-card {
  background: var(--xamei-white);
  border: 1px solid var(--xamei-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  height: 100%;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(17, 24, 20, 0.25);
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--xamei-cream);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  padding: 0;
  transition: transform var(--transition-normal);
}

.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--xamei-muted);
  font-size: .9rem;
}

.product-breadcrumb a {
  color: var(--xamei-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-card:hover .product-image {
  transform: scale(1.06);
}

.product-body,
.product-card-body {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--xamei-accent-text);
  letter-spacing: 1px;
  margin-bottom: var(--spacing-xs);
}

.product-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--xamei-dark);
  margin-bottom: var(--spacing-xs);
  line-height: 1.25;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--xamei-muted);
  margin-bottom: var(--spacing-lg);
}

.product-model { margin-bottom: var(--spacing-xs); }

.product-description {
  color: var(--xamei-muted);
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

.product-price {
  color: var(--xamei-text);
  font-weight: 800;
  margin-bottom: var(--spacing-md);
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--xamei-muted);
  font-weight: 900;
  letter-spacing: .12em;
  background: linear-gradient(135deg, rgba(142, 219, 85, .1), rgba(17, 24, 20, .035));
}

.product-actions,
.product-card-actions {
  margin-top: auto;
  display: flex;
  gap: var(--spacing-sm);
}

.product-actions .btn-xamei,
.product-card-actions .btn-xamei {
  flex: 1;
}

/* Product Detail Modal View */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

@media (max-width: 768px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .products-toolbar { padding: 1rem; border-radius: var(--radius-md); }
  .search-box { width: 100%; min-width: 0; }
  .category-filter-bar { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-btn { width: 100%; text-align: center; font-size: .78rem; padding: .6rem .5rem; }
  .product-body, .product-card-body { padding: 1.25rem; }
  .product-actions, .product-card-actions { flex-direction: column; }
  .product-actions .btn-xamei, .product-card-actions .btn-xamei { width: 100%; }
  .product-detail-grid { padding: 1rem !important; gap: 1.25rem; }
  .product-detail-gallery { min-height: 210px; }
  .spec-table { font-size: .82rem; }
  .spec-table th, .spec-table td { padding: .55rem .4rem; overflow-wrap: anywhere; }
}

.product-detail-gallery {
  background-color: var(--xamei-cream);
  border-radius: var(--radius-md);
  padding: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.product-detail-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail-figure { margin: 0; min-width: 0; }
.product-detail-figure .catalog-note { margin-top: .75rem; }
.product-detail-grid h1 { font-size: clamp(1.8rem, 3.3vw, 3.2rem); line-height: 1.12; overflow-wrap: anywhere; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  font-size: 0.9rem;
}

.spec-table th, .spec-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--xamei-border);
  text-align: left;
}

.spec-table th {
  color: var(--xamei-muted);
  font-weight: 600;
  width: 40%;
}

.spec-table td {
  color: var(--xamei-dark);
  font-weight: 700;
}

/* Dark Mode Overrides for Products Explorer */
[data-theme="dark"] .products-toolbar,
[data-theme="dark"] .product-card,
[data-theme="dark"] .modal-container {
  background-color: var(--xamei-white);
  border-color: var(--xamei-border);
}

[data-theme="dark"] .product-card:hover {
  border-color: rgba(142, 219, 85, .52);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .3);
}

[data-theme="dark"] .product-image-wrap,
[data-theme="dark"] .product-detail-gallery {
  background-color: rgba(255, 255, 255, 0.045);
}

[data-theme="dark"] .product-title {
  color: #FFFFFF;
}

[data-theme="dark"] .product-description,
[data-theme="dark"] .product-meta {
  color: #AEB9B1;
}

[data-theme="dark"] .product-price {
  color: #FFFFFF;
}

[data-theme="dark"] .product-image-placeholder {
  color: var(--xamei-green);
  background: linear-gradient(135deg, rgba(142, 219, 85, .09), rgba(255, 255, 255, .025));
}

[data-theme="dark"] .search-box input {
  background-color: rgba(255, 255, 255, .045);
  color: #FFFFFF;
}

[data-theme="dark"] .filter-btn {
  background-color: rgba(255, 255, 255, 0.045);
  color: #AEB9B1;
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
  background-color: var(--xamei-green);
  color: #101713;
}

[data-theme="dark"] .spec-table th {
  color: #AEB9B1;
}

[data-theme="dark"] .spec-table td {
  color: #FFFFFF;
}

/* JUNLE product-family images include generous studio framing. */
.product-image-wrap { aspect-ratio: 4 / 3; background: #f1f0ed; }
.product-image { object-fit: contain; }
.catalog-note { margin: 0 0 1.5rem; font-size: .875rem; }

/* Compact catalog; the homepage featured cards retain their original size. */
.catalog-page .hero-title { font-size: clamp(2.2rem, 4vw, 3.6rem); margin-bottom: 1rem; }
.catalog-page .hero-title br { display: none; }
.catalog-page .hero-subtitle { font-size: 1rem; max-width: 740px; }
.catalog-page .hero-section { padding-bottom: 2.25rem !important; }
.catalog-page main > .section { padding-top: 2rem; }
.catalog-page .products-toolbar { padding: 1rem 1.25rem; gap: 1rem; margin-bottom: 1.25rem; align-items: end; }
.catalog-page .form-label { font-size: .8rem; margin-bottom: .4rem; }
.catalog-search-input { position: relative; }
.catalog-category-control { flex: 0 1 300px; min-width: 240px; }
.catalog-category-control select { min-height: 49px; padding-right: 2rem; }
.catalog-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
#catalogResultCount { font-size: .9rem; font-weight: 700; flex-shrink: 0; margin: 0; }
.catalog-summary .catalog-note { max-width: 630px; margin: 0; font-size: .75rem; text-align: right; }
.catalog-page .catalog-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; scroll-margin-top: calc(var(--header-height) + 1rem); }
.catalog-page .product-card { border-radius: 14px; min-width: 0; }
.catalog-page .product-card:hover { transform: translateY(-3px); }
.catalog-page .product-image-wrap { aspect-ratio: 4 / 3; }
.catalog-page .product-card-body { padding: .85rem; }
.catalog-page .product-category-tag { font-size: .65rem; color: #3c7122; letter-spacing: .5px; margin-bottom: .45rem; line-height: 1.4; }
.catalog-page[data-theme="dark"] .product-category-tag { color: #8edb55; }
.catalog-page .product-title { font-size: .98rem; line-height: 1.3; letter-spacing: -.01em; margin-bottom: .5rem; overflow-wrap: anywhere; }
.catalog-page .product-description { font-size: .77rem; line-height: 1.5; margin-bottom: .85rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.catalog-page .product-card-actions { gap: .4rem; }
.catalog-page .product-card-actions .btn-xamei { padding: .55rem .45rem; font-size: .73rem; min-width: 0; white-space: nowrap; }
.catalog-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 2rem; }
.catalog-pagination[hidden] { display: none; }
.catalog-page-button { min-width: 40px; min-height: 40px; border-radius: 10px; border: 1px solid var(--xamei-border); background: var(--xamei-white); color: var(--xamei-text); font: inherit; font-size: .85rem; cursor: pointer; padding: .5rem .75rem; }
.catalog-page-button.active { background: var(--xamei-green); color: #111814; font-weight: 800; }
.catalog-page-button:disabled { opacity: .4; cursor: default; }
.catalog-page-button:focus-visible { outline: 2px solid var(--xamei-green-hover); outline-offset: 3px; }
@media (max-width: 1199px) { .catalog-page .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 991px) { .catalog-page .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .catalog-page .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .catalog-page .products-toolbar { padding: .9rem; }
  .catalog-category-control { flex: 1 1 100%; min-width: 0; }
  .catalog-summary { display: block; }
  .catalog-summary .catalog-note { text-align: left; margin-top: .4rem; font-size: .7rem; }
  .catalog-page .product-card-body { padding: .65rem; }
  .catalog-page .product-title { font-size: .85rem; }
  .catalog-page .product-category-tag { font-size: .56rem; }
  .catalog-page .product-card-actions { flex-direction: column; }
  .catalog-page .product-card-actions .btn-xamei { font-size: .72rem; padding: .5rem .35rem; }
  .catalog-page .hero-title { font-size: 2.1rem; }
}
