/**
 * BTM Badge — cart/checkout « Aperçu 3D » button + preview modal.
 * Uses the theme colour tokens (defined in style.css, loaded site-wide).
 */

/* Small "3D" button overlaid on a custom-badge line-item image. */
.btm3d-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--c-navy, #1c1b2e);
  background: var(--c-white, #fff);
  color: var(--c-navy, #1c1b2e);
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--c-navy, #1c1b2e);
}

.btm3d-btn:hover {
  background: var(--c-mint, #b8edd8);
}

/* Modal */
.btm3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(28, 27, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.btm3d-overlay[hidden] {
  display: none;
}

.btm3d-modal {
  background: var(--c-white, #fff);
  border: 2px solid var(--c-navy, #1c1b2e);
  border-radius: 16px;
  box-shadow: 8px 8px 0 var(--c-navy, #1c1b2e);
  padding: 1.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.btm3d-title {
  margin: 0 0 1rem;
  color: var(--c-navy, #1c1b2e);
  font-size: 1.1rem;
}

.btm3d-stage {
  perspective: 760px;
  width: 280px;
  height: 280px;
  max-width: 70vw;
  max-height: 70vw;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

/* The saved preview is the full gabarit image (badge centred, ~81% of the width).
   153 % background-size zooms so the visible BLUE circle fills the disc — matching
   the editor's 3D preview (which only shows the blue/visible front). */
.btm3d-badge {
  position: relative;
  width: 86%;
  height: 86%;
  border-radius: 50% !important;
  background-size: 153%;
  background-position: center;
  overflow: hidden;
  transition: transform 0.1s ease-out;
  cursor: grab;
  box-shadow:
    0 9px 18px rgba(28, 27, 46, 0.28),
    inset 0 4px 7px rgba(255, 255, 255, 0.5),
    inset 0 -7px 11px rgba(28, 27, 46, 0.3);
}

.btm3d-gloss {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 25%,
    rgba(255, 255, 255, 0.5) 46%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0.5) 54%,
    transparent 75%
  );
  transform: translateX(-150%) skewX(-15deg);
  transition: transform 0.12s ease-out;
}

.btm3d-note {
  font-size: 0.85rem;
  color: var(--c-navy-muted, #3d3b54);
  margin: 0 0 1.1rem;
  line-height: 1.4;
}

.btm3d-close {
  background: var(--c-white, #fff);
  border: 2px solid var(--c-navy, #1c1b2e);
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  font-weight: 700;
  color: var(--c-navy, #1c1b2e);
  cursor: pointer;
}

.btm3d-close:hover {
  background: var(--c-mint-light, #f7fff9);
}
