/* Parts-catalogue components shared by /products/ and /product/<code>.
   Product shots sit on an aluminium sweep, part codes are yellow hang-tags
   (the one loud element), everything else is quiet ink-on-white. Brand
   tokens (--accent, fonts) come from site.css. */
:root {
  --alu: #f3f4f5;
  --alu-deep: #e9ebed;
  --steel: #e3e5e8;
  --slate: #5b6068;
  --ink: #000;
  --wrap: 1320px;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button { font-family: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 40px; }

/* Buttons */
.b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.b svg { width: 18px; height: 18px; flex-shrink: 0; }
.b-primary { background: var(--accent); color: var(--ink); }
.b-primary:hover { background: #ffc93d; }
.b-secondary { background: #fff; color: var(--ink); border-color: var(--steel); }
.b-secondary:hover { border-color: var(--ink); }
.b-ghost { background: none; color: var(--slate); height: auto; padding: 4px 2px; font-weight: 500; }
.b-ghost:hover { color: var(--ink); }
.b-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--steel);
  color: var(--ink);
}
.b-icon:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--ink); }
.b-icon:disabled, .b-icon[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

/* Hang-tag for part codes */
.tag {
  --tag-hole: var(--alu);
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px 0 20px;
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%);
  border-radius: 0 4px 4px 0;
}
.tag::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--tag-hole);
}
.tag-lg {
  height: 40px;
  padding: 0 16px 0 30px;
  font-size: 20px;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
}
.tag-lg::before { left: 12px; width: 8px; height: 8px; margin-top: -4px; }

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 14px; color: var(--slate); }
.crumbs li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before {
  content: "";
  width: 14px; height: 14px;
  background: currentColor;
  opacity: 0.5;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>") center/contain no-repeat;
}
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* Product shot + part tile */
.shot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--alu);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.2s ease;
}
.shot img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 10%;
  mix-blend-mode: multiply; /* white photo backgrounds melt into the sweep */
}
.shot .none { width: 40%; color: #b9bdc3; }
.shot .tag { position: absolute; left: 12px; top: 12px; }

.part { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; min-width: 0; }
.part:hover .shot { background: var(--alu-deep); }
.part:hover .tag { --tag-hole: var(--alu-deep); }
.part-name {
  margin-top: 14px;
  font-size: 15px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.part:hover .part-name { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.part-cat { margin-top: 4px; font-size: 13px; color: var(--slate); }

/* Internal (staff-only) marker */
.internal-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px;
  border-radius: 100px;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600;
}
.internal-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.shot .internal-badge { position: absolute; right: 12px; top: 13px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120;
  transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast svg { width: 18px; height: 18px; color: var(--accent); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .wrap { padding-inline: 20px; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .part-name { font-size: 14px; }
  .shot .tag { left: 8px; top: 8px; height: 22px; font-size: 12px; }
}
