/* ===================================================
   Product Gallery — Premium Image Viewer
   =================================================== */

/* --- Gallery Container (replaces pd-header__image when multiple) --- */
.pd-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Main Image Viewer --- */
.pd-gallery__main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 500px;
  cursor: zoom-in;
}

.pd-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  max-height: 500px;
  transition: opacity 0.3s ease;
}

.pd-gallery__main img.fade-out {
  opacity: 0;
}

/* --- Image Counter Badge --- */
.pd-gallery__counter {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: var(--fw-semibold);
  pointer-events: none;
  z-index: 2;
}

.pd-gallery__counter svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* --- Navigation Arrows (Main Image) --- */
.pd-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.2s ease;
  opacity: 0;
}

.pd-gallery__main:hover .pd-gallery__nav {
  opacity: 1;
}

.pd-gallery__nav:hover {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%) scale(1.08);
}

.pd-gallery__nav svg {
  width: 18px;
  height: 18px;
  stroke: #1f2937;
  stroke-width: 2.5;
  fill: none;
}

.pd-gallery__nav--prev { left: 0.75rem; }
.pd-gallery__nav--next { right: 0.75rem; }

/* --- Thumbnail Strip --- */
.pd-gallery__thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.25rem 0;
}

.pd-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.pd-gallery__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.pd-gallery__thumb:hover {
  opacity: 0.85;
  border-color: rgba(0, 51, 102, 0.2);
}

.pd-gallery__thumb.active {
  border-color: var(--color-primary);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 51, 102, 0.15);
}

.pd-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* ===================================================
   Lightbox — Fullscreen Image Viewer
   =================================================== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Lightbox Image --- */
.lightbox-overlay__img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay__img-wrap img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}

.lightbox-overlay__img-wrap img.fade-out {
  opacity: 0;
}

/* --- Lightbox Close Button --- */
.lightbox-overlay__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
}

.lightbox-overlay__close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.1);
}

.lightbox-overlay__close svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

/* --- Lightbox Navigation --- */
.lightbox-overlay__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
}

.lightbox-overlay__nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-overlay__nav svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

.lightbox-overlay__nav--prev { left: 1.25rem; }
.lightbox-overlay__nav--next { right: 1.25rem; }

/* --- Lightbox Counter --- */
.lightbox-overlay__counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 10001;
}

/* ===================================================
   Responsive
   =================================================== */

@media (max-width: 768px) {
  .pd-gallery__main {
    min-height: 220px;
    max-height: 350px;
  }

  .pd-gallery__main img {
    max-height: 350px;
  }

  .pd-gallery__nav {
    width: 32px;
    height: 32px;
    opacity: 0.8;
  }

  .pd-gallery__nav svg {
    width: 14px;
    height: 14px;
  }

  .pd-gallery__thumb {
    width: 56px;
    height: 56px;
  }

  .lightbox-overlay__nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-overlay__nav svg {
    width: 18px;
    height: 18px;
  }
}

/* ===================================================
   Admin — Multi-Upload Preview
   =================================================== */

.admin-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: #fafbfc;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.admin-upload-zone:hover,
.admin-upload-zone.dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.04);
}

.admin-upload-zone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
}

.admin-upload-zone__icon svg {
  width: 24px;
  height: 24px;
  stroke: #6366f1;
  stroke-width: 2;
  fill: none;
}

.admin-upload-zone__text {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.admin-upload-zone__hint {
  font-size: 0.75rem;
  color: #9ca3af;
}

.admin-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* --- Preview Grid --- */
.admin-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.admin-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.admin-preview-item__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.admin-preview-item__remove:hover {
  background: #dc2626;
  transform: scale(1.15);
}

.admin-preview-item--existing {
  border-color: #d1d5db;
}

.admin-preview-item__order {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Single Image Preview (ana görsel) --- */
.admin-single-preview {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-single-preview img {
  width: 120px;
  height: 90px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 4px;
}

.admin-single-preview__name {
  font-size: 0.8rem;
  color: #6b7280;
  word-break: break-all;
}
