/* ── Carousel ────────────────────────────────────────────────────────────────── */

.carousel-section {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding-bottom: var(--space-xl);
}

/* Wrapper de défilement */
.carousel-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* Piste du carousel */
.carousel-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Masquer la scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--space-md) var(--space-md) var(--space-sm);
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

/* ── Carte panne ─────────────────────────────────────────────────────────────── */
.panne-card {
  scroll-snap-align: center;
  flex-shrink: 0;
  width: calc(100vw - 2 * var(--space-md));
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  role: listitem;
}

/* Image de la carte */
.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface-2);
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder SVG si pas de photo */
.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 3rem;
}

/* Badge type d'équipement */
.card-type-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Corps de la carte */
.card-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

.card-station {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.card-equipement {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-duration {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-danger);
}

.card-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-xs) 0;
}

.card-detail {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  display: flex;
  gap: var(--space-sm);
}

.card-detail-label {
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}

.card-consequence {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ── Points de navigation ────────────────────────────────────────────────────── */
.carousel-dots {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active,
.carousel-dot[aria-selected="true"] {
  background: var(--color-accent);
  transform: scale(1.4);
}

/* ── Flèches de navigation ───────────────────────────────────────────────────── */
.carousel-arrow {
  display: none;
  position: absolute;
  top: calc(50% - 40px);
  transform: translateY(-50%);
  background: var(--color-surface-2);
  color: var(--color-text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  z-index: 10;
  transition: background 0.2s;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
  background: var(--color-accent);
  color: white;
}

.carousel-arrow--prev {
  left: var(--space-md);
}

.carousel-arrow--next {
  right: var(--space-md);
}

/* ── États vide / chargement ─────────────────────────────────────────────────── */
.carousel-loading,
.carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  color: var(--color-text-muted);
}

/* ── Responsive (tablette) ──────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .panne-card {
    width: 420px;
  }
}

/* ── Responsive (desktop) ───────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .panne-card {
    width: 500px;
    max-width: 500px;
  }

  .carousel-arrow {
    display: flex;
  }

  .carousel-track {
    justify-content: flex-start;
    padding: var(--space-lg) var(--space-xl) var(--space-md);
  }
}
