/* Product page (product.php / product.js) */
.product-page { max-width: 1140px; }
.pp-crumbs { font-size: 0.9em; margin-bottom: 14px; color: #64748b; }
.pp-crumbs i { font-size: 0.7em; margin: 0 6px; }
.pp-muted { color: #64748b; font-size: 0.9em; font-weight: normal; }

/* Gallery */
.pp-main {
  position: relative; background: #0f172a; border-radius: 10px; overflow: hidden;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.pp-main img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: auto; }
.pp-main.pp-empty { cursor: default; flex-direction: column; color: #94a3b8; gap: 8px; }
.pp-main.pp-empty i { font-size: 48px; }
.pp-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.85); color: #0f172a; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.pp-nav.prev { left: 10px; }
.pp-nav.next { right: 10px; }
.pp-count { position: absolute; bottom: 8px; right: 10px; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.pp-caption { font-size: 0.9em; color: #334155; margin: 6px 2px 8px; min-height: 1.4em; }
.pp-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pp-thumb {
  flex: 0 0 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 6px;
  background: #0f172a; cursor: pointer; overflow: hidden;
}
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pp-thumb.active { border-color: #2563eb; }
.pp-disclaimer { font-size: 0.8em; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 6px 10px; margin-top: 8px; }

/* Enlarged view */
.pp-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 2000; cursor: zoom-out; }
.pp-lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; }

/* Info */
.pp-number { font-size: 2rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 4px; word-break: break-word; }
.pp-desc { font-size: 1.15rem; color: #334155; margin-bottom: 6px; }
.pp-buy { margin: 12px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-price { font-size: 1.6rem; font-weight: 700; }
.pp-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pp-facts { padding-left: 18px; color: #334155; }
.pp-specs th { font-weight: normal; color: #475569; width: 60%; }
.pp-h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 10px; }

/* Sections */
.pp-section { margin-top: 32px; }
.pp-table td, .pp-table th { vertical-align: top; }
.pp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pp-stat { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.pp-stat-n { font-size: 1.6rem; font-weight: 700; }
.pp-stat-l { font-size: 0.85em; color: #64748b; }

/* Mini cards (similar / found with) */
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pp-mini { display: flex; flex-direction: column; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; color: inherit; text-decoration: none; background: #fff; }
.pp-mini:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); color: inherit; }
.pp-mini img, .pp-mini .pp-noimg { width: 100%; height: 130px; object-fit: cover; background: #0f172a; }
.pp-noimg { display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 32px; }
.pp-mini-body { padding: 8px 10px; font-size: 0.9em; }
.pp-mini-num { font-weight: 700; text-transform: uppercase; }
.pp-mini-desc { color: #475569; }
.pp-mini-price { font-weight: 700; }
.pp-mini-note { margin-top: 4px; font-size: 0.85em; color: #475569; }

@media (max-width: 576px) {
  .pp-number { font-size: 1.6rem; }
  .pp-thumb { flex-basis: 56px; height: 56px; }
}

/* Part editor shortcut next to the part number (staff only) */
.pp-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-title-row .pp-number { margin-bottom: 0; }
.pp-edit { white-space: nowrap; }

/* Device models hidden from logged-out visitors (product.php) */
.pp-locked { letter-spacing: 1px; color: #94a3b8; cursor: help; }
.pp-login-note { white-space: nowrap; font-size: 0.9em; margin-left: 6px; }

/* Proven replacement (verified substitute) recommendation under the price
   for out-of-stock / not-stocked parts, and the "Proven replacement for" list */
.pp-verified-pick { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.pp-verified-pick > .fa-circle-check { color: #16a34a; }
.pp-verified-pick a { font-weight: 700; text-transform: uppercase; }
.pp-proven { padding-left: 18px; }
.pp-proven a { font-weight: 700; }

/* Where the part is in the shop - admin and up (product.php $whereHtml) */
.pp-where { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pp-where > .fa-location-dot { color: #2563eb; }
.pp-loc { display: inline-block; padding: 2px 10px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.pp-loc.drawer { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; }
.pp-loc.box { background: rgba(180, 120, 20, 0.16); color: #8a5a00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pp-where { background: rgba(37, 99, 235, 0.12); border-color: rgba(96, 165, 250, 0.35); }
  :root:not([data-theme="light"]) .pp-loc.drawer { color: #93c5fd; }
  :root:not([data-theme="light"]) .pp-loc.box { color: #e0b060; }
}

/* "Where to buy" - visitors outside St Lucia (product.php, whereToBuyLinks()) */
.pp-where-to-buy { margin: 14px 0; padding: 12px 14px; border: 1px solid rgba(128, 128, 128, 0.25); border-radius: 10px; }
.pp-buy-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pp-buy-links .fa-magnifying-glass { font-size: 0.75em; opacity: 0.6; }
