/* Carte interactive IDF — zones-de-livraison (variables site existantes) */

.idf-map-section {
  padding: clamp(2rem, 4vw, 3.25rem) 1.25rem;
  background: var(--prob-bg-soft, var(--prob-bg-page));
}

body.prob-site:not(.light-mode) .idf-map-section {
  background: rgba(255, 255, 255, 0.03);
}

.idf-map-inner {
  max-width: 56rem;
  margin: 0 auto;
}

.idf-map-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.idf-map-header h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  font-weight: 900;
  margin: 0 0 0.5rem;
  color: var(--prob-text);
}

.idf-map-sub {
  font-size: 0.88rem;
  color: var(--prob-text-muted);
  margin: 0;
}

.idf-map-legend {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.idf-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--prob-text);
}

.idf-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.idf-green { background: #22c55e; }
.idf-orange { background: #f59e0b; }
.idf-red { background: #ef4444; }

.idf-map-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Grille départements (remplace la carte SVG) */
.idf-dept-grid {
  max-width: 50rem;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.idf-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

.idf-card {
  padding: 20px 16px;
  border-radius: 12px;
  border: 2px solid;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
  flex: 1 1 130px;
  max-width: 220px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--prob-text);
}

.idf-card::after {
  content: "Voir les conditions →";
  display: block;
  font-size: 0.65rem;
  opacity: 0;
  margin-top: 8px;
  transition: opacity 0.15s;
  font-weight: 600;
}

.idf-card:hover::after {
  opacity: 0.6;
}

.idf-card.selected {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.idf-card.idf-green.selected {
  background: rgba(34, 197, 94, 0.18);
}

.idf-card.idf-orange.selected {
  background: rgba(245, 158, 11, 0.18);
}

.idf-card.idf-red.selected {
  background: rgba(239, 68, 68, 0.14);
}

.idf-card[data-dept="77"] {
  min-width: 240px;
  padding: 28px 20px;
}

.idf-card[data-dept="77"] .idf-card-num {
  font-size: 2.2rem;
}

.idf-card--large {
  min-width: 200px;
  flex: 1.4 1 200px;
  max-width: 280px;
}

.idf-card-num {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
}

.idf-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
}

.idf-card-tag {
  font-size: 0.65rem;
  opacity: 0.65;
  margin-top: 4px;
  line-height: 1.35;
}

.idf-card.idf-green {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.idf-card.idf-green .idf-card-num {
  color: #22c55e;
}

.idf-card.idf-orange {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.idf-card.idf-orange .idf-card-num {
  color: #f59e0b;
}

.idf-card.idf-red {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.idf-card.idf-red .idf-card-num {
  color: #ef4444;
}

.dept-zone {
  cursor: pointer;
}

.idf-zone-green path {
  fill: rgba(34, 197, 94, 0.35);
  stroke: #22c55e;
  stroke-width: 2;
}
.idf-zone-orange path {
  fill: rgba(245, 158, 11, 0.3);
  stroke: #f59e0b;
  stroke-width: 2;
}
.idf-zone-red path {
  fill: rgba(239, 68, 68, 0.3);
  stroke: #ef4444;
  stroke-width: 2;
}
.idf-zone-green:hover path { fill: rgba(34, 197, 94, 0.5); }
.idf-zone-orange:hover path { fill: rgba(245, 158, 11, 0.45); }
.idf-zone-red:hover path { fill: rgba(239, 68, 68, 0.45); }
.idf-zone-green.selected path { fill: rgba(34, 197, 94, 0.6); }
.idf-zone-orange.selected path { fill: rgba(245, 158, 11, 0.6); }
.idf-zone-red.selected path { fill: rgba(239, 68, 68, 0.6); }

.dept-label {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 800;
  fill: var(--prob-text);
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
}

.idf-popup {
  position: absolute;
  top: 1.25rem;
  right: 0;
  width: 16.25rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--prob-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
  border: 1px solid var(--prob-border);
  background: var(--prob-white);
  z-index: 20;
}

body.prob-site:not(.light-mode) .idf-popup {
  background: var(--prob-bg-page);
}

.idf-popup.hidden { display: none; }

.idf-popup-header {
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.idf-popup-green .idf-popup-header {
  background: rgba(34, 197, 94, 0.12);
  border-bottom: 2px solid #22c55e;
}
.idf-popup-orange .idf-popup-header {
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 2px solid #f59e0b;
}
.idf-popup-red .idf-popup-header {
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 2px solid #ef4444;
}

.idf-popup-dept-num {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--prob-text);
}

.idf-popup-dept-name {
  font-size: 0.85rem;
  font-weight: 600;
  flex: 1;
  color: var(--prob-text);
}

.idf-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.5;
  padding: 0;
  color: var(--prob-text);
  line-height: 1;
}

.idf-popup-close:hover { opacity: 1; }

.idf-popup-body {
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.idf-popup-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.82rem;
  align-items: flex-start;
  color: var(--prob-text);
  line-height: 1.45;
}

.idf-popup-icon { flex-shrink: 0; }

.idf-popup-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--prob-border);
}

.idf-popup-cta {
  display: block;
  text-align: center;
  padding: 0.55rem 1rem;
  background: var(--prob-accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
}

.idf-popup-cta:hover {
  filter: brightness(1.05);
}

.idf-popup-cta-call {
  background: #22c55e;
}

.idf-dept-buttons {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.idf-dept-btn {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  border: 2px solid;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s;
  font-family: inherit;
}

.idf-btn-green {
  border-color: #22c55e;
  color: #22c55e;
}
.idf-btn-green.active,
.idf-btn-green:hover {
  background: rgba(34, 197, 94, 0.15);
}
.idf-btn-orange {
  border-color: #f59e0b;
  color: #f59e0b;
}
.idf-btn-orange.active,
.idf-btn-orange:hover {
  background: rgba(245, 158, 11, 0.15);
}
.idf-btn-red {
  border-color: #ef4444;
  color: #ef4444;
}
.idf-btn-red.active,
.idf-btn-red:hover {
  background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 480px) {
  .idf-row {
    flex-wrap: wrap;
  }

  .idf-card {
    min-width: 100px;
    padding: 14px 10px;
    flex: 1 1 calc(50% - 10px);
    max-width: none;
  }

  .idf-card--large {
    min-width: 100px;
    flex: 1 1 100%;
    max-width: none;
  }

  .idf-card-num {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  .idf-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    border-radius: 16px 16px 0 0;
    z-index: 300;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .idf-popup {
    position: relative;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
    right: auto;
    top: auto;
  }
}
