/* assets/css/product.css */

/* Product Grid -> Changed to List View per user request */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.product-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 16px;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateX(4px);
  border-color: var(--c-accent);
}

.pc-img {
  width: 140px;
  height: 100px;
  object-fit: contain;
  margin-right: 24px;
  margin-bottom: 0;
  background: #f9f9f9;
  border-radius: 4px;
  flex-shrink: 0;
}

.pc-info-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}


.pc-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #ffe3d9;
  color: var(--c-accent);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pc-series {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 4px;
}

.pc-title {
  font-size: 13px;
  color: var(--c-secondary);
  flex: 1;
  margin-bottom: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Material Badges */
.mat-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.mat-badge {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  opacity: 0.2;
}

.mat-badge.active-1, .mat-badge.active-2 {
  opacity: 1;
}
.mat-badge.active-2 {
  outline: 2px solid #333;
  outline-offset: -2px;
}

/* Colors for materials */
.mat-H { background-color: #d32f2f; } /* Hardened */
.mat-P { background-color: #1976d2; } /* Steel */
.mat-K { background-color: #fbc02d; color: #333; } /* Cast Iron */
.mat-N { background-color: #388e3c; } /* Alu */
.mat-M { background-color: #7b1fa2; } /* Stainless */
.mat-S { background-color: #e64a19; } /* Titanium */

/* Detail Page Layout */
.product-detail-wrap {
  display: flex;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pd-left {
  flex: 0 0 100%;
  min-width: 0;
}
@media (min-width: 768px) {
  .pd-left { flex: 0 0 40%; }
}

.pd-right {
  flex: 1;
  min-width: 0;
}

.pd-img-main {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  margin-bottom: 16px;
}

/* Variant Table */
.variant-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-surface);
  max-width: 100%;
  width: 100%;
}

.variant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.variant-table th, .variant-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: center;
  white-space: nowrap;
}

.variant-table th {
  background: #f9f9f9;
  font-weight: 600;
  color: var(--c-secondary);
}

.variant-table tr:hover {
  background: #f5f5f5;
}

/* Mobile freeze EDP column */
@media (max-width: 768px) {
  .variant-table td:first-child,
  .variant-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    border-right: 2px solid var(--c-border);
  }
  .variant-table th:first-child { background: #f9f9f9; }
}

.variant-highlight {
  background: #ffe3d9 !important;
}

/* Tabs */
.pd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #eee;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ============================
   PRODUCT MOBILE
   ============================ */
@media (max-width: 768px) {
  /* Product cards: stack vertically */
  .product-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }
  .pc-img {
    width: 100%;
    height: 120px;
    margin-right: 0;
    margin-bottom: 12px;
  }

  /* Detail page: full width everything */
  .product-detail-wrap {
    gap: 16px;
  }
  .pd-left { flex: 0 0 100%; }
  .pd-right { flex: 0 0 100%; }

  .pd-tabs {
    gap: 0;
  }
  .tab-btn {
    font-size: 13px;
    padding: 10px 12px;
  }
}
