/**
 * HygieneChemSol - Product Catalog & Dossier Styles
 * Implements Section 4 (Product Catalog & E-Commerce Architecture)
 */

/* Catalog Layout: Left Faceted Sidebar + Right Listing */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-8);
  align-items: start;
}

/* 1. Faceted Filter Sidebar */
.filter-sidebar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: var(--space-4);
}

.filter-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-deep-navy);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-reset-btn {
  font-size: var(--text-xs);
  color: var(--color-primary-teal);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.filter-group {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-deep-navy);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-ink-text);
  cursor: pointer;
  user-select: none;
}

.filter-label input[type="checkbox"],
.filter-label input[type="radio"] {
  accent-color: var(--color-primary-teal);
  width: 16px;
  height: 16px;
  margin-right: 8px;
}

.filter-count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-tint-bg);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* 2. Catalog Main Content Area */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--color-tint-bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
}

.toolbar-info {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-deep-navy);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sort-select {
  padding: 6px 12px;
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-ink-text);
  cursor: pointer;
}

.view-toggle-btns {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
}

.view-btn {
  background: none;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.view-btn.active {
  background: var(--color-primary-teal);
  color: var(--color-white);
}

/* 3. Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

/* Product Card - Grid View */
.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-light-accent);
}

.product-card-img-wrap {
  position: relative;
  background: var(--color-tint-bg);
  padding: var(--space-4);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--color-border-light);
}

.product-card-img {
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-card-img {
  transform: scale(1.04);
}

.product-badge-sku {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-deep-navy);
  color: var(--color-white);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.product-badge-cert {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-tint-bg-alt);
  color: var(--color-primary-teal);
  border: 1px solid var(--color-border);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.product-card-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-category-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary-teal);
  margin-bottom: 6px;
  display: block;
}

.product-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-deep-navy);
  margin-bottom: var(--space-2);
  line-height: 1.35;
}

.product-card-title a {
  color: inherit;
}

.product-card-title a:hover {
  color: var(--color-primary-teal);
}

.product-card-brief {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.product-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.meta-pill {
  font-size: 11px;
  background: var(--color-tint-bg);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-deep-navy);
  border: 1px solid var(--color-border-light);
}

.product-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

.product-card-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-actions .btn i {
  flex-shrink: 0;
}

.product-card-actions .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* Products List View Style */
.products-grid.list-view {
  grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
  flex-direction: row;
}

.products-grid.list-view .product-card-img-wrap {
  width: 260px;
  aspect-ratio: auto;
  border-bottom: none;
  border-right: 1px solid var(--color-border-light);
}

@media (max-width: 768px) {
  .products-grid.list-view .product-card {
    flex-direction: column;
  }
  .products-grid.list-view .product-card-img-wrap {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }
}

/* 4. Category Overview Cards (Landing Page Grid) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.category-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-primary-teal);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-light-accent);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--color-tint-bg);
  color: var(--color-primary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  transition: all var(--transition-fast);
}

.category-card:hover .category-icon-box {
  background: var(--color-primary-teal);
  color: var(--color-white);
}

.category-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-deep-navy);
  margin-bottom: var(--space-2);
}

.category-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* 5. Product Dossier Detailed Page (Section 4 & 5) */
.product-dossier-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: start;
  margin-bottom: var(--space-12);
}

.dossier-gallery {
  background: var(--color-tint-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  text-align: center;
}

.dossier-main-img {
  max-height: 380px;
  margin: 0 auto;
}

.dossier-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-6);
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.dossier-specs-table th,
.dossier-specs-table td {
  padding: 12px 16px;
  font-size: var(--text-sm);
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.dossier-specs-table th {
  background: var(--color-tint-bg);
  color: var(--color-deep-navy);
  width: 38%;
  font-weight: 700;
}

.dossier-specs-table td {
  color: var(--color-ink-text);
}

.sds-download-banner {
  background: linear-gradient(135deg, #123F5C 0%, #1B8CB4 100%);
  color: var(--color-white);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-8);
}

.sds-info h4 {
  color: var(--color-white);
  margin-bottom: 4px;
}

.sds-info p {
  color: #DDE8ED;
  font-size: var(--text-sm);
  margin: 0;
}

.dossier-attrs-grid {
  background: var(--color-tint-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dossier-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: var(--space-3);
}

.dossier-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.dossier-cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.dossier-cta-row .btn-lg {
  flex: 1 1 auto;
  min-width: min(100%, 200px);
}

.specs-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.dossier-video-bar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-6);
}

@media (max-width: 992px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .product-dossier-layout {
    grid-template-columns: 1fr;
  }

  .specs-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-controls {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .sds-download-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .sds-download-banner .btn {
    width: 100%;
    justify-content: center;
  }

  .dossier-attrs-grid {
    grid-template-columns: 1fr;
  }

  .dossier-specs-table th,
  .dossier-specs-table td {
    padding: 10px 12px;
    font-size: var(--text-xs);
  }

  .dossier-main-img {
    max-height: 280px;
  }
}
