/* assets/css/products.css */

/* ── PAGE HERO ── */
.page-hero {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/assets/images/rebar.jpg');
  background-size: cover;
  background-position: center 40%;
  filter: brightness(0.3);
  z-index: 0;
}

.page-hero-content {
  position: relative;
  z-index: 1;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.page-hero-title {
  font-size: clamp(2.2rem, 5vw, var(--text-5xl));
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin: var(--space-xs) 0 var(--space-sm);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--color-orange);
}

.breadcrumb span:last-child {
  color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-sep {
  color: rgba(255, 255, 255, 0.35);
}

/* ── PRODUCT TABS NAV ── */
.product-tabs-wrap {
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-tabs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.product-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.product-tab {
  display: inline-block;
  padding: 1rem 1.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.product-tab:hover {
  color: var(--color-orange);
  border-bottom-color: var(--color-orange);
}

/* ── PRODUCT SECTIONS ── */
.product-section {
  scroll-margin-top: calc(var(--nav-height) + 56px); /* account for sticky tabs */
}

/* Two-column layout: image left, content right */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* Reversed: content left, image right */
.product-layout-reverse {
  direction: rtl;
}

.product-layout-reverse > * {
  direction: ltr;
}

/* Image column */
.product-image-col {
  position: relative;
}

.product-image-wrap {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-image-wrap img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.product-image-wrap:hover img {
  transform: scale(1.03);
}

/* Orange decorative corner accent */
.product-image-accent {
  position: absolute;
  bottom: -12px;
  right: -12px;
  width: 80px;
  height: 80px;
  background: var(--color-orange);
  border-radius: var(--border-radius-lg);
  z-index: -1;
  opacity: 0.85;
}

/* Content column */
.product-content-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.product-title {
  font-size: clamp(1.75rem, 3vw, var(--text-4xl));
  font-weight: 800;
  color: var(--text-primary);
  margin: var(--space-xs) 0 var(--space-sm);
  line-height: 1.15;
}

.product-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.product-desc strong {
  color: var(--text-primary);
}

/* ── SPEC LIST ── */
.spec-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.spec-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.spec-item strong {
  color: var(--text-primary);
}

.spec-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--color-orange);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 1px;
  line-height: 1;
}

/* ── WEIGHT TABLE ── */
.weight-table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.weight-table-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-sm);
}

.weight-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.weight-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.weight-table thead tr {
  background: var(--color-orange);
}

.weight-table th {
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  font-size: var(--text-sm);
}

.weight-table th:first-child {
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.weight-table th:last-child {
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.weight-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.weight-table tbody tr:last-child {
  border-bottom: none;
}

.weight-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.025);
}

[data-theme="dark"] .weight-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.weight-table tbody tr:hover {
  background: rgba(232, 82, 10, 0.06);
}

.weight-table td {
  padding: 0.55rem 1rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.weight-table td:first-child {
  font-weight: 600;
}

.td-na {
  color: var(--text-muted);
  font-style: italic;
}

/* ── PRODUCT CTA ── */
.product-cta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-xs);
}

/* ── CTA BAND (reused from home) ── */
.cta-band {
  background: var(--bg-secondary);
  padding: var(--space-lg) 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.cta-band h2 {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.cta-band p {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.cta-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .product-layout {
    gap: var(--space-md);
  }

  .product-image-wrap img {
    height: 380px;
  }
}

@media (max-width: 768px) {
  /* Stack all product sections */
  .product-layout,
  .product-layout.product-layout-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  /* Always show image on top when stacked */
  .product-layout-reverse .product-image-col {
    order: -1;
  }

  .product-image-wrap img {
    height: 260px;
  }

  .product-image-accent {
    display: none;
  }

  .product-tabs-wrap {
    position: static; /* un-stick on mobile so content is not pushed */
  }

  .product-section {
    scroll-margin-top: var(--nav-height);
  }

  .product-tab {
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
  }

  .page-hero {
    min-height: 32vh;
  }

  .page-hero-title {
    font-size: 2rem;
  }

  .weight-table-wrap {
    padding: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .product-cta {
    flex-direction: column;
  }

  .product-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── PRODUCT TABS STICKY + ACTIVE UNDERLINE ── */
.product-tabs-wrap {
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.product-tab.active {
  color: var(--color-orange);
  border-bottom: 2px solid var(--color-orange);
}

/* ── PRODUCT IMAGE ORANGE GLOW HOVER ── */
.product-image-wrap:hover img {
  box-shadow: 0 0 0 3px var(--color-orange-border), 0 12px 40px rgba(232,82,10,0.15);
}
