/* ===== GALERIE ADMIN (update.php) ===== */

.media-gallery-admin {
  margin-top: 32px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.media-gallery-admin h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #2c3e50;
}

.media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  min-height: 40px;
}

.no-media-msg {
  color: #999;
  font-style: italic;
  font-size: 14px;
}

.media-thumb {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #ddd;
  background: #000;
  flex-shrink: 0;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.media-badge.video { background: rgba(52,152,219,0.85); }

.media-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(231,76,60,0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}

.media-thumb:hover .media-delete-btn { opacity: 1; }

/* Zone upload */
.media-upload-zone {
  border: 2px dashed #aaa;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #fff;
}

.media-upload-zone input[type="file"] {
  display: none;
}

.media-upload-label {
  display: inline-block;
  padding: 10px 20px;
  background: #3498db;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.media-upload-label:hover { background: #2980b9; }

.media-upload-hint {
  font-size: 12px;
  color: #888;
  margin: 4px 0 12px;
}

.btn-upload-media {
  padding: 10px 24px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-upload-media:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-upload-media:not(:disabled):hover { background: #219a52; }

.media-upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.preview-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid #3498db;
  background: #000;
}

.preview-thumb img,
.preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#media-upload-status {
  margin-top: 10px;
  font-size: 14px;
}


/* ===== GALERIE PUBLIQUE (product_detail.php) ===== */

.pd-main-visual {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  cursor: zoom-in;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-main-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.pd-main-video {
  width: 100%;
  max-height: 480px;
  display: block;
  cursor: default;
}

/* Miniatures */
.pd-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pd-thumb {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #ddd;
  cursor: pointer;
  position: relative;
  background: #000;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.pd-thumb:hover { border-color: #3498db; }
.pd-thumb.active { border-color: #e74c3c; border-width: 3px; }

.pd-thumb img,
.pd-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pd-thumb-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}

/* Lightbox */
.pd-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  z-index: 10000;
}

.pd-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-lb-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 4px;
  object-fit: contain;
}

.pd-lb-video {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 4px;
}
