/* Self-contained styles for the shared media gallery (shared/_media_gallery).
   Neutral values so it renders identically under the Tailwind storefront and
   the campaign.css giveaway pages. Behavior lives in media_gallery_controller.js. */
.media-gallery { display: flex; flex-direction: column; gap: 12px; }

.mg-main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(120, 120, 120, 0.08);
}
.mg-main-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mg-zoom svg { width: 18px; height: 18px; }

.mg-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mg-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(120, 120, 120, 0.08);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease;
}
.mg-thumb:hover,
.mg-thumb--active { border-color: #e85a4b; }
.mg-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}
.mg-lightbox.mg-open { opacity: 1; visibility: visible; }
.mg-lightbox-stage { max-width: 90vw; max-height: 90vh; display: flex; align-items: center; justify-content: center; }
.mg-lightbox-image { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; transition: opacity 0.15s ease; }
.mg-lightbox-image.mg-fade { opacity: 0; }

.mg-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 8px;
  z-index: 2;
}
.mg-lightbox-close:hover { color: #fff; }
.mg-lightbox-close svg { width: 30px; height: 30px; }

.mg-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 8px;
}
.mg-lightbox-nav:hover { color: #fff; }
.mg-lightbox-nav svg { width: 38px; height: 38px; }
.mg-lightbox-prev { left: 12px; }
.mg-lightbox-next { right: 12px; }

body.mg-scroll-lock { overflow: hidden; }
