/* ==========================================================================
   MyDezain – Fiche produit : carousel des couleurs + vue 360°
   ========================================================================== */

.mdz-pm-hidden {
  display: none !important;
}

/* Carousel des couleurs ---------------------------------------------------- */
.mdz-pm-colors {
  --pm-accent: var(--mydezain-accent, #6d28d9);
  --pm-border: var(--mydezain-border, #e5e7eb);
  margin-top: 1rem;
  clear: both;
}

.mdz-pm-colors__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

.mdz-pm-colors__title {
  color: #6b7280;
}

.mdz-pm-colors__name {
  color: #111827;
  font-weight: 600;
}

.mdz-pm-colors__viewport {
  position: relative;
}

.mdz-pm-colors__track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 4px 2px 6px;
}

.mdz-pm-colors__track::-webkit-scrollbar {
  display: none;
}

.mdz-pm-color {
  flex: 0 0 auto;
  width: 84px;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
  scroll-snap-align: start;
  text-align: center;
  color: inherit;
  font: inherit;
}

.mdz-pm-color__pic {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 14px;
  background: #f3f4f6;
  box-shadow: 0 0 0 1px var(--pm-border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mdz-pm-color__pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pastille de la teinte, en bas à droite de la miniature. */
.mdz-pm-color__dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, 0.25);
}

.mdz-pm-color__name {
  display: block;
  margin-top: 0.35rem;
  overflow: hidden;
  font-size: 0.78rem;
  color: #4b5563;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mdz-pm-color:hover .mdz-pm-color__pic {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px #c4b5fd, 0 6px 14px rgba(17, 24, 39, 0.08);
}

.mdz-pm-color.is-selected .mdz-pm-color__pic {
  box-shadow: 0 0 0 2px var(--pm-accent), 0 6px 16px rgba(109, 40, 217, 0.18);
}

.mdz-pm-color.is-selected .mdz-pm-color__name {
  color: var(--pm-accent);
  font-weight: 600;
}

.mdz-pm-color:focus-visible {
  outline: none;
}

.mdz-pm-color:focus-visible .mdz-pm-color__pic {
  box-shadow: 0 0 0 3px var(--pm-accent);
}

/* Flèches (ordinateur) */
.mdz-pm-colors__arrow {
  position: absolute;
  top: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
  cursor: pointer;
  color: #111827;
}

.mdz-pm-colors__arrow[hidden] {
  display: none;
}

.mdz-pm-colors__arrow.is-prev {
  left: -10px;
}

.mdz-pm-colors__arrow.is-next {
  right: -10px;
}

.mdz-pm-colors__arrow svg,
.mdz-pm-spin-open svg,
.mdz-pm-spin__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: none) {
  .mdz-pm-colors__arrow {
    display: none;
  }
}

@media (max-width: 600px) {
  .mdz-pm-color,
  .mdz-pm-color__pic {
    width: 72px;
  }

  .mdz-pm-color__pic {
    height: 72px;
  }
}

/* Flèches couleur précédente / suivante sur la photo principale */
.mdz-pm-main-arrow {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--mydezain-border, #e5e7eb);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.14);
  color: #111827;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.mdz-pm-main-arrow:hover {
  color: var(--mydezain-accent, #6d28d9);
  transform: scale(1.06);
}

.mdz-pm-main-arrow.is-prev {
  left: 10px;
}

.mdz-pm-main-arrow.is-next {
  right: 10px;
}

.mdz-pm-main-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Vue 3D (mugs) ------------------------------------------------------------- */
.mdz-3d-open {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--mydezain-accent, #6d28d9);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.mdz-3d-open svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.mdz-3d-open:hover {
  filter: brightness(1.08);
}

/* La loupe de la galerie WooCommerce passe sous le bouton 3D. */
.woocommerce-product-gallery:has(.mdz-3d-open) .woocommerce-product-gallery__trigger {
  top: 56px !important;
}

.mdz-3d__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f1f2f6 70%);
  border-radius: 14px;
  cursor: grab;
  touch-action: none;
}

.mdz-3d__stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.mdz-3d__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mdz-3d__chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.mdz-3d__chip.is-on .mdz-3d__chip-dot {
  box-shadow: 0 0 0 2px #fff;
}

.mdz-3d__status {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Vue 360° ------------------------------------------------------------------ */
.woocommerce-product-gallery {
  position: relative;
}

.mdz-pm-spin-open {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--mydezain-border, #e5e7eb);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12);
  color: #111827;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.mdz-pm-spin-open:hover {
  color: var(--mydezain-accent, #6d28d9);
}

.mdz-pm-noscroll {
  overflow: hidden;
}

.mdz-pm-spin {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.72);
  animation: mdz-pm-fade 0.2s ease;
}

@keyframes mdz-pm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mdz-pm-spin__panel {
  position: relative;
  width: min(720px, 100%);
  padding: 16px 16px 12px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.mdz-pm-spin__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #f3f4f6;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #111827;
}

.mdz-pm-spin__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 72vh;
  margin: 0 auto;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.mdz-pm-spin__stage:active {
  cursor: grabbing;
}

.mdz-pm-spin__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.mdz-pm-spin__stage img.is-on {
  opacity: 1;
}

.mdz-pm-spin__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.mdz-pm-spin__dot {
  padding: 5px 12px;
  background: #f3f4f6;
  border: 0;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #4b5563;
  cursor: pointer;
}

.mdz-pm-spin__dot.is-on {
  background: var(--mydezain-accent, #6d28d9);
  color: #fff;
}

.mdz-pm-spin__hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
}
