/* ==========================================================================
   Product detail page
   ========================================================================== */

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  /* deliberately not align-items:start — the media column must stretch to
     the row height so its sticky child has room to actually stick as the
     page scrolls (with align-items:start the grid cell only wraps its
     content and sticky has no range to move within). */
}

.product-detail-media-wrap { min-width: 0; }

.product-detail-media {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(155deg, var(--slate-100), #E7ECF3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 90px;
}
.product-detail-media img { width: 100%; height: 100%; object-fit: contain; padding: 6%; box-sizing: border-box; }
.product-detail-media svg { width: 30%; height: 30%; color: var(--navy); opacity: 0.85; }

.product-detail-thumbs { display: flex; gap: var(--space-3); margin-top: var(--space-3); }
.product-detail-thumb {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(155deg, var(--slate-100), #E7ECF3);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.product-detail-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; box-sizing: border-box; }
.product-detail-thumb.is-active { border-color: var(--navy); }

.product-detail-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--slate-100);
  color: var(--navy);
}
.badge svg { width: 14px; height: 14px; }
.badge-condition { background: #E7F5EC; color: #15803D; }
.badge-warning { background: #FEF2F2; color: #B91C1C; }

.product-detail-title { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); margin-bottom: var(--space-3); }
.product-detail-price { font-family: var(--font-heading); font-weight: 700; font-size: 2rem; color: var(--navy); margin-bottom: var(--space-2); }
.product-detail-stock { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: #15803D; margin-bottom: var(--space-5); }
.product-detail-stock svg { width: 16px; height: 16px; }

.product-detail-desc { font-size: 1.02rem; color: var(--color-text); line-height: 1.6; margin-bottom: var(--space-6); }

.product-detail-actions { display: flex; gap: var(--space-3); margin-bottom: var(--space-6); flex-wrap: wrap; }
.product-detail-actions .btn { flex: 1 1 200px; }

.warranty-picker {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.warranty-picker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: var(--space-3);
}
.warranty-picker-label svg { width: 17px; height: 17px; color: var(--coral); }
.warranty-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14.5px;
}
.warranty-option:hover { background: var(--color-bg-alt); }
.warranty-option:has(input:checked) { background: #FFF1EC; }
.warranty-option input[type="radio"] { width: 17px; height: 17px; accent-color: var(--coral); flex-shrink: 0; }
.warranty-option .warranty-price { margin-left: auto; font-weight: 600; color: var(--navy); }

.fob-required-tag {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #DC2626;
  background: #FEF2F2;
  border-radius: 999px;
  padding: 2px 8px;
}
.fob-picker-hint { font-size: 13px; color: var(--color-text-muted); margin-top: var(--space-2); padding: 0 var(--space-3); }
.fob-picker-error { font-size: 13.5px; color: #DC2626; margin-top: var(--space-2); padding: 0 var(--space-3); font-weight: 600; }

.spec-list {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
}
.spec-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
}
.spec-row:nth-child(even) { background: var(--color-bg-alt); }
.spec-row dt { font-weight: 600; color: var(--navy); }
.spec-row dd { margin: 0; color: var(--color-text-muted); }

.detail-note {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 13.5px;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
}
.detail-note svg { width: 18px; height: 18px; color: var(--coral); flex-shrink: 0; margin-top: 1px; }
.detail-note.warning { background: #FEF2F2; color: #7F1D1D; }
.detail-note.warning svg { color: #DC2626; }

.product-not-found {
  text-align: center;
  padding: var(--space-9) var(--space-5);
}
.product-not-found svg { width: 48px; height: 48px; color: var(--slate); margin: 0 auto var(--space-4); }

@media (max-width: 900px) {
  .product-detail-layout { grid-template-columns: 1fr; }
  .product-detail-media { position: static; aspect-ratio: 4/3; }
  .spec-row { grid-template-columns: 130px 1fr; }
}
