/* VIFLUX Product Page - Mobile Optimized */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #6366f1;
  --primary-hover: #5855eb;
  --secondary-color: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --background: #ffffff;
  --surface: rgba(255, 255, 255, 0.8);
  --border: rgba(226, 232, 240, 0.8);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Hero Section */
.product-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
  padding: 2rem 0 3rem;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

.product-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%236366f1" fill-opacity="0.03"><circle cx="30" cy="30" r="1"/></g></svg>')
    repeat;
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.breadcrumb-link {
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.breadcrumb-link:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-hover);
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-weight: 300;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  word-wrap: break-word;
  hyphens: auto;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.meta-label {
  font-weight: 500;
  color: var(--text-primary);
}

.meta-value {
  font-weight: 400;
}

.category-badge {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main Container */
.product-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .product-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem 3rem;
  }
}

/* Desktop specific sizing to match original layout */
@media (min-width: 769px) {
  .product-container {
    max-width: 1200px;
    grid-template-columns: minmax(400px, 750px) minmax(300px, 400px);
    gap: 2rem;
    justify-content: center;
    align-items: start;
  }

  .info-section {
    height: fit-content;
    max-height: 600px; /* Match viewer height */
    overflow: hidden;
    position: sticky;
    top: 2rem;
  }

  .info-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .section-card .description-content {
    
    overflow: hidden;
    position: relative;
  }

  .section-card .description-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, var(--surface));
    pointer-events: none;
  }

  .section-card .description-content p {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 1200px) {
  .product-container {
    max-width: 1200px;
    grid-template-columns: 750px 350px;
    gap: 2.5rem;
    justify-content: center;
  }
}

/* 3D Viewer Section */
.viewer-section {
  position: sticky;
  top: 2rem;
  width: 100%;
  max-width: 100%;
}

.viewer-container {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100%;
  position: relative;
}

.viewer-container:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.viewer-content {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 400px;
  background: transparent;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

/* Desktop specific viewer sizing */
@media (min-width: 769px) {
  .viewer-content {
    max-width: 800px;
    max-height: 600px;
    min-height: 400px;
    aspect-ratio: 4 / 3;
  }

  .viewer-container {
    max-width: 800px;
  }
}

/* Large desktop screens */
@media (min-width: 1200px) {
  .viewer-content {
    max-width: 750px;
    max-height: 563px;
  }

  .viewer-container {
    max-width: 750px;
  }
}

/* Loading States */
.loading-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.loading-spinner {
  position: relative;
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: var(--primary-hover);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* 3D Canvas */
.render-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
  background: transparent;
  outline: none;
  cursor: grab;
  touch-action: pan-x pan-y pinch-zoom;
}

.render-canvas:active {
  cursor: grabbing;
}

.model-viewer-wrapper {
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.model-viewer-wrapper model-viewer {
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: transparent;
}

/* Dark Controls - Optimized for Mobile */
.viewer-controls-dark {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 100;
  transition: all 0.3s ease;
  max-width: calc(100% - 2rem);
}

/* Desktop specific controls */
@media (min-width: 769px) {
  .viewer-controls-dark {
    bottom: 1rem;
    right: 1rem;
    left: auto;
    transform: none;
    flex-direction: column;
    background: transparent;
    padding: 0;
    border-radius: 0;
    max-width: 300px;
  }

  .control-btn-dark {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    justify-content: flex-start;
    text-decoration: none;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
  }

  .control-btn-dark:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateX(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
  }

  .control-label {
    display: inline;
  }

  .toggle-btn-dark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    align-self: flex-end;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: static;
    transform: none;
  }
}

/* Fix for mobile scroll interaction */
.render-canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
  background: transparent;
  outline: none;
  cursor: grab;
  touch-action: pan-x pan-y pinch-zoom;
}

@media (max-width: 768px) {
  .render-canvas {
    touch-action: manipulation;
  }

  /* Ensure canvas maintains touch events after scroll */
  .viewer-content {
    position: relative;
    isolation: isolate;
  }

  .viewer-content canvas {
    position: relative;
    z-index: 1;
  }
}

.viewer-controls-dark.hidden .control-btn-dark:not(.toggle-btn-dark) {
  opacity: 0;
  transform: translateX(100px);
  pointer-events: none;
}

.control-btn-dark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 0.75rem 1rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 50px;
  justify-content: flex-start;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}

.control-btn-dark:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateX(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  color: white;
  text-decoration: none;
}

.control-btn-dark i {
  font-size: 1rem;
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.control-label {
  white-space: nowrap;
  transition: all 0.3s ease;
}

.toggle-btn-dark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  align-self: flex-end;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.toggle-btn-dark:hover {
  background: rgba(0, 0, 0, 1);
  border-color: rgba(255, 255, 255, 0.3);
}

.ar-btn-dark {
  background: rgba(0, 0, 0, 0.8);
}

.ar-btn-dark:hover {
  background: rgba(0, 0, 0, 0.9);
}

.fullscreen-btn-dark {
  background: rgba(0, 0, 0, 0.8);
}

.fullscreen-btn-dark:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Fullscreen Exit Button */
.fullscreen-exit-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease;
  display: none;
}

.fullscreen-exit-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Info Section */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.info-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

/* Profile Cards */
.profiles-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

.profile-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s ease;
  word-wrap: break-word;
}

.profile-name:hover {
  color: var(--primary-color);
}

.profile-role {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Section Cards */
.section-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 350px;
}

.section-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-title i {
  color: var(--primary-color);
  font-size: 1rem;
}

.description-content {
  color: var(--text-secondary);
  line-height: 1.7;
  word-wrap: break-word;
}

.no-description {
  font-style: italic;
  color: var(--text-muted);
}

/* Tags */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.tag-badge {
  background: var(--secondary-color);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  word-wrap: break-word;
}

.tag-badge:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

/* Actions */
.actions-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  box-sizing: border-box;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
}

.primary-btn:hover {
  background: linear-gradient(135deg, var(--primary-hover), #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.secondary-btn {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
}

.secondary-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Related Models */
.related-section {
  max-width: 1200px;
  margin: 4rem auto 0;
  padding: 0 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

/* CTA Section - Keep full width as requested */
.cta-section {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  margin: 4rem auto 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

.cta-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.related-container {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.related-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

.related-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.related-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--secondary-color);
  width: 100%;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card:hover .related-image img {
  transform: scale(1.05);
}

.related-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.related-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  font-size: 1.5rem;
}

.related-card:hover .related-overlay {
  opacity: 1;
}

.related-info {
  padding: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.related-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-creator {
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  margin: 4rem auto 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}

.cta-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="1"/></g></svg>')
    repeat;
  pointer-events: none;
}

.cta-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
}

.cta-content {
  text-align: center;
  color: white;
  width: 100%;
  max-width: 100%;
}

.cta-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
  word-wrap: break-word;
}

.cta-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  word-wrap: break-word;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

.cta-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 1rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.cta-btn.primary {
  background: white;
  color: var(--primary-color);
}

.cta-btn.primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cta-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--background);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: var(--secondary-color);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--primary-color);
  color: white;
}

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.modal-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  word-wrap: break-word;
}

.modal-body {
  text-align: left;
  width: 100%;
  max-width: 100%;
}

/* Share Options */
.share-options {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.share-option {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.02);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.share-option label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-option label::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.input-group input,
.input-group textarea {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: "Inter", monospace;
  background: var(--background);
  color: var(--text-primary);
  resize: none;
  transition: all 0.2s ease;
  line-height: 1.4;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: rgba(99, 102, 241, 0.02);
}

.input-group textarea {
  min-height: 80px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.8rem;
  white-space: pre;
  overflow-wrap: break-word;
}

.copy-btn {
  padding: 0.875rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.copy-btn:active {
  transform: translateY(0);
}

/* QR Code */
.qr-container {
  background: var(--secondary-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.qr-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 100%;
}

.qr-instructions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.instruction-item i {
  color: var(--primary-color);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* AR Loading */
.ar-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ar-loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ar-loading-content {
  text-align: center;
  color: white;
  padding: 2rem;
  max-width: 90%;
  box-sizing: border-box;
}

.ar-loading-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.ar-loading-spinner .spinner-ring {
  border-top-color: white;
}

.ar-loading-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

.ar-loading-text {
  opacity: 0.8;
  font-size: 1rem;
  word-wrap: break-word;
}

/* Fallback */
.fallback-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 15;
  padding: 2rem;
  box-sizing: border-box;
}

.fallback-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

.fallback-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 2rem;
}

.fallback-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.fallback-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  word-wrap: break-word;
}

.fallback-image {
  max-width: 200px;
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.fallback-retry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 auto;
}

.fallback-retry:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Error Container */
.error-container {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.error-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

.error-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 2rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  word-wrap: break-word;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .product-hero {
    padding: 1rem 0 2rem;
    margin-top: 70px;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .breadcrumb {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    justify-content: center;
  }

  .hero-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    text-align: center;
  }

  .hero-meta {
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
  }

  .product-container {
    padding: 0 1rem 2rem;
    gap: 1.5rem;
  }

  .viewer-section {
    position: static;
  }

  .viewer-content {
    aspect-ratio: 16 / 10;
    min-height: 300px;
    max-height: 60vh;
  }

  .viewer-controls-dark {
    bottom: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 0.75rem;
    border-radius: 25px;
    max-width: calc(100vw - 2rem);
    justify-content: center;
  }

  .viewer-controls-dark.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
  }

  .control-btn-dark {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
  }

  .control-btn-dark:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
    box-shadow: none;
  }

  .control-label {
    display: none;
  }

  .toggle-btn-dark {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    left: auto;
    transform: none;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .profiles-section {
    gap: 0.75rem;
  }

  .profile-card {
    padding: 1rem;
  }

  .profile-avatar {
    width: 40px;
    height: 40px;
  }

  .section-card {
    padding: 1rem;
  }

  .section-title {
    font-size: 1rem;
  }

  .actions-section {
    flex-direction: column;
  }

  .action-btn {
    justify-content: center;
    width: 100%;
  }

  .related-section {
    padding: 0 1rem;
    margin-top: 2rem;
  }

  .related-container {
    padding: 1.5rem;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .cta-container {
    padding: 2rem 1rem;
  }

  .cta-actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
    max-width: calc(100vw - 2rem);
  }

  .input-group {
    flex-direction: column;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }

  /* Fix scroll interaction */
  .viewer-section {
    position: static;
    touch-action: auto;
  }

  .viewer-container {
    touch-action: auto;
  }

  .render-canvas {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
}

@media (max-width: 480px) {
  .product-hero {
    padding: 0.75rem 0 1.5rem;
    margin-top: 60px;
  }

  .hero-content {
    padding: 0 0.75rem;
  }

  .hero-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  .product-container {
    padding: 0 0.75rem 1.5rem;
  }

  .viewer-content {
    min-height: 250px;
    max-height: 50vh;
  }

  .viewer-controls-dark {
    bottom: 0.75rem;
    padding: 0.375rem 0.5rem;
    gap: 0.375rem;
    max-width: calc(100vw - 1.5rem);
  }

  .control-btn-dark {
    padding: 0.375rem 0.5rem;
    font-size: 0.625rem;
  }

  .control-btn-dark i {
    font-size: 0.75rem;
  }

  .toggle-btn-dark {
    bottom: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
  }

  .profile-card {
    padding: 0.75rem;
  }

  .profile-avatar {
    width: 36px;
    height: 36px;
  }

  .section-card {
    padding: 0.75rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 0.5rem;
    padding: 1rem;
  }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .viewer-content {
    height: 70vh;
    min-height: 300px;
  }

  .product-container {
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .control-btn-dark,
  .action-btn,
  .cta-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .toggle-btn-dark {
    min-width: 44px;
    min-height: 44px;
  }

  .related-card {
    transition: none;
  }

  .related-card:active {
    transform: scale(0.98);
  }
}

/* Prevent horizontal scroll */
.viewer-section,
.info-section,
.related-section,
.cta-section {
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure all containers respect viewport width */
.product-hero,
.product-container,
.related-section,
.cta-section {
  max-width: 100vw;
  overflow-x: hidden;
}

.loading-percentage {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Update related models grid to 6 columns */
.related-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1200px) {
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* Adjust related card sizing for smaller grid items */
.related-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.related-info {
  padding: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.related-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-creator {
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
