/* ==========================================================================
   MODÈLES 3D & PROPS (GALLERY & IMMERSIVE LIGHTBOX)
   ========================================================================== */

/* Barre d'outils et recherche */
.models-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.models-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  width: 100%;
  max-width: 420px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.models-search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.models-search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.models-search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.models-search-box input::placeholder {
  color: var(--text-dim);
}

.models-count-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

/* Grille de modèles 3D */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* Carte de modèle 3D */
.model-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.model-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.model-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  background: #111319;
  display: block;
}

.model-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.model-card:hover .model-thumb-img {
  transform: scale(1.06);
}

.model-zoom-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(9, 10, 13, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--transition), transform var(--transition);
}

.model-card:hover .model-zoom-overlay {
  opacity: 1;
  transform: scale(1);
}

.model-card-info {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.model-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: #1a1e2b;
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

/* ==========================================================================
   VISIONNEUSE LIGHTBOX IMMERSIVE (FORMAT 1:1 PARFAIT SANS BANDES NOIRES)
   ========================================================================== */
.model-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.model-lightbox-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.lightbox-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
  gap: 16px;
}

/* Barre d'en-tête de la visionneuse */
.lightbox-topbar {
  width: 100%;
  max-width: min(72vh, 72vw, 720px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.lightbox-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background-color: #1b202d;
  border: 1px solid var(--border-medium);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.lightbox-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.lightbox-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
}

.lightbox-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-white);
}

.lightbox-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text-white);
  transform: scale(1.05);
}

/* Scène centrale (Flèche - Image - Flèche) */
.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

/* Cadre photo carré 1:1 qui épouse exactement les dimensions de l'image */
.lightbox-image-container {
  width: min(70vh, 70vw, 700px);
  height: min(70vh, 70vw, 700px);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 65px -10px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #232738 0%, #0d0f16 100%);
  position: relative;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  transition: opacity 0.18s ease;
  user-select: none;
}

.lightbox-img.loading {
  opacity: 0.4;
}

/* Flèches de navigation circulaires en verre poli */
.lightbox-arrow-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.lightbox-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.08);
}

.lightbox-arrow-btn:active {
  transform: scale(0.95);
}

/* Indication en bas */
.lightbox-footer-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.lightbox-footer-hint strong {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
  .lightbox-stage {
    gap: 12px;
  }

  .lightbox-arrow-btn {
    width: 44px;
    height: 44px;
  }

  .lightbox-image-container {
    width: min(65vh, 65vw, 550px);
    height: min(65vh, 65vw, 550px);
  }
}

@media (max-width: 600px) {
  .lightbox-topbar {
    max-width: 100%;
  }

  .lightbox-stage {
    position: relative;
    width: 100%;
  }

  .lightbox-image-container {
    width: 90vw;
    height: 90vw;
  }

  .lightbox-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    background: rgba(9, 10, 13, 0.75);
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}
