/**
 * Product catalog & detail pages
 */

/* ─── Catalog layout ─── */
.pq-catalog-page__header {
  margin-bottom: var(--pq-space-8);
}

.pq-catalog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pq-space-8);
  align-items: start;
}

.pq-catalog-layout__toggle {
  margin-bottom: var(--pq-space-2);
}

.pq-catalog-layout__sidebar {
  display: none;
}

.pq-catalog-layout__sidebar.is-open {
  display: block;
}

.pq-catalog-filters {
  display: flex;
  flex-direction: column;
  gap: var(--pq-space-5);
  padding: var(--pq-space-6);
  background: var(--pq-surface);
  border: 1px solid var(--pq-border);
  border-radius: var(--pq-radius-xl);
  box-shadow: var(--pq-shadow-sm);
  position: sticky;
  top: calc(80px + var(--pq-space-4));
}

.pq-catalog-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pq-space-3);
}

.pq-catalog-filters__title {
  margin: 0;
  font-size: var(--pq-text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pq-catalog-filters__reset {
  font-size: var(--pq-text-xs);
  color: var(--pq-primary);
}

.pq-catalog-filters__group--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pq-space-3);
}

.pq-catalog-filters__checks {
  display: flex;
  flex-direction: column;
  gap: var(--pq-space-2);
}

.pq-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--pq-space-4);
  margin-bottom: var(--pq-space-6);
}

.pq-catalog-toolbar__search-form {
  flex: 1;
  min-width: 240px;
  max-width: 480px;
}

.pq-catalog-toolbar__count {
  margin: 0;
  font-size: var(--pq-text-sm);
  color: var(--pq-text-muted);
  font-weight: 500;
}

.pq-catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pq-space-6);
}

.pq-catalog-grid__empty {
  grid-column: 1 / -1;
}

@media (min-width: 576px) {
  .pq-catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .pq-catalog-layout {
    grid-template-columns: 280px 1fr;
  }

  .pq-catalog-layout__sidebar {
    display: block;
  }

  .pq-catalog-layout__toggle {
    display: none;
  }

  .pq-catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .pq-catalog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ─── Product detail ─── */
.pq-product-detail__hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pq-space-8);
  margin-bottom: var(--pq-space-12);
}

.pq-product-gallery__main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #fff 0%, var(--pq-bg) 100%);
  border: 1px solid var(--pq-border);
  border-radius: var(--pq-radius-2xl);
  overflow: hidden;
}

.pq-product-gallery__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--pq-space-8);
}

.pq-product-gallery__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--pq-space-8);
  text-align: center;
  gap: var(--pq-space-3);
}

.pq-product-gallery__brand {
  font-size: var(--pq-text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pq-primary);
}

.pq-product-gallery__name {
  font-size: var(--pq-text-xl);
  font-weight: 800;
  color: var(--pq-text);
  max-width: 20ch;
  line-height: 1.3;
}

.pq-product-gallery__thumbs {
  display: flex;
  gap: var(--pq-space-2);
  margin-top: var(--pq-space-3);
  overflow-x: auto;
}

.pq-product-gallery__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--pq-border);
  border-radius: var(--pq-radius-md);
  background: var(--pq-surface);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--pq-duration) var(--pq-ease);
}

.pq-product-gallery__thumb.is-active {
  border-color: var(--pq-primary);
}

.pq-product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--pq-space-1);
}

.pq-product-info__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pq-space-3);
  margin-bottom: var(--pq-space-3);
  font-size: var(--pq-text-sm);
}

.pq-product-info__brand {
  font-weight: 700;
  color: var(--pq-primary);
  text-decoration: none;
}

.pq-product-info__sku {
  color: var(--pq-text-muted);
  font-variant-numeric: tabular-nums;
}

.pq-product-info__title {
  margin: 0 0 var(--pq-space-4);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: var(--pq-tracking-tight);
  line-height: 1.15;
}

.pq-product-info__excerpt {
  margin: 0 0 var(--pq-space-5);
  font-size: var(--pq-text-lg);
  color: var(--pq-text-muted);
  line-height: 1.6;
}

.pq-product-info__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pq-space-2);
  margin-bottom: var(--pq-space-5);
}

.pq-product-info__price {
  margin: 0 0 var(--pq-space-6);
  font-size: var(--pq-text-2xl);
  font-weight: 800;
  color: var(--pq-primary);
}

.pq-product-info__actions {
  display: flex;
  flex-direction: column;
  gap: var(--pq-space-3);
  margin-bottom: var(--pq-space-5);
}

.pq-product-info__category {
  margin: 0;
  font-size: var(--pq-text-sm);
  color: var(--pq-text-muted);
}

.pq-product-detail__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pq-space-10);
  margin-bottom: var(--pq-space-12);
}

.pq-product-block__title {
  margin: 0 0 var(--pq-space-5);
  font-size: var(--pq-text-xl);
  font-weight: 800;
  letter-spacing: var(--pq-tracking-tight);
}

.pq-product-description__text {
  font-size: var(--pq-text-base);
  color: var(--pq-text-secondary);
  line-height: 1.75;
}

.pq-product-features__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--pq-space-3);
}

.pq-product-features__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--pq-space-3);
  font-size: var(--pq-text-sm);
  color: var(--pq-text-secondary);
}

.pq-product-features__list .pq-icon {
  color: var(--pq-accent);
  margin-top: 2px;
}

.pq-product-specs__table-wrap {
  border: 1px solid var(--pq-border);
  border-radius: var(--pq-radius-xl);
  overflow: hidden;
}

.pq-product-specs__table {
  width: 100%;
  border-collapse: collapse;
}

.pq-product-specs__table th,
.pq-product-specs__table td {
  padding: var(--pq-space-4) var(--pq-space-5);
  border-bottom: 1px solid var(--pq-divider);
  text-align: start;
  font-size: var(--pq-text-sm);
}

.pq-product-specs__table th {
  width: 40%;
  font-weight: 600;
  color: var(--pq-text);
  background: var(--pq-bg);
}

.pq-product-specs__table td {
  color: var(--pq-text-secondary);
}

.pq-product-specs__table tr:last-child th,
.pq-product-specs__table tr:last-child td {
  border-bottom: 0;
}

.pq-product-variants__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pq-space-4);
}

.pq-variant-card {
  padding: var(--pq-space-5);
  background: var(--pq-surface);
  border: 1px solid var(--pq-border);
  border-radius: var(--pq-radius-xl);
}

.pq-variant-card.is-default {
  border-color: var(--pq-primary);
  box-shadow: var(--pq-shadow-sm);
}

.pq-variant-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pq-space-3);
  margin-bottom: var(--pq-space-3);
}

.pq-variant-card__name {
  margin: 0;
  font-size: var(--pq-text-base);
  font-weight: 700;
}

.pq-variant-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--pq-space-3);
  margin: 0 0 var(--pq-space-3);
}

.pq-variant-card__meta div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pq-variant-card__meta dt {
  font-size: var(--pq-text-xs);
  color: var(--pq-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pq-variant-card__meta dd {
  margin: 0;
  font-size: var(--pq-text-sm);
  font-weight: 600;
}

.pq-product-video__wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--pq-radius-xl);
  overflow: hidden;
  background: var(--pq-secondary);
}

.pq-product-video__wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pq-product-downloads__featured {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--pq-space-4);
  margin-bottom: var(--pq-space-5);
  padding: var(--pq-space-5);
  background: var(--pq-primary-soft);
  border-radius: var(--pq-radius-xl);
}

.pq-product-downloads__featured-label {
  font-size: var(--pq-text-sm);
  font-weight: 600;
  color: var(--pq-primary);
}

.pq-product-downloads__list {
  display: flex;
  flex-direction: column;
  gap: var(--pq-space-3);
}

.pq-product-download-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--pq-space-4);
  padding: var(--pq-space-4) var(--pq-space-5);
  background: var(--pq-surface);
  border: 1px solid var(--pq-border);
  border-radius: var(--pq-radius-lg);
}

.pq-product-download-item h3 {
  margin: var(--pq-space-2) 0 var(--pq-space-1);
  font-size: var(--pq-text-base);
  font-weight: 600;
}

.pq-product-download-item p {
  margin: 0;
  font-size: var(--pq-text-sm);
  color: var(--pq-text-muted);
}

.pq-product-sidebar-card {
  padding: var(--pq-space-6);
  background: var(--pq-surface);
  border: 1px solid var(--pq-border);
  border-radius: var(--pq-radius-xl);
  box-shadow: var(--pq-shadow-md);
  position: sticky;
  top: calc(80px + var(--pq-space-4));
}

.pq-product-sidebar-card h3 {
  margin: 0 0 var(--pq-space-2);
  font-size: var(--pq-text-lg);
  font-weight: 700;
}

.pq-product-sidebar-card p {
  margin: 0 0 var(--pq-space-5);
  font-size: var(--pq-text-sm);
  color: var(--pq-text-muted);
  line-height: 1.6;
}

.pq-product-relations {
  margin-bottom: var(--pq-space-12);
}

.pq-product-relations__header {
  margin-bottom: var(--pq-space-6);
}

.pq-product-cta-bar {
  margin-top: var(--pq-space-8);
  padding: var(--pq-space-10);
  background: linear-gradient(135deg, var(--pq-primary) 0%, var(--pq-secondary) 100%);
  border-radius: var(--pq-radius-2xl);
  color: #fff;
}

.pq-product-cta-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--pq-space-6);
}

.pq-product-cta-bar__title {
  margin: 0 0 var(--pq-space-2);
  font-size: var(--pq-text-2xl);
  font-weight: 800;
}

.pq-product-cta-bar__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  max-width: 32rem;
}

.pq-product-cta-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pq-space-3);
}

.pq-product-detail__content > * + * {
  margin-top: var(--pq-space-10);
}

@media (min-width: 992px) {
  .pq-product-detail__hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .pq-product-detail__body {
    grid-template-columns: 1fr 320px;
  }

  .pq-product-variants__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .pq-product-detail__body {
    grid-template-columns: 1fr 360px;
  }
}
