/* ==========================================================================
   3D Model Carousel (Coverflow)
   ========================================================================== */

.carousel-section {
  position: relative;
  padding: 6rem 0;
  background: var(--bg-tinted);
  overflow: hidden;
  border-top: var(--glass-border);
  border-bottom: var(--glass-border);
}


.carousel-section .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.carousel-section .section-subtitle {
  margin: 0 auto;
}

/* Carousel container */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#carousel {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.carousel-model {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  margin-top: -160px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--shadow-color);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.55s ease,
              border-color 0.55s ease;
  cursor: pointer;
  --poster-color: var(--bg-card);
}

/* Soft glow on the active model */
.carousel-model.is-active {
  border-color: rgba(var(--accent-primary-rgb), 0.25);
  box-shadow:
    0 0 30px rgba(var(--accent-primary-rgb), 0.08),
    0 8px 32px var(--shadow-color);
}

.carousel-model::part(poster) {
  background-color: var(--bg-card);
  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center;
}

/* Nav buttons */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.carousel-nav-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.1);
  transform: translateY(-50%) scale(1.06);
}

.carousel-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.carousel-nav-btn svg {
  width: 20px;
  height: 20px;
}

.carousel-nav-btn.prev { left: 1rem; }
.carousel-nav-btn.next { right: 1rem; }

/* ---- Progress indicator (replaces dots) ---- */
.carousel-progress {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 100;
  user-select: none;
}

.progress-counter {
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 1.2em;
  text-align: center;
}

.progress-counter.is-current {
  color: var(--accent-primary);
}

.progress-track {
  position: relative;
  width: 100px;
  height: 2px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Clickable hit-areas on the track */
.progress-seg {
  position: absolute;
  top: -6px;
  bottom: -6px;
  cursor: pointer;
  z-index: 1;
}

/* Info panel (sits below carousel) */
.carousel-info {
  max-width: 700px;
  margin: 3.5rem auto 0;
  text-align: center;
}

#model-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#model-title a {
  color: inherit;
  text-decoration: none;
}

#model-title a:hover {
  color: var(--accent-primary);
}

#model-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

/* Staggered reveal for detail items */
.detail-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(6px);
  animation: detail-in 0.35s ease forwards;
}

.detail-item:nth-child(1) { animation-delay: 0.04s; }
.detail-item:nth-child(2) { animation-delay: 0.1s;  }
.detail-item:nth-child(3) { animation-delay: 0.16s; }
.detail-item:nth-child(4) { animation-delay: 0.22s; }

@keyframes detail-in {
  to { opacity: 1; transform: translateY(0); }
}

.detail-label {
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.detail-value {
  color: var(--text-primary);
}

.carousel-info .btn-primary {
  font-size: 0.9rem;
  padding: 0.7rem 1.6rem;
}
