/* Hero Mosaic */
.hero-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  aspect-ratio: 1;
  max-width: 420px;
  margin-left: auto;
  border-radius: 12px;
  overflow: hidden;
}

.hero-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-mosaic .mosaic-featured {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* Product Card */
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.product-card-image {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  background: #F4F3EF;
  display: block;
}

.product-card-body {
  padding: 14px;
}

.product-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.product-card-source {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1E6B72;
  background: #E8F4F5;
  padding: 2px 8px;
  border-radius: 4px;
}

.product-card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-vendor {
  font-size: 12px;
  color: rgba(26, 26, 26, 0.45);
  margin-bottom: 8px;
}

.product-card-price {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Spec Pills */
.spec-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: #F4F3EF;
  color: rgba(26, 26, 26, 0.6);
  white-space: nowrap;
}

/* Filter Pills */
.filter-pill {
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  color: rgba(26, 26, 26, 0.6);
}

.filter-pill:hover {
  border-color: #1E6B72;
  color: #1E6B72;
}

.filter-pill.active {
  background: #1E6B72;
  color: white;
  border-color: #1E6B72;
}

/* Image Placeholder */
.image-placeholder {
  aspect-ratio: 1;
  width: 100%;
  background: #F4F3EF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(26, 26, 26, 0.2);
  font-size: 14px;
}

/* Pipeline Diagram */
.pipeline-diagram {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 800px;
  margin: 0 auto;
}

.pipeline-phase {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 20px 24px;
}

.pipeline-phase-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1E6B72;
  margin-bottom: 12px;
}

.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-node {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  background: #F4F3EF;
  color: rgba(26, 26, 26, 0.7);
  white-space: nowrap;
}

.pipeline-node-accent {
  background: #E8F4F5;
  color: #1E6B72;
  font-weight: 500;
}

.pipeline-arrow {
  color: rgba(26, 26, 26, 0.25);
  font-size: 18px;
}

.pipeline-connector {
  width: 2px;
  height: 24px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0 auto;
}

/* Specs Badges */
.specs-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.specs-has { background: #dbeafe; color: #1e40af; }
.specs-none { background: #f3f4f6; color: rgba(26, 26, 26, 0.35); }

/* Tier Badges */
.tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.tier-1 { background: #dcfce7; color: #166534; }
.tier-2 { background: #dbeafe; color: #1e40af; }
.tier-3 { background: #fef3c7; color: #92400e; }
.tier-4 { background: #fee2e2; color: #991b1b; }

/* Metric Cards */
.metric-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: #1E6B72;
  line-height: 1;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.metric-detail {
  font-size: 11px;
  color: rgba(26, 26, 26, 0.4);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  background: white;
  border: none;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(26, 26, 26, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: color 0.15s;
}

.modal-close:hover {
  color: rgba(26, 26, 26, 0.8);
}

.modal-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #F4F3EF;
  border-radius: 12px 12px 0 0;
}

.modal-body-inner {
  padding: 24px;
}

.modal-title {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-vendor {
  font-size: 13px;
  color: rgba(26, 26, 26, 0.5);
  margin-bottom: 16px;
}

.modal-price {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Modal Spec Table */
.spec-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.spec-table th {
  text-align: left;
  font-weight: 500;
  padding: 8px 12px;
  background: #F4F3EF;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: rgba(26, 26, 26, 0.6);
  width: 45%;
}

.spec-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.spec-table td.null-value {
  color: rgba(26, 26, 26, 0.2);
}

/* Match Info Box */
.match-info {
  background: #F4F3EF;
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
}

.match-info-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(26, 26, 26, 0.45);
  margin-bottom: 10px;
}

.match-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 13px;
}

.match-info-label {
  color: rgba(26, 26, 26, 0.45);
  font-size: 11px;
}

/* Validation Badges */
.val-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.val-pass { background: #dcfce7; color: #166534; }
.val-warning { background: #fef3c7; color: #92400e; }
.val-fail { background: #fee2e2; color: #991b1b; }

/* Title similarity color coding */
.sim-good { color: #166534; }
.sim-mid { color: #92400e; }
.sim-bad { color: #991b1b; }

/* Colorway Card — image wrapper + dot indicators */
.product-card-image-wrap {
  position: relative;
  overflow: hidden;
}

.product-card-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background 0.15s;
}

.dot.active {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.3);
}

.dot:hover {
  background: rgba(255, 255, 255, 0.85);
}

.color-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: #F4F3EF;
  color: rgba(26, 26, 26, 0.55);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-color-row {
  font-size: 12px;
  color: rgba(26, 26, 26, 0.45);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal Gallery */
.modal-gallery {
  background: #F4F3EF;
  border-radius: 12px 12px 0 0;
}

.modal-gallery-main {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.modal-gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px 12px;
  overflow-x: auto;
}

.modal-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.modal-thumb.active {
  border-color: #1E6B72;
  opacity: 1;
}

.modal-thumb:hover {
  opacity: 1;
}

/* Colorway List in Modal */
.colorway-list {
  margin-top: 16px;
}

.colorway-list-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(26, 26, 26, 0.45);
  margin-bottom: 8px;
}

.colorway-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F4F3EF;
  margin-bottom: 6px;
  font-size: 13px;
}

.colorway-item.active {
  background: #E8F4F5;
  border: 1px solid rgba(30, 107, 114, 0.2);
}

.colorway-item-name {
  font-weight: 500;
  color: rgba(26, 26, 26, 0.7);
}

.colorway-item-link {
  font-size: 12px;
  color: #1E6B72;
  text-decoration: none;
  white-space: nowrap;
}

.colorway-item-link:hover {
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: rgba(26, 26, 26, 0.4);
  font-size: 14px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}
