:root {
  --im-primary: #CE2C3D;
  --im-primary-hover: #a91e2e;
  --im-white: #ffffff;
  --im-bg: #f9fafb;
  --im-border: #e0e0e0;
  --im-border-2: #e2e8f0;
  --im-border-3: #cbd5e1;
  --im-text-dark: #1e293b;
  --im-text-muted: #64748b;
  --im-white-25: rgba(255,255,255,0.25);
  --im-white-35: rgba(255,255,255,0.35);
  --im-radius-sm: 10px;
}

.interactive-map-wrapper {
  position: relative;
  /*height: 720px;*/
}

.interactive-map-container {
  background: var(--im-bg);
  overflow: hidden;
  /*width: 700px;
  height: 720px!important;*/
}

.interactive-map-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Ensure container constrains height if needed */
.interactive-map-container {
  height: auto !important;
}

.interactive-map-svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.interactive-map-container path {
  cursor: default;
  transition: fill 0.2s ease;
}

.interactive-map-container path.clickable:hover {
  fill: var(--im-primary) !important;
}

/* Path selected (au clic) = même couleur que hover */
.interactive-map-container path.selected {
  fill: var(--im-primary) !important;
}

.interactive-map-container path.active {
  fill: #7F7F7F;
}

.interactive-map-container path.inactive {
  fill: #dbdbdb !important;
}

/* Curseur main uniquement pour les paths cliquables */
.interactive-map-container path.clickable {
  cursor: pointer;
}

/* Tooltip */
.tooltip {
  position: absolute;
  display: none;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-title {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 4px;
}

.tooltip-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.tooltip-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease;
}

.tooltip-image:hover {
  transform: scale(1.1);
  border-color: #3b82f6;
}

.tooltip-no-images {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 10px;
}

/* Styles pour les logos d'entreprises dans le tooltip */
.tooltip-subtitle {
  font-size: 12px;
  color: #d1d5db;
  margin-bottom: 8px;
  font-weight: normal;
}

.tooltip-enterprises {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.tooltip-enterprise-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tooltip-enterprise-logo:hover {
  transform: scale(1.15);
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.2);
}

.tooltip-no-logos {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 10px;
  font-size: 12px;
}

/* Styles pour le modal des transactions */
.transactions-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Variante: superposer uniquement au-dessus de #int-map-desc */
.transactions-modal.for-desc {
  position: absolute;
  /*top: 10px;*/
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
}

.transactions-modal.for-desc .modal-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  justify-content: center;
}

/* Mode for-desc: scroll horizontal uniquement */
.transactions-modal.for-desc .modal-body {
  overflow-x: auto;
  overflow-y: hidden;
}

.transactions-modal.for-desc .modal-content {
  padding: 16px 16px 16px 16px;
}

.transactions-modal.for-desc .transactions-list {
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.transactions-modal.for-desc .transaction-item {
  flex: 0 0 auto;
  min-width: 280px;
  max-width: 360px;
}

/* Quand le bloc #int-map-desc contient le modal, masquer ses autres enfants */
#int-map-desc.has-transactions-modal > *:not(.transactions-modal) {
  /*display: none !important;*/
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: relative;
  max-width: 800px;
  max-height: 90vh;
  margin: 5vh auto;
  background: var(--im-primary); /* couleur hover */
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid var(--im-white-25);
  display: none;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--im-white);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--im-white);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: rgba(255,255,255,0.15);
  color: var(--im-white);
}

.modal-body {
  /*flex: 1;*/
  overflow-y: auto;
  padding: 0;
}

.modal-content {
  padding: 24px;
  color: var(--im-white);
}

/* Layout simplifié pour le modal */
.modal-simple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--im-white-25);
  margin-bottom: 12px;
  font-weight: bold;
}

.modal-simple-header .country-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--im-white);
  text-transform: uppercase;
}

.modal-simple-header .transactions-count {
  font-size: 14px;
  color: var(--im-white);
}

/*.modal-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.modal-image-item,
.modal-image-item.elementor-element {
  flex: 0 0 20%;
}*/

.modal-images {
  display: grid;
  gap: 10px;
  max-width: 100%;
  padding: 10px;
  overflow-x: auto;
}

.modal-image-item {
  min-width: 170px;
  max-height: 255px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.modal-image-item a {
  display: block;
}

.modal-image-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

/* Styles pour la liste des transactions */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transaction-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  background: var(--im-bg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.transaction-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--im-border-3);
}

.transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.transaction-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--im-text-dark);
  flex: 1;
  line-height: 1.4;
}

.transaction-date {
  font-size: 12px;
  color: var(--im-text-muted);
  background: var(--im-border-2);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.transaction-image {
  margin-bottom: 12px;
}

.transaction-thumbnail {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: var(--im-radius-sm);
  border: 1px solid var(--im-border-2);
}

.transaction-actions {
  display: flex;
  justify-content: flex-end;
}

.transaction-link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--im-primary);
  color: var(--im-white);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.transaction-link:hover {
  background: var(--im-primary-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--im-white);
}

/* Responsive */
@media (max-width: 768px) {
  .modal-container {
    margin: 2vh;
    max-height: 96vh;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-content {
    padding: 20px;
  }
  
  .transaction-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .transaction-date {
    align-self: flex-start;
  }

  .modal-images {
    display: -webkit-inline-box;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .modal-image-item {
      min-width: 154px;
      width: 45%;
  }
}

/* Responsive: min-width 767px */
@media (max-width: 768px) {
  #int-map-desc.has-transactions-modal {
    height:550px!important;
  }
}

@media screen and (min-width: 1540px) and (max-width: 1920px) {
 .modal-image-item {
  min-width: 191px;
  max-height: 255px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
 
}


@media only screen and (min-width: 1920px) {
.modal-image-item {
  min-width: 218px;
  max-height: 317px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
}

/* Classe pour empêcher le scroll du body quand le modal est ouvert */
body.modal-open {
  overflow: hidden;
}