
/* Celes Tech product media system — static HTML/CSS/JavaScript architecture */

.product-image-shell,
.gallery-media-shell,
.lightbox-media-shell {
  position: relative;
  overflow: hidden;
  background: #e8edf0;
}

.product-image-shell::before,
.gallery-media-shell::before,
.lightbox-media-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 18%, rgba(255,255,255,.58) 42%, transparent 66%),
    #e7ecef;
  background-size: 240% 100%;
  animation: media-shimmer 1.5s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.product-image-shell.is-loading::before,
.gallery-media-shell.is-loading::before,
.lightbox-media-shell.is-loading::before { opacity: 1; }

.product-picture {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.product-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #e8edf0;
  transition: transform .7s cubic-bezier(.22,.61,.36,1), opacity .25s ease;
}

.product-picture.is-technical .product-image,
.gallery-media-shell.is-technical .product-image,
.lightbox-media-shell.is-technical .product-image {
  object-fit: contain;
  padding: clamp(18px, 3vw, 42px);
  background-color: #fbfbf8;
  background-image:
    linear-gradient(rgba(54,95,130,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,95,130,.055) 1px, transparent 1px);
  background-size: 28px 28px;
}

.product-card-image {
  aspect-ratio: 4 / 3;
  width: 100%;
}

.product-card:hover .product-card-image .product-image {
  transform: scale(1.045);
}

.media-status {
  position: absolute;
  z-index: 2;
  inset: auto 16px 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 999px;
  color: #fff;
  background: rgba(10,18,26,.72);
  backdrop-filter: blur(12px);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.product-gallery {
  display: grid;
  gap: 14px;
}

.product-gallery__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 420px;
  border-radius: 30px;
  background: #dfe7ec;
  box-shadow: 0 34px 90px rgba(6,18,29,.15);
  isolation: isolate;
}

.product-gallery__stage > picture {
  position: absolute;
  inset: 0;
}

.product-gallery__stage .product-image {
  border-radius: inherit;
}

.product-gallery__open {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
}

.product-gallery__topline {
  position: absolute;
  z-index: 6;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.media-type-badge,
.media-counter {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 999px;
  color: white;
  background: rgba(10,18,26,.72);
  backdrop-filter: blur(13px);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.product-gallery__stage.is-technical .media-type-badge,
.product-gallery__stage.is-technical .media-counter {
  color: #0a121a;
  background: rgba(255,255,255,.88);
  border-color: rgba(54,95,130,.16);
}

.gallery-arrow {
  position: absolute;
  z-index: 7;
  top: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  color: white;
  background: rgba(10,18,26,.62);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
  transition: transform .2s ease, background .2s ease;
}

.gallery-arrow:hover { transform: translateY(-50%) scale(1.06); background: rgba(10,18,26,.85); }
.gallery-arrow--prev { left: 18px; }
.gallery-arrow--next { right: 18px; }

.product-gallery__caption {
  position: absolute;
  z-index: 6;
  left: 18px;
  right: 18px;
  bottom: 18px;
  max-width: min(620px, calc(100% - 36px));
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 16px;
  color: white;
  background: rgba(10,18,26,.72);
  backdrop-filter: blur(15px);
  pointer-events: none;
}

.product-gallery__caption strong { display: block; font-size: .94rem; }
.product-gallery__caption span {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.7);
  font-size: .75rem;
}

.product-gallery__stage.is-technical .product-gallery__caption {
  color: #0a121a;
  background: rgba(255,255,255,.92);
  border-color: rgba(54,95,130,.14);
}
.product-gallery__stage.is-technical .product-gallery__caption span { color: #6d7882; }

.product-gallery__thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(122px, 156px);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(54,95,130,.35) transparent;
}

.product-gallery__thumb {
  scroll-snap-align: start;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  text-align: left;
}

.product-gallery__thumb-image {
  display: block;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(12,28,41,.12);
  border-radius: 14px;
  background: #e5ebee;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.product-gallery__thumb:hover .product-gallery__thumb-image,
.product-gallery__thumb.is-active .product-gallery__thumb-image {
  border-color: #365f82;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(6,18,29,.11);
}

.product-gallery__thumb-image .product-image { border-radius: 13px; }
.product-gallery__thumb.is-technical .product-image { object-fit: contain; padding: 8px; background: #fbfbf8; }
.product-gallery__thumb-type {
  display: block;
  margin-top: 7px;
  color: #6d7882;
  font-size: .65rem;
  font-weight: 760;
}

.media-lightbox {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 18px;
  color: white;
  background: rgba(4,9,14,.96);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.media-lightbox.is-open { opacity: 1; pointer-events: auto; }

.media-lightbox__bar,
.media-lightbox__footer {
  position: relative;
  z-index: 3;
  width: min(1500px, 100%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.media-lightbox__bar { padding: 0 0 14px; }
.media-lightbox__bar > div { display: flex; align-items: center; gap: 14px; }
.media-lightbox__bar strong { font-size: .94rem; }

.media-lightbox__close {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: white;
  background: rgba(255,255,255,.07);
  font-size: 1.5rem;
}

.media-lightbox__viewport {
  position: relative;
  width: min(1500px, calc(100% - 90px));
  height: 100%;
  min-height: 0;
  margin-inline: auto;
  border-radius: 20px;
  background: #101a22;
}

.media-lightbox__viewport .product-image {
  object-fit: contain;
  padding: 0;
  background: #101a22;
  border-radius: 18px;
}

.media-lightbox__viewport.is-technical .product-image {
  padding: clamp(20px, 4vw, 60px);
  background-color: #fbfbf8;
}

.media-lightbox__arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: white;
  background: rgba(255,255,255,.08);
  transform: translateY(-50%);
}
.media-lightbox__arrow--prev { left: 18px; }
.media-lightbox__arrow--next { right: 18px; }

.media-lightbox__footer {
  padding-top: 14px;
  color: rgba(255,255,255,.62);
  font-size: .76rem;
}

.media-load-error {
  padding: 28px;
  border: 1px solid rgba(232,93,63,.24);
  border-radius: 18px;
  color: #7e3527;
  background: rgba(232,93,63,.08);
}

.modal-visual#quick-media {
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.system-stage--embedded {
  min-height: 520px;
  margin-top: 22px;
}

@keyframes media-shimmer {
  from { background-position: 160% 0; }
  to { background-position: -80% 0; }
}

@media (max-width: 1080px) {
  .product-gallery__stage { min-height: 0; }
}

@media (max-width: 720px) {
  .product-gallery__stage {
    aspect-ratio: 4 / 3;
    border-radius: 22px;
  }
  .product-gallery__caption {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px 13px;
  }
  .product-gallery__caption span {
    max-height: 2.8em;
    overflow: hidden;
  }
  .gallery-arrow {
    top: auto;
    bottom: 94px;
    width: 42px;
    height: 42px;
    transform: none;
  }
  .gallery-arrow:hover { transform: scale(1.04); }
  .gallery-arrow--prev { left: 12px; }
  .gallery-arrow--next { right: 12px; }
  .product-gallery__topline { top: 12px; left: 12px; right: 12px; }
  .media-lightbox { padding: 12px; }
  .media-lightbox__viewport { width: 100%; }
  .media-lightbox__arrow {
    top: auto;
    bottom: 64px;
    width: 46px;
    height: 46px;
    transform: none;
  }
  .media-lightbox__arrow--prev { left: 14px; }
  .media-lightbox__arrow--next { right: 14px; }
  .media-lightbox__footer { padding: 10px 4px 0; }
  .media-lightbox__footer span:first-child {
    max-width: 78%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .system-stage--embedded { min-height: 430px; }
}

@media (prefers-reduced-motion: reduce) {
  .product-image,
  .product-gallery__thumb-image,
  .media-lightbox { transition: none !important; }
  .product-image-shell::before,
  .gallery-media-shell::before,
  .lightbox-media-shell::before { animation: none; }
}
