.agm-map-wrapper {
  width: 100%;
  box-sizing: border-box;
}

.agm-filter-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding-left: 20px;
}

.agm-filter {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.agm-filter label {
  font-weight: 600;
  color: #1f2937;
  font-family: 'Comfortaa', sans-serif;
}

.agm-filter select {
  max-width: 340px;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-family: 'Comfortaa', sans-serif;
}

.agm-filter input {
  width: 380px;
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-family: 'Comfortaa', sans-serif;
}

.agm-company-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.agm-azienda-toggle {
  position: absolute;
  right: 8px;
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.agm-azienda-list {
  display: none;
  width: 380px;
  max-width: 100%;
  margin-top: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Comfortaa', sans-serif;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  height: 280px;
  overflow-y: auto;
  line-height: 1.5;
}

.agm-azienda-list option {
  padding: 6px 8px;
}

.agm-azienda-list.is-open {
  display: block !important;
}

.agm-mobile-company-modal {
  display: none;
}

#agm-map {
  height: 620px;
  overflow: hidden;
  background: #f3f4f6;
}

.agm-map-message {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  display: none;
}

.agm-popup {
  max-width: 340px;
  font-size: 14px;
  line-height: 1.45;
  background: #f4ac32;
  color: #ffffff;
  padding: 14px 18px 22px;
  font-family: 'Comfortaa', sans-serif;
}

.agm-popup h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #ffffff;
}

.agm-popup p {
  margin: 0 0 6px;
}

.agm-popup a {
  color: #ffffff;
  text-decoration: underline;
}

.agm-popup a:hover {
  opacity: 0.9;
}

.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw-d,
.gm-style .gm-style-iw-t::after {
  background: #f4ac32 !important;
}

.gm-style .gm-style-iw-c {
  padding: 0 !important;
  overflow: hidden !important;
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  max-height: none !important;
}

.gm-style .gm-style-iw-tc::after {
  background: #f4ac32 !important;
}

.gm-style .gm-ui-hover-effect {
  filter: brightness(0) invert(1);
  opacity: 1;
}

@media (max-width: 767px) {
  .agm-filter-row {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .agm-filter {
    margin-bottom: 8px;
    gap: 6px;
  }

  .agm-filter label {
    font-size: 13px;
  }

  .agm-filter select,
  .agm-filter input {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    font-size: 14px;
    padding: 8px 10px;
  }

  .agm-company-search-wrap {
    width: 100%;
  }

  .agm-azienda-list {
    display: none !important;
  }

  .agm-mobile-company-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99999;
    padding: 20px 12px;
  }

  .agm-mobile-company-modal.is-open {
    display: block;
  }

  .agm-mobile-company-panel {
    background: #fff;
    border-radius: 14px;
    max-height: 72vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .agm-mobile-company-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    font-family: 'Comfortaa', sans-serif;
  }

  .agm-mobile-company-close {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #374151;
  }

  .agm-mobile-company-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
  }

  .agm-mobile-company-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    font-family: 'Comfortaa', sans-serif;
    font-size: 15px;
    color: #111827;
  }

  .agm-mobile-company-empty {
    padding: 12px;
    color: #6b7280;
    font-family: 'Comfortaa', sans-serif;
  }

  #agm-map {
    height: 78vh;
    min-height: 620px;
  }
}
