/* ===================================
   MUG VIEWER — Mobile-first styles
   Default: mobile portrait (0 – 767px)
   See docs/mug-viewer-swipe-specification.md Section 5
   =================================== */

.mug-viewer-body {
  background: #000;
  color: #fff;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Top Bar --- */
.mug-viewer-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 44px;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.back-link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
}

.mug-counter {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.header-download-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Canvas Viewport --- */
.mug-viewport {
  width: 100%;
  touch-action: pan-y pinch-zoom;
  position: relative;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.mug-viewport canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Carousel (3-canvas sliding strip) --- */
.carousel-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}

.carousel-strip {
  display: flex;
  width: 300%;
  will-change: transform;
  transform: translateX(-33.333%);
}

.carousel-slide {
  width: 33.333%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Swipe Hint --- */
.swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.swipe-hint.hidden {
  opacity: 0;
}

/* --- Loading Spinner --- */
.mug-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

/* --- Mug Name --- */
.mug-name {
  text-align: center;
  font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 16px 8px;
  margin: 0;
}

/* --- Dot Navigation --- */
.mug-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  gap: 8px;
}

.dot-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.dot-indicators::-webkit-scrollbar { display: none; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.dot.active {
  background: #39FF14;
}

.nav-arrow {
  display: none; /* Hidden on mobile */
}

/* --- Download Button --- */
.download-btn-large {
  display: block;
  width: calc(100% - 32px);
  margin: 12px 16px;
  padding: 14px;
  font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  min-height: 48px;
  background: #39FF14;
  color: #1C1C1C;
  border: none;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s;
}
.download-btn-large:hover {
  background: #2DD10D;
}
.download-btn-large:active {
  transform: scale(0.98);
}

/* --- Disabled "Buy This Mug" with COMING SOON diagonal banner --- */
.buy-mug-disabled {
  position: relative;
  overflow: hidden;
  background: #888 !important;
  color: #ddd !important;
  cursor: not-allowed !important;
}
.buy-mug-disabled:hover,
.buy-mug-disabled:active {
  background: #888 !important;
  transform: none !important;
}
.buy-mug-disabled::after {
  content: "COMING SOON";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-10%, -50%) rotate(-12deg);
  background: rgba(220, 38, 38, 0.5);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.15em;
  padding: 3px 50px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  pointer-events: none;
  white-space: nowrap;
}

/* --- Tag Picker --- */
.tag-picker-toggle {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  min-height: 44px;
  background: rgba(30, 30, 30, 0.95);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  box-sizing: border-box;
}
.tag-picker-toggle:hover {
  background: rgba(50, 50, 50, 0.95);
}

.tag-picker-arrow {
  transition: transform 0.3s;
  font-size: 10px;
}
.tag-picker-arrow.open {
  transform: rotate(180deg);
}

.tag-picker-strip {
  position: fixed;
  bottom: 44px;
  left: 0;
  width: 100%;
  z-index: 9998;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: visibility 0.25s, opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.tag-picker-strip.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.tag-picker-strip::-webkit-scrollbar { display: none; }

.tag-picker-close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  z-index: 1;
}
.tag-picker-close:hover {
  color: #fff;
}

.tag-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 2px solid transparent;
  object-fit: cover;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s, transform 0.15s;
}
.tag-thumb:active {
  transform: scale(0.95);
}
.tag-thumb.active {
  border-color: #39FF14;
}

.tag-thumb-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}

.tag-thumb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

/* --- Empty State --- */
.mug-empty-state {
  text-align: center;
  padding: 60px 20px;
}
.mug-empty-state p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 24px 0;
  font-size: 16px;
}
.mug-empty-state a {
  display: inline-block;
  padding: 14px 32px;
  background: #39FF14;
  color: #1C1C1C;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ===================================
   TABLET+ (768px)
   =================================== */
@media (min-width: 768px) {
  .mug-viewer-header {
    height: 48px;
    padding: 0 24px;
  }

  .nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
  }
  .nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .nav-arrow:disabled {
    opacity: 0.3;
    cursor: default;
  }

  .mug-name {
    font-size: 24px;
  }

  .download-btn-large {
    width: auto;
    min-width: 200px;
    margin: 12px auto;
  }

  .mug-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 24px;
  }

  .mug-info-bar .mug-name {
    padding: 0;
  }

  .mug-info-bar .download-btn-large {
    margin: 0;
  }
}

/* ===================================
   DESKTOP (1024px+)
   =================================== */
@media (min-width: 1024px) {
  .mug-viewport {
    max-width: 960px;
    margin: 0 auto;
  }

  .mug-name {
    font-size: 28px;
  }
}

/* ===================================
   REDUCED MOTION
   =================================== */
@media (prefers-reduced-motion: reduce) {
  .mug-viewport,
  .tag-picker-strip,
  .tag-picker-arrow,
  .swipe-hint,
  .download-btn-large {
    transition: none !important;
  }
}
