/* ===== ZOOM MODAL STYLES - MODERN DESIGN ===== */
.zoom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeInZoom 0.3s ease;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
}

.zoom-modal.active {
  display: flex;
}

@keyframes fadeInZoom {
  from { opacity: 0; }
  to { opacity: 1; }
}

.zoom-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: zoomInImage 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
  margin: auto 0;
}

.zoom-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s ease;
}

@keyframes zoomInImage {
  from { 
    transform: scale(0.5); 
    opacity: 0; 
  }
  to { 
    transform: scale(1); 
    opacity: 1; 
  }
}

.zoom-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: white;
  color: #212529;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2rem;
  font-weight: bold;
  transition: all 0.3s ease;
  z-index: 10001;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.zoom-modal-close:hover {
  background: #00B56A;
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 181, 106, 0.4);
}

.zoom-modal-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  z-index: 10001;
}

.zoom-modal-controls button {
  background: white;
  color: #212529;
  border: none;
  border-radius: 25px;
  padding: 12px 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.zoom-modal-controls button:hover {
  background: #00B56A;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 181, 106, 0.4);
}

.zoom-modal-controls button:active {
  transform: translateY(-1px);
}

.zoom-modal-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zoom-modal-controls button:disabled:hover {
  background: white;
  color: #212529;
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.zoom-modal-info {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-align: center;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.zoom-modal-info span {
  font-size: 1.1rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#zoomModalCounter {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Zoom Button on Examples - ULTRA SIMPLE */
.example-zoom-btn {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  background: #00B56A !important;
  border: none !important;
  width: 45px !important;
  height: 45px !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  font-size: 1.5rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  z-index: 5 !important;
  opacity: 1 !important;
  display: block !important;
  pointer-events: auto !important;
  color: white !important;
  line-height: 45px !important;
  text-align: center !important;
}

.example-zoom-btn:hover {
  background: #008C54 !important;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 16px rgba(0, 181, 106, 0.6) !important;
}

.example-zoom-btn:active {
  transform: scale(0.95) !important;
}

.example-item {
  position: relative;
}

/* Responsive adjustments for zoom modal */
@media (max-width: 768px) {
  .zoom-modal-content {
    max-width: 95%;
    max-height: 80vh;
  }
  
  .zoom-modal-content img {
    max-height: 80vh;
  }
  
  .zoom-modal-controls {
    bottom: 20px;
    gap: 0.5rem;
  }
  
  .zoom-modal-controls button {
    padding: 10px 20px;
    font-size: 0.85rem;
  }
  
  .zoom-modal-close {
    width: 45px;
    height: 45px;
    top: 15px;
    right: 15px;
    font-size: 1.8rem;
  }
  
  .zoom-modal-info {
    top: 20px;
  }
  
  .zoom-modal-info span {
    font-size: 0.95rem;
  }
  
  .example-zoom-btn {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 3D MOCKUP IN ZOOM MODAL ===== */
#zoomModal3D {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  /* Extra bottom padding so 3D controls don't overlap content */
  padding: 2rem 1rem 7rem;
  box-sizing: border-box;
  overflow: visible;
  min-height: 0;
}

#zoomMockupContainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  flex: 0 1 auto;
  overflow: visible;
  box-sizing: border-box;
  /* Safety margin below the indicator */
  margin-bottom: 0.5rem;
}

.zoom-3d-badge {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.zoom-3d-badge svg {
  width: 24px;
  height: 24px;
}

.zoom-flyer-container {
  perspective: 1500px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
}

.zoom-flyer-container.zoom-cards {
  width: 324px;
  height: 180px;
  min-width: 324px;
  min-height: 180px;
  max-width: 100%;
}

.zoom-flyer-container.zoom-flyers {
  width: 280px;
  height: 365px;
  min-width: 280px;
  min-height: 365px;
  max-width: 100%;
}

.zoom-flyer-container.zoom-magnets {
  /* Landscape aspect for car magnets (4:3) */
  width: 600px;
  aspect-ratio: 4 / 3;
  height: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
}

.zoom-flyer-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: grab;
}

.zoom-flyer-3d:active {
  cursor: grabbing;
}

.zoom-flyer-3d .flyer-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}

.zoom-flyer-3d .flyer-front {
  background: linear-gradient(135deg, var(--primary, #00B56A), var(--primary-dark, #00724B));
  transform: translateZ(1px);
}

.zoom-flyer-3d .flyer-back {
  background: linear-gradient(135deg, var(--primary-light, #33FF99), var(--primary, #00B56A));
  transform: rotateY(180deg) translateZ(1px);
}

.zoom-flyer-3d .magnet-back {
  background: #000000;
  transform: rotateY(180deg) translateZ(1px);
}

.zoom-flyer-3d .flyer-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Correct selector for magnet zoom: use contain to avoid cropping */
.zoom-flyer-container.zoom-magnets .zoom-flyer-3d .flyer-image {
  object-fit: contain !important;
  object-position: center !important;
}

.zoom-flyer-3d .flyer-placeholder {
  display: none !important;
}

.zoom-face-indicator {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  padding: 0.75rem;
  background: rgba(0, 181, 106, 0.9);
  border-radius: 12px;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 181, 106, 0.3);
  margin-bottom: 1.25rem;
}

/* Different controls styling */
.zoom-3d-controls {
  gap: 1.5rem !important;
}

.zoom-3d-controls button {
  min-width: 140px !important;
  font-size: 1rem !important;
}

@media (max-width: 768px) {
  #zoomModal3D {
    max-width: 95vw;
    padding: 1.5rem 0.5rem 6rem;
    gap: 1rem;
  }
  
  #zoomMockupContainer {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    gap: 1rem;
  }
  
  .zoom-flyer-container {
    max-width: 90vw;
  }
  
  .zoom-flyer-container.zoom-cards {
    width: min(270px, 90vw);
    height: min(150px, 50vw);
    min-width: 0;
    min-height: 0;
  }
  
  .zoom-flyer-container.zoom-flyers {
    width: min(230px, 90vw);
    height: min(300px, 117vw);
    min-width: 0;
    min-height: 0;
  }
  
  .zoom-flyer-container.zoom-magnets {
    width: min(520px, 90vw);
    aspect-ratio: 4 / 3;
    height: auto;
    min-width: 0;
    min-height: 0;
  }
  
  .zoom-3d-controls {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.75rem !important;
  }
  
  .zoom-3d-controls button {
    min-width: 90px !important;
    font-size: 0.8rem !important;
    padding: 10px 12px !important;
  }
  
  .zoom-3d-badge {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
  
  .zoom-face-indicator {
    font-size: 0.95rem;
    padding: 0.6rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  #zoomModal3D {
    padding: 1.25rem 0.5rem 5.5rem;
    gap: 0.875rem;
  }
  
  #zoomMockupContainer {
    gap: 0.875rem;
  }
  
  .zoom-flyer-container.zoom-cards {
    width: min(230px, 85vw);
    height: min(128px, 47vw);
  }
  
  .zoom-flyer-container.zoom-flyers {
    width: min(190px, 85vw);
    height: min(248px, 110vw);
  }
  
  .zoom-flyer-container.zoom-magnets {
    width: min(360px, 85vw);
    aspect-ratio: 4 / 3;
    height: auto;
  }
  
  .zoom-face-indicator {
    margin-bottom: 0.625rem;
  }
  
  .zoom-3d-controls {
    flex-wrap: nowrap;
    gap: 0.5rem !important;
  }
  
  .zoom-3d-controls button {
    min-width: 70px !important;
    font-size: 0.75rem !important;
    padding: 8px 10px !important;
    white-space: nowrap;
  }
}
