:root {
  --map-fill: #ececec;
  --map-stroke: #333;
  --map-active-fill: #b8d4f1;
  --map-active-stroke: #5a9fd4;
  --map-hover: #3498db;
  --map-hover-stroke: #2980b9;
  --popup-bg: #ffffff;
  --popup-border: #3498db;
  --text-primary: #00142E;
  --text-secondary: #000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

h1 {
  text-align: center;
  color: #00142E;
  margin-bottom: 1rem;
  font-size: 2rem;
}
 
/* ===== 1) Fixed coordinate system (MATCH your SVG viewBox ratio!) ===== */
.hygeco-container .map-wrap{
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 1200 / 800;
  margin: 0 auto;
  line-height: 0;
  contain: layout paint size;
}
 
/* ===== 2) SVG is the background layer ===== */
.hygeco-container .map-wrap > svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0 !important;
}
 
/* ===== 3) Single overlay layer for all icons ===== */
.hygeco-container .map-wrap .map-icons{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1000 !important;
  pointer-events: none;
}
 
/* ===== 4) Country anchor groups ===== */
.hygeco-container .map-wrap .icon-group{
  position: absolute;
  transform: translate(-50%, -100%); 
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, auto);
  grid-template-rows: repeat(2, auto);
  gap: 0px;
  pointer-events: none; 
}
 
/* Put the 3rd icon centered below the top row (for 3-icon countries) */
.hygeco-container .map-wrap .icon-group .map-icon:nth-child(3){
  grid-column: 1 / span 2;
  justify-self: center;
}
 
/* ===== 5) Icon images (consistent size + interactions) ===== */
.hygeco-container .map-wrap .map-icon{
  width: clamp(18px, 2.2vw, 30px);
  height: clamp(18px, 2.2vw, 30px);
  object-fit: contain;
}

 
/* ===== 7) Anchor positions (adjust %s to fit your map) ===== */
/* France (3 icons) */
.icon-group.france  { top: 72%; left: 42%; }
/* Germany (3 icons) */
.icon-group.germany { top: 63%; left: 54%; }
/* UK (2 icons) */
.icon-group.uk      { top: 58%; left: 39%; }
/* Spain (2 icons) */
.icon-group.spain   { top: 83%; left: 36%; }
 
/* ===== 8) Responsive: adjust ONLY sizes/positions; never add padding to .map-wrap ===== */
@media (min-width: 1300px){
  .icon-group.france  { top: 72%; left: 42%; }
  .icon-group.germany { top: 63%; left: 54%; }
  .icon-group.uk      { top: 58%; left: 39%; }
  .icon-group.spain   { top: 83%; left: 36%; }
}
 
.map-icons, .map-icon { 
  max-width: none;
}

/* Pays interactifs */
.country {
  cursor: pointer;
  transition: all 0.2s ease;
  fill: var(--map-active-fill);
  stroke: var(--map-active-stroke);
  stroke-width: 0.8;
  animation: pulse 2s ease-in-out;
}

.country.is-hovered,
.country:hover {
  fill: var(--map-hover) !important;
  stroke: var(--map-hover-stroke);
  stroke-width: 1;
  filter: drop-shadow(0 0 6px rgba(52, 152, 219, 0.4));
}

/* Animation pulse au chargement */
@keyframes pulse {
  0%, 100% {
    filter: drop-shadow(0 0 0 rgba(52, 152, 219, 0));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.6));
  }
}

.country:focus {
  fill: var(--map-hover) !important;
  stroke: var(--map-hover-stroke);
  stroke-width: 1;
  outline: 2px solid var(--popup-border);
  outline-offset: 2px;
}

/* Popup */
#map-popup {
  position: fixed;
  z-index: 9999;
  max-width: fit-content;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--popup-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  color: #fff;
  pointer-events: none;
    transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  border: 2px solid var(--popup-border);
  display: none;
}

#map-popup .locations-container {
    display: flex; 
    flex-wrap: nowrap; 
    gap: 20px; 
    overflow-x: auto; 
    padding-bottom: 5px;
}

#map-popup .location-details-block {
    flex-shrink: 0; 
    border-right: 1px solid #eee;
    padding-right: 20px;
}

/* Remove the border from the last block */
#map-popup .location-details-block:last-child {
    border-right: none;
    padding-right: 0;
}

#map-popup[aria-hidden="false"] {
  display: block;
}

#map-popup h2 {
  margin: 0 0 0.5rem 0;
  color: #00142E;
  font-size: 1.5rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 0.5rem;
}

#map-popup h3 {
  margin: 0 0 0.75rem 0;
  color: #3498db;
  font-size: 1.1rem;
  font-weight: 600;
}

#map-popup .company {
  margin: 0 0 0.5rem 0;
  font-style: italic;
  color: #666;
}

#map-popup .icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
  display: inline-block;
  min-width: 24px;
}

#map-popup .address {
  margin: 0.75rem 0;
  line-height: 1.6;
  color: #000;
  display: flex;
  align-items: flex-start;
}

#map-popup .address .icon {
  margin-top: 2px;
}

#map-popup .contact {
  margin: 0.25rem 0;
  font-size: 0.95rem;
  color: #000;
  display: flex;
  align-items: center;
}

#map-popup .contact strong {
  color: #00142E;
  min-width: 20px;
  display: inline-block;
}

#map-popup .contact a {
  color: #3498db;
  text-decoration: none;
}

#map-popup .contact a:hover {
  text-decoration: underline;
}

#map-popup .link {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

#map-popup .link a {
  display: inline-block;
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

#map-popup .link a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .map-wrap {
    padding: 1rem;
  }
  
  #map-popup {
    min-width: 200px;
    padding: 1rem;
  }
  
  #map-popup h2 {
    font-size: 1.25rem;
  }
  #map-container .country {
    pointer-events: auto;;
  }
}