/* ============================================================
   FLORAISON — Styles
   ============================================================ */

/* ── Layout ── */
.floraison-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0 3rem;
}

/* ── Month slider ── */
.month-strip {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding: .5rem 0 1rem;
  scrollbar-width: thin;
  margin-bottom: 1.5rem;
}
.month-btn {
  flex-shrink: 0;
  padding: .55rem .9rem;
  border: 2px solid #e5e0d8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: #6b5e4e;
  transition: all .18s;
  text-align: center;
  min-width: 52px;
  font-family: 'Poppins', sans-serif;
}
.month-btn:hover { border-color: var(--honey-gold); color: var(--honey-gold); }
.month-btn.active {
  background: var(--honey-gold);
  border-color: var(--honey-gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,166,35,.35);
}
.month-btn .mois-abbr { display: block; font-size: .65rem; opacity: .7; font-weight: 400; }

/* ── Map wrapper ──
   Le wrapper adopte l'aspect-ratio du viewBox (470:910) pour que la carte
   remplisse toute la zone visible (plus de bandes vertes sur les côtés).
   max-width limite la taille sur desktop, max-height limite sur très grand
   écran portrait. */
.map-wrapper {
  background: #f0f4f0;
  border-radius: 16px;
  padding: .9rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 720px;          /* élargi pour les navigateurs desktop (était 520) */
  margin: 0 auto;
  /* Override de boutique.css qui définit .map-wrapper { display:flex; height:400px } */
  display: block;
  height: auto;
}
.map-wrapper svg {
  width: 100%;
  height: auto;              /* hauteur déduite du viewBox → carte remplit la largeur sans bandes vides */
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.08));
  touch-action: none;        /* on gère pan/pinch/wheel nous-mêmes */
  transition: none;
}
.map-wrapper.zoomed svg { cursor: grab; }
.map-wrapper.zoomed.dragging svg,
.map-wrapper.zoomed.dragging .deleg-poly,
.map-wrapper.zoomed.dragging .gov-poly { cursor: grabbing !important; }

/* ── Zoom controls ── */
.map-controls {
  position: absolute;
  top: .9rem;
  right: .9rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  z-index: 5;
  user-select: none;
}
.map-controls button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bee-brown, #4A2C0A);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: background .15s, transform .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
}
.map-controls button:hover { background: #fff; transform: scale(1.06); }
.map-controls button:active { transform: scale(.96); }
.map-controls button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.map-zoom-indicator {
  margin-top: .15rem;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 7px;
  padding: .15rem .35rem;
  font-size: .65rem;
  font-weight: 600;
  color: #6b5e4e;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  letter-spacing: .02em;
  min-width: 36px;
}
@media (max-width: 540px) {
  .map-controls { top: .55rem; right: .55rem; }
  .map-controls button { width: 32px; height: 32px; font-size: 1rem; }
}

/* ── SVG governorate polygons ── */
.gov-poly {
  fill: #d9ead3;
  stroke: #fff;
  stroke-width: 2;
  stroke-linejoin: round;
  cursor: pointer;
  transition: opacity .2s, fill .3s;
}
.gov-poly:hover { opacity: .78; }
.gov-poly.inactive { fill: #e8e4df !important; stroke: #fff; }

/* ── SVG delegation polygons (sub-divisions of gouvernorats) ── */
.deleg-poly {
  fill: #d9ead3;
  stroke: rgba(255,255,255,.85);
  stroke-width: .6;
  stroke-linejoin: round;
  cursor: pointer;
  transition: opacity .2s, fill .3s;
}
.deleg-poly:hover { opacity: .72; stroke: #2D1B0E; stroke-width: 1.1; }
.deleg-poly.inactive { fill: #e8e4df; }

/* Overlay path drawn on top of all delegations — gives the governorate its visual outline */
.gov-border {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linejoin: round;
  pointer-events: none;
}

.gov-label {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  fill: rgba(45,27,14,.65);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
  paint-order: stroke;
  stroke: rgba(255,255,255,.75);
  stroke-width: 2.5;
}
.gov-label.small { font-size: 9px; }

/* ── Tooltip ── */
.flor-tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid #e5e0d8;
  border-radius: 10px;
  padding: .8rem 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
  font-size: .82rem;
  max-width: 220px;
  z-index: 9999;
  pointer-events: none;
  display: none;
}
.flor-tooltip .tt-gov { font-weight: 700; color: #2D1B0E; margin-bottom: .4rem; }
.flor-tooltip .tt-plante { display: flex; align-items: center; gap: .4rem; margin: .2rem 0; }
.flor-tooltip .tt-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Legend panel ── */
.floraison-panel {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 1.5rem;
}
.floraison-panel h3 {
  font-size: .95rem;
  font-weight: 700;
  color: #2D1B0E;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.legend-empty {
  text-align: center;
  color: #aaa;
  font-size: .82rem;
  padding: 1.5rem 0;
}
.legend-item {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .6rem 0;
  border-bottom: 1px solid #f5f0ea;
}
.legend-item:last-child { border-bottom: none; }
.legend-swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}
.legend-info { flex: 1; }
.legend-nom { font-weight: 600; font-size: .85rem; color: #2D1B0E; }
.legend-regions { font-size: .75rem; color: #888; line-height: 1.5; }

/* ── Fiche détail plante ── */
.legend-item {
  cursor: pointer;
  transition: background .15s;
  border-radius: 6px;
}
.legend-item:hover { background: #fff8e7; }

.plante-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 14, .55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: planteFadeIn .15s ease-out;
}
.plante-detail-overlay.open { display: flex; }
@keyframes planteFadeIn { from { opacity: 0; } to { opacity: 1; } }

.plante-detail {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  animation: planteSlideUp .2s ease-out;
}
@keyframes planteSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.plante-detail-close {
  position: absolute;
  top: .6rem; right: .6rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.92);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.plante-detail-close:hover { background: #fff; }

.plante-detail-body { padding: 0; }
.plante-detail-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 16px 16px 0 0;
  background: #f5f0ea;
}
.plante-detail-photo.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #d8d0c4;
}
.plante-detail-content { padding: 1.2rem 1.4rem 1.6rem; }
.plante-detail h2 {
  margin: 0 0 .35rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--bee-brown, #2D1B0E);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.plante-detail h2 .color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,.05);
}
.plante-detail .latin {
  font-style: italic;
  color: #8a7060;
  font-size: .82rem;
  margin-bottom: 1rem;
}
.plante-detail-section {
  margin-top: 1.1rem;
}
.plante-detail-section h4 {
  margin: 0 0 .35rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--honey-gold, #c8870a);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.plante-detail-section p {
  margin: 0;
  font-size: .87rem;
  line-height: 1.5;
  color: #4a3a2c;
}
.plante-detail-miel-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.plante-detail-miel-swatch {
  display: inline-block;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12), inset 0 -8px 10px -8px rgba(0,0,0,.18), inset 0 6px 8px -4px rgba(255,255,255,.5);
  flex-shrink: 0;
}
.plante-detail-miel-color {
  display: inline-block;
  background: #fff8e7;
  border: 1px solid #f0e2bc;
  border-radius: 12px;
  padding: .2rem .7rem;
  font-size: .82rem;
  font-weight: 600;
  color: #8a6510;
}
.plante-detail-empty {
  font-style: italic;
  color: #aaa;
  font-size: .82rem;
}

/* ── Stats bar ── */
.flor-stats {
  display: flex;
  gap: 1.5rem;
  background: #fff8e7;
  border-radius: 10px;
  padding: .8rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: .82rem;
  color: #5a4030;
}
.flor-stat strong { color: var(--honey-gold); font-size: 1.1rem; }

/* ── Play button ── */
.play-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  background: var(--bee-brown);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  transition: background .2s;
}
.play-btn:hover { background: var(--honey-dark); }

/* ── Multi-plante badge ── */
.multi-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: #E53935;
  color: #fff;
  font-size: 6px;
  font-weight: 700;
  border-radius: 50%;
  width: 10px; height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ── Section hero ── */
.page-hero .floraison-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}

/* ── Jour Timeline ── */
.jour-timeline {
  position: relative;
  height: 44px;
  background: #ede8e2;
  border-radius: 22px;
  cursor: pointer;
  user-select: none;
  margin-top: .4rem;
  touch-action: none;
}
.jt-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #f5a623 0%, #c8870a 100%);
  border-radius: 22px;
  pointer-events: none;
  min-width: 22px;
}
.jt-handle {
  position: absolute;
  top: 50%;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%);
  background: var(--bee-brown, #4A2C0A);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  cursor: grab;
  z-index: 3;
  white-space: nowrap;
}
.jt-handle:active { cursor: grabbing; transform: translate(-50%, -50%) scale(1.08); }
.jt-ticks {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.jt-tick {
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
}
.jt-tick-line {
  width: 1px; height: 12px;
  background: rgba(0,0,0,.15);
}
.jt-tick-label {
  font-size: 8.5px;
  color: rgba(0,0,0,.38);
  font-family: 'Poppins', sans-serif;
  margin-top: 1px;
  line-height: 1;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .floraison-layout {
    grid-template-columns: 1fr;
  }
  .floraison-panel { order: 2; }
}
@media (max-width: 540px) {
  .month-btn { min-width: 42px; padding: .45rem .6rem; font-size: .72rem; }
  .map-wrapper { padding: .8rem; border-radius: 10px; }
  .floraison-panel { padding: 1rem; }
}
