:root {
  --act-installations-primary: #009da5;
  --act-installations-text: #414141;
  --act-installations-border: #edf1f2;
}

.act-installations {
  border-radius: 1rem;
}

.act-installations .act-installations__title {
  margin: 0;
  padding: 1.5rem 2rem;
  border: 1px solid var(--act-installations-primary);
  border-radius: 1rem 1rem 0 0;
  background: var(--act-installations-primary);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
}

.act-installations .act-installations__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem 2.5rem;
  border: 1px solid var(--act-installations-border);
  border-top: 0;
  border-radius: 0 0 1rem 1rem;
}

.popup-wrapper .legend,
.act-installations .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.popup-wrapper .legend-item,
.act-installations .legend-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--act-installations-text);
  font-size: .9375rem;
  font-weight: 500;
}

.popup-wrapper .installations,
.act-installations .installations,
.act-installations .toolbox__installations {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3.5rem;
}

.popup-wrapper .installation,
.act-installations .installation {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.popup-wrapper .circle,
.act-installations .circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
}

.popup-wrapper .small-circle,
.act-installations .small-circle {
  display: inline-flex;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}

.popup-wrapper .green,
.act-installations .green { background-color: #5fcb63; }
.popup-wrapper .yellow,
.act-installations .yellow { background-color: #ffc702; }
.popup-wrapper .red,
.act-installations .red { background-color: #fa5c5c; }
.popup-wrapper .gray,
.act-installations .gray { background-color: #8f8f8f; }

.popup-wrapper .icon,
.act-installations .icon {
  width: 2.5rem;
  height: 2.5rem;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.popup-wrapper .info h4,
.act-installations .info h4 {
  margin: 0;
  color: var(--act-installations-text);
  font-size: 1rem;
  font-weight: 500;
}

.popup-wrapper .info p,
.act-installations .info p {
  margin: 0;
  color: var(--act-installations-text);
  font-size: .6875rem;
}

.installation--without-icon {
  align-items: flex-start !important;
}

.installation--without-icon > .small-circle {
  margin-top: 5px;
}

.btn-popup {
  position: fixed;
  bottom: 40px;
  left: 47px;
  z-index: 1000;
  height: 4.5rem;
  padding: 10px 20px;
  border: 0;
  border-radius: 50px;
  background: var(--act-installations-primary);
  box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
  color: #fff;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 700;
}

.btn-popup:hover { background: #3ec1ce; }

.popup-overlay {
  display: none;
}

.popup-overlay.is-open {
  display: block;
}

.popup-wrapper {
  position: fixed;
  bottom: 40px;
  left: 47px;
  z-index: 1000;
  width: 100%;
  max-width: 28.25rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 4px 14px rgb(0 0 0 / 10%);
  font-family: "Merriweather Sans", sans-serif;
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 2rem;
  border-radius: 1rem 1rem 0 0;
  background: var(--act-installations-primary);
}

.popup-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.125rem;
}

#popup-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  cursor: pointer;
}

.toolbox__close-icon {
  width: 2rem;
  height: 2rem;
  padding: .25rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  cursor: pointer;
}

#popup-close:hover,
.toolbox__close-icon:hover { background: rgb(255 255 255 / 30%); }

.installation-icon {
  display: inline-flex;
  cursor: pointer;
}

.popup-content {
  padding: 1.5rem 2rem;
}

.popup-content .installations {
  gap: 2rem;
  margin-top: 1.5rem;
}

.act-installations-header {
  position: relative;
}

.act-installations-header .act-installations__icons {
  display: flex;
  gap: 1.5rem;
}

.act-installations-header .act-installations__icons svg {
  width: 2.5rem;
  height: 2.5rem;
}

.act-installations-header .toolbox-container {
  position: absolute;
  top: 73px;
  left: auto;
  z-index: 2;
  min-width: 600px;
  max-width: 90vw;
  transform: translateX(-70%);
}

.act-installations-header .toolbox {
  position: relative;
  border-radius: 0 0 1rem 1rem;
  background: #fff;
}

.act-installations-header .toolbox[hidden] {
  display: none !important;
}

.act-installations-header .toolbox::after {
  content: "";
  position: absolute;
  top: -16px;
  left: var(--arrow-position, 50%);
  border-right: 16px solid transparent;
  border-bottom: 16px solid #fff;
  border-left: 16px solid transparent;
  transform: translateX(-50%);
}

.act-installations-header .toolbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  font-size: 1.125rem;
}

.act-installations-header .toolbox__header h4 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
}

.act-installations-header .toolbox__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.act-installations-header .toolbox__installations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 3rem;
}

.act-installations-header .installation-item {
  padding: 1.5rem;
}

.act-ds-title {
  color: inherit !important;
  line-height: 1.25;
  margin: 2rem 0 1rem;
}

.act-ds-notice {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border-top: 4px solid #009da5;
  border-radius: .5rem;
  background: #e6f9f6;
  color: #001c18;
}

.act-ds-notice p { margin: 0; }

.act-ds-form-field {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
}

.act-ds-form-field label {
  margin-right: auto;
  font-size: .875rem;
}

.act-ds-form-field input,
.act-ds-form-field select,
.act-ds-form-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.5rem;
  padding: .5rem;
  border: 1px solid #696969;
  border-radius: .25rem;
  background: #f8f8f8;
  color: #0e0e0e;
  font-size: 0.875rem;
}

.act-ds-form-field textarea {
  min-height: 5rem;
  line-height: 1.4;
  resize: vertical;
}

.act-ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: .5rem 1rem;
  border: 1px solid #047264;
  border-radius: .5rem;
  background: #059885;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.act-ds-button:hover { background: #047264; }

@media (max-width: 1024px) {
  .act-installations .act-installations__title { padding: 1.25rem 1.5rem; }

  .act-installations .act-installations__content {
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 1.5rem;
  }

  .act-installations .installations { gap: 1.5rem 2rem; }

  .act-installations-header .act-installations__icons { gap: 1rem; }

  .act-installations-header .act-installations__icons svg {
    width: 2rem;
    height: 2rem;
  }

  /* Ancré au viewport plutôt qu'à l'icône : le panneau ne peut plus déborder de l'écran. */
  .act-installations-header .toolbox-container {
    position: fixed;
    top: var(--toolbox-top, 4.5rem);
    right: .75rem;
    bottom: auto;
    left: .75rem;
    width: auto;
    min-width: 0;
    max-width: none;
    transform: none;
  }

  .act-installations-header .toolbox::after {
    left: clamp(28px, var(--arrow-position, 50%), calc(100% - 28px));
  }

  .act-installations-header .toolbox__header {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .act-installations-header .toolbox__header h4 { gap: .75rem; }

  .act-installations-header .toolbox__header h4 svg {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
  }

  .act-installations-header .toolbox__content,
  .act-installations-header .toolbox > .installations {
    max-height: calc(100vh - var(--toolbox-top, 4.5rem) - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .act-installations-header .toolbox__content {
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .act-installations-header .toolbox > .installations {
    flex-direction: column;
    gap: 0;
  }

  .act-installations-header .toolbox__installations {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .act-installations-header .installation-item { padding: 1.25rem; }
}

@media (max-width: 640px) {
  .btn-popup,
  .popup-wrapper {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }

  .btn-popup {
    height: 3.5rem;
    font-size: 1rem;
  }

  .popup-header { padding: 1rem 1.5rem; }

  .popup-content {
    max-height: 60vh;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .popup-wrapper .legend,
  .act-installations .legend { gap: 1rem; }
}
