#service-area-tool {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 40px auto;
  align-items: stretch;
  position: relative;
}

#sa-sidebar {
  flex: 0;
  opacity: 0;
  overflow: hidden;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 20px 50px rgba(0,0,0,0.10);
  transition: all 0.35s ease;
  transform: translateX(-20px);
  display: flex;
  flex-direction: column;
}

#sa-sidebar.is-open {
  flex: 1;
  opacity: 1;
  padding: 22px;
  transform: translateX(0);
  min-width: 0;
}

#sa-agency-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

#sa-agency-logo-wrapper {
  flex: 0 0 70px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sa-agency-logo {
  display: block;
  max-width: 70px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
}

#sa-title {
  flex: 1;
  margin: 0;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

#sa-description {
  font-size: 1rem;
  line-height: 1.65;
  color: #374151;
}

#sa-description p {
  margin-bottom: 1rem;
}

#sa-description a {
  color: #2563eb;
  text-decoration: underline;
}

.sa-directions-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 13px 20px;
  width: 100%;
  min-width: 180px;
  font-size: .8rem;
  font-weight: 700;
  font-family: "Open Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #ffffff !important;
  text-decoration: none !important;
  background-color: #bf1f24;
  border: 0;
  border-radius: 0;
  transition: all 0.25s ease;
}

.sa-streetview-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 13px 20px;
  width: 100%;
  min-width: 180px;
  font-size: .8rem;
  font-weight: 700;
  font-family: "Open Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #ffffff !important;
  text-decoration: none !important;
  background-color: #bf1f24;
  border: 0;
  border-radius: 0;
  transition: all 0.25s ease;
}

.sa-directions-btn:hover {
  background-color: #00acee;
}

.sa-streetview-btn:hover {
  background-color: #00acee;
}

#sa-map-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 130px;
  align-self: flex-start;
}

#sa-controls {
  display: flex;
  gap: 10px;
  width: 100%;
}

#sa-address-container {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

gmp-place-autocomplete {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#sa-map-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

#sa-map-actions .sa-directions-btn,
#sa-map-actions .sa-streetview-btn {
    flex: 1;
    width: auto;
    min-width: 0;
}

#sa-locate {
  flex-shrink: 0;
  padding: 12px 20px;
  border: 0;
  background: #bf1f24;
  color: #ffffff;
  font-size: .8rem;
  font-weight: 700;
  font-family: "Open Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#sa-locate:hover {
  background: #00acee;
}

.sa-search-icon {
  display: none;
}

#sa-map {
  height: 500px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

@media (max-width: 900px) {
  #service-area-tool {
    flex-direction: column;
    margin: 25px 15px;
    gap: 15px;
  }

  #sa-map-wrapper {
    order: 1;
    position: relative;
    top: auto;
    width: 100%;
  }

  #sa-sidebar {
    order: 2;
    width: 100%;
  }

  #sa-sidebar.is-open {
    flex: none;
    width: 100%;
    padding: 20px;
    transform: translateY(0);
  }

  #sa-controls {
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
  }

  #sa-address-container {
    flex: 1;
  }

  #sa-locate {
    width: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 0;
  }

  .sa-search-text {
    display: none;
  }

  .sa-search-icon {
    display: block;
    position: relative;
    width: 18px;
    height: 18px;
    border: 3px solid #ffffff;
    border-radius: 50%;
  }

  .sa-search-icon::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 3px;
    background: #ffffff;
    right: -7px;
    bottom: -4px;
    transform: rotate(45deg);
    border-radius: 2px;
  }

  #sa-map {
    height: 420px;
  }

  #sa-controls {
    order: 1;
  }

  #sa-map {
    order: 2;
  }

  #sa-map-actions {
    order: 3;
  }
}

@media (max-width: 480px) {

  #sa-controls {
    order: 1;
  }

  #sa-map {
    order: 2;
  }

  #sa-map-actions {
    order: 3;
  }
  
  #service-area-tool {
    margin: 15px 10px;
  }

  #sa-sidebar.is-open {
    padding: 16px;
  }

   #sa-agency-header {
    gap: 12px;
  }

  #sa-agency-logo-wrapper {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }

  #sa-agency-logo {
    max-width: 64px;
    max-height: 64px;
  }

  #sa-title {
  line-height: 1.2;
  }

  #sa-description {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  #sa-map {
    height: 350px;
  }

  #sa-locate {
    width: 46px;
    min-width: 46px;
  }

  #sa-map-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

#sa-map-actions .sa-directions-btn,
  #sa-map-actions .sa-streetview-btn {
      flex: 1;
      width: auto;
      min-width: 0;
  }

  .sa-search-icon {
    transform: scale(.9);
  }

  .sa-directions-btn {
    padding: 12px 15px;
    font-size: .75rem;
  }
}

#sa-sidebar-content {
  font-size: 1rem;
  line-height: 1.65;
  color: #333;
}

#sa-sidebar-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: #00acee;
  margin: 1.5rem 0 0.85rem;
}

#sa-sidebar-content h3:first-child {
  margin-top: 0;
}

#sa-sidebar-content p {
  margin: 0 0 1rem;
}

#sa-sidebar-content ul {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

#sa-sidebar-content li {
  margin-bottom: 0.6rem;
  line-height: 1.65;
}

#sa-sidebar-content .important-note {
  background: #fff5f5;
  border-left: 5px solid #c62828;
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.65;
}

#sa-sidebar-content .important-note strong {
  color: #b71c1c;
}

#sa-sidebar-content hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 1.75rem 0;
}