.refs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.ref-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: #111;
}
.ref-card:first-child {
  grid-column: span 2;
  aspect-ratio: 16 / 5.99;
}
.ref-card-img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    filter 0.55s ease;
  filter: brightness(0.75);
}
.ref-card:hover .ref-card-img {
  transform: scale(1.06);
  filter: brightness(0.45);
}

/* Badge catégorie */
.ref-card-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 4px 10px;
  background-color: #0000FD;
  color: #fff;
  font-family: 'Work Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  z-index: 2;
  transition: opacity 0.3s ease;
}

/* Overlay infos au survol */
.ref-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  transform: translateY(8px);
  opacity: 0;
  transition: all 0.35s ease;
  z-index: 2;
}

.ref-card:hover .ref-card-overlay {
  opacity: 1;
  transform: translateY(0);
}

.ref-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.ref-card-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* Icône "+" toujours visible */
.ref-card-plus {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.35s ease;
  z-index: 2;
}

.ref-card-plus svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.ref-card:hover .ref-card-plus {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Titre permanent (toujours visible, disparaît au hover) */
.ref-card-permanent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 22px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  z-index: 2;
  transition: opacity 0.3s ease;
}

.ref-card:hover .ref-card-permanent {
  opacity: 0;
}

.ref-card-permanent-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-window {
  width: 100%;
  max-width: 1040px;
  max-height: 90vh;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s ease;
  opacity: 0;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal-window {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-carousel {
  position: relative;
  background: #111;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contrôles carousel */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

.carousel-btn svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-btn.prev {
  left: 16px;
}

.carousel-btn.next {
  right: 16px;
}

/* Dots */
.carousel-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

.carousel-dot.active {
  background: #fff;
  transform: scale(1.3);
}

.modal-info {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 44px 44px 36px;
  position: relative;
  overflow-y: auto;
  height: 90vh;
}

.modal-info::-webkit-scrollbar {
  width: 3px;
}

.modal-info::-webkit-scrollbar-track {
  background: #fff;
}

.modal-info::-webkit-scrollbar-thumb {
  background: #0000FD;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f3f3 !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  padding: 0;
  z-index: 2 !important;
}

.modal-close:hover {
  background: #e5e5e5;
}

.modal-close svg {
  width: 16px;
  height: 16px;
  stroke: #333;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* Meta (année + client) */
.modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-year {
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #aaa;
}

.modal-meta-sep {
  width: 30px;
  height: 1px;
  background: #ddd;
}

.modal-client-label {
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0000FD;
}

/* Titre principal */
.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 30px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  color: #0B0B0B !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 28px;
}

.modal-title span {
  color: #0000FD !important;
}

.modal-desc {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: #555;
  line-height: 1.75;
  margin-bottom: 30px !important;
}

.modal-divider {
  width: 40px;
  height: 3px;
  background: #0000FD;
  margin-bottom: 28px;
  border-radius: 2px;
}

/* Specs bétons */
.modal-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.spec-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #f8f8f8;
  border-radius: 4px;
}

.spec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0000FD;
  flex-shrink: 0;
  margin-top: 5px;
}

.spec-text {
  font-family: 'Work Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.spec-text small {
  display: block;
  font-weight: 500;
  color: #888;
  font-size: 11px;
  margin-top: 2px;
}

/* Client info */
.modal-client-block {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.modal-client-info strong {
  display: block;
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  margin-bottom: 0;
}

.modal-client-info span {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #0B0B0B;
}

.modal-nav-btns {
  display: flex;
  gap: 6px;
}

.modal-nav-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid #ddd !important;
  border-radius: 50%;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.modal-nav-btn:hover {
  border-color: #0000FD !important;
  background: #0000FD !important;
}

.modal-nav-btn:hover svg {
  stroke: #fff;
}

.modal-nav-btn svg {
  width: 14px;
  height: 14px;
  stroke: #555;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}

.stats-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #0B0B0B;
  margin-top: 2px;
}

.stat-item {
  padding: 40px 36px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-number span {
  color: #0000FD;
}

.stat-label {
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 1024px) {
  .refs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-info {
    padding: 40px 20px 36px;
  }
}

@media (max-width: 767px) {
  .modal-close {
    top: 10px;
    right: 10px;
  }
  .ref-card:first-child {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
}

  .modal-divider {
    padding: 1px;
  }

  .modal-info {
    padding: 35px 20px 20px;
    height: 400px;
    overflow-y: auto;
  }

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

  .modal-window {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }

  .modal-carousel {
    height: 280px;
  }

  .stats-banner {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2) {
    border-right: none;
  }
}