/* ═══════════════════════════════════════════════════════════════
   PRODUCT IMAGE TREATMENT — images.css
   ─ For transparent product images
   ─ Keeps dark steel backdrop / framed presentation
   ─ Keeps natural product drop shadows
   ─ Removes old blend-mode overlay/darkening behavior
   ═══════════════════════════════════════════════════════════════ */


/* ── Base product image wrapper ─────────────────────────────────
   Applied to the thumb/container on product pages.
   Keeps aspect ratio and clips gracefully.                       */
.prod-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);

  /* Dark backdrop behind transparent product images */
  background: var(--steel-700);

  /* Steel frame + depth shadow */
  box-shadow:
    0 0 0 1px var(--steel-600),
    0 8px 32px rgba(0,0,0,0.7),
    0 2px 8px rgba(0,0,0,0.5);
}


/* ── The image itself ───────────────────────────────────────────
   Transparent images should render normally.
   No mix-blend-mode, no saturation compensation, no overlay effect. */
.prod-img {
  display: block;
  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: left center;   /* keep left edge/conveyor head in frame */

  /* Important: do NOT darken or blend transparent product images */
  mix-blend-mode: normal;

  /* Natural product shadow only */
  filter:
    drop-shadow(0 6px 20px rgba(0,0,0,0.75))
    drop-shadow(0 2px 6px rgba(0,0,0,0.55));

  transition:
    transform 0.6s var(--ease),
    filter 0.3s ease;
}


/* ── Right-facing conveyor variant ──────────────────────────────
   Add class prod-img--right to keep RIGHT edge in frame.          */
.prod-img--right {
  object-position: right center;
}


/* ── Center crop variant ──────────────────────────────────────── */
.prod-img--center {
  object-position: center center;
}


/* ── Hover reveal: subtle scale on category cards ─────────────── */
.prod-card:hover .prod-img {
  transform: scale(1.04);

  /* Slightly stronger shadow on hover only */
  filter:
    drop-shadow(0 8px 28px rgba(0,0,0,0.85))
    drop-shadow(0 3px 8px rgba(0,0,0,0.65));
}


/* ═══════════════════════════════════════════════════════════════
   PRODUCT PAGE HOVER LIGHTBOX
   Only active on product spec pages (.product-page class on body).
   Hovering the main product image expands it to a larger lightbox
   so the user can see full detail without clicking away.
   ═══════════════════════════════════════════════════════════════ */


/* ── Lightbox backdrop ────────────────────────────────────────── */
#img-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;

  background: rgba(13,15,18,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  align-items: center;
  justify-content: center;

  cursor: zoom-out;
  animation: lbFadeIn 0.25s ease;
}

#img-lightbox.open {
  display: flex;
}


@keyframes lbFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* ── Lightbox image ─────────────────────────────────────────────
   Lightbox image should show exactly as-is.                       */
#img-lightbox img {
  max-width: min(67vw, 960px);
  max-height: 72vh;

  width: auto;
  height: auto;

  object-fit: contain;
  border-radius: 6px;

  box-shadow:
    0 0 0 1px var(--steel-500),
    0 32px 80px rgba(0,0,0,0.9),
    0 8px 24px rgba(0,0,0,0.7);

  animation: lbZoomIn 0.3s cubic-bezier(0.34,1.56,0.64,1);

  /* No blend/filter inside lightbox */
  mix-blend-mode: normal;
  filter: none;
}


@keyframes lbZoomIn {
  from {
    transform: scale(0.75);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}


/* ── Lightbox caption ────────────────────────────────────────── */
#img-lightbox figcaption {
  position: absolute;
  bottom: 24px;
  left: 50%;

  transform: translateX(-50%);

  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: var(--steel-300);
  background: rgba(13,15,18,0.75);

  padding: 6px 16px;
  border-radius: 20px;

  white-space: nowrap;
}


/* ── Lightbox close button ───────────────────────────────────── */
#img-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 9001;

  background: var(--steel-700);
  border: 1px solid var(--steel-500);
  color: var(--steel-200);

  font-size: 1.3rem;
  line-height: 1;

  cursor: pointer;

  padding: 8px 12px;
  border-radius: var(--radius);

  transition:
    background 0.2s,
    color 0.2s;
}

#img-lightbox-close:hover {
  background: var(--steel-600);
  color: var(--white);
}


/* ── Trigger element: main product image on spec pages ────────── */
.product-page .prod-img-wrap--main {
  cursor: zoom-in;
  position: relative;
}


/* ── Built-in hover zoom hint for main product image ──────────── */
.product-page .prod-img-wrap--main::after {
  content: '\25B6 hover to zoom';

  position: absolute;
  bottom: 10px;
  right: 12px;

  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;

  color: var(--amber);
  background: rgba(13,15,18,0.7);

  padding: 4px 10px;
  border-radius: 20px;

  pointer-events: none;
  opacity: 0;

  transition: opacity 0.2s;
}

.product-page .prod-img-wrap--main:hover::after {
  opacity: 1;
}


/* ── Optional HTML-based zoom hint ──────────────────────────────
   Use this only if you are adding a .prod-zoom-hint element in HTML. */
.prod-zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 12px;
  z-index: 2;

  background: rgba(13,15,18,0.8);
  color: var(--amber);

  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  padding: 4px 10px;
  border-radius: 20px;

  pointer-events: none;
  opacity: 0;

  transition: opacity 0.2s;
}

.prod-img-wrap--main:hover .prod-zoom-hint {
  opacity: 1;
}


/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  #img-lightbox img {
    max-width: 92vw;
    max-height: 80vh;
  }

  .product-page .prod-img-wrap--main {
    cursor: pointer;
  }
}