/* Product photo carousel — one image at a time.
   Works without JS as a swipeable scroll-snap strip; carousel.js adds
   arrows, counter, thumbnails, keyboard and click-to-zoom. */
.ap-carousel {
  position: relative;
  width: 100%;
  min-width: 0;
  /* Stop the slide strip's width from stretching a grid/flex parent. */
  contain: inline-size;
}
.two-col > div:has(> .ap-carousel) { min-width: 0; }

.ap-car-stage {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--paper, #f7f3ea);
}

.ap-car-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ap-car-track::-webkit-scrollbar { display: none; }
.ap-car-track:focus-visible { outline: 2px solid var(--gold-warm); outline-offset: 2px; }

.ap-car-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-car-slide img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.ap-car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 26, 54, 0.78);
  color: #f4efe3;
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  display: none;
}
.ap-car-btn:hover { background: rgba(15, 26, 54, 0.95); }
.ap-car-btn:focus-visible { outline: 2px solid var(--gold-warm); outline-offset: 2px; }
.ap-car-btn[disabled] { opacity: 0.3; cursor: default; }
.ap-car-prev { left: 8px; }
.ap-car-next { right: 8px; }

.ap-car-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  background: rgba(15, 26, 54, 0.78);
  color: #f4efe3;
  font-family: var(--mono, monospace);
  font-size: 12px;
  letter-spacing: 0.04em;
  display: none;
}

.ap-car-caption {
  font-size: 13px;
  line-height: 1.45;
  margin: 0.5rem 0 0;
  min-height: 2.9em;
}

.ap-car-thumbs {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 0 2px;
  scrollbar-width: thin;
}
.ap-car-thumb {
  flex: 0 0 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  background: var(--paper, #f7f3ea);
  cursor: pointer;
  opacity: 0.6;
}
.ap-car-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-car-thumb[aria-current="true"] { border-color: var(--gold-warm); opacity: 1; }
.ap-car-thumb:hover { opacity: 1; }
.ap-car-thumb:focus-visible { outline: 2px solid var(--gold-warm); outline-offset: 1px; }

/* JS enabled */
.ap-carousel.is-ready .ap-car-btn,
.ap-carousel.is-ready .ap-car-count { display: block; }
.ap-carousel.is-ready .ap-car-thumbs { display: flex; }

/* Lightbox */
.ap-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 12, 24, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ap-lightbox[hidden] { display: none; }
.ap-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ap-lightbox .ap-car-btn { display: block; }
.ap-lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 239, 227, 0.15);
  color: #f4efe3;
  font-size: 26px;
  line-height: 44px;
  cursor: pointer;
}
.ap-lb-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #f4efe3; font-family: var(--mono, monospace); font-size: 13px; }

@media (max-width: 600px) {
  .ap-car-btn { width: 36px; height: 36px; line-height: 36px; font-size: 18px; }
  .ap-car-thumb { flex-basis: 52px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-car-track { scroll-behavior: auto; }
}
