/**
 * @file
 * Styles for Google Maps integration.
 */

/* Map container needs an explicit height for Google Maps to render. */
.search-map-paragraph {
  width: 100%;
}

.search-map-paragraph .map-container {
  width: 100%;
  height: 240px;
  min-height: 210px;
}

/* Outlined map pin for AdvancedMarkerElement (moved into the map pane). */
.mmm-map-marker-pin {
  position: relative;
  display: block;
  width: 28px;
  height: 36px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='36' viewBox='0 0 28 36'%3E%3Cpath fill-rule='evenodd' d='M14 36S25.5 22.5 25.5 14a11.5 11.5 0 1 0-23 0C2.5 22.5 14 36 14 36zM14 18.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9z' fill='%23ffffff'/%3E%3C/svg%3E");
}

/* currentColor does not work in background SVGs; use mask + theme variable instead. */
.mmm-map-marker-pin::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--primary-theme-color, #4700F0);
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='36' viewBox='0 0 28 36'%3E%3Cpath d='M14 36S25.5 22.5 25.5 14a11.5 11.5 0 1 0-23 0C2.5 22.5 14 36 14 36z' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='14' cy='14' r='4.5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='36' viewBox='0 0 28 36'%3E%3Cpath d='M14 36S25.5 22.5 25.5 14a11.5 11.5 0 1 0-23 0C2.5 22.5 14 36 14 36z' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='14' cy='14' r='4.5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
  pointer-events: none;
}

@media (min-width: 768px) {
  .search-map-paragraph .map-container {
    height: 300px;
    min-height: 270px;
  }
}

@media (min-width: 992px) {
  .search-map-paragraph .map-container {
    height: 100%;
    min-height: 360px;
  }
}

/* Google Maps info window container */
.gm-style .gm-style-iw-c {
  min-width: 280px !important;
  padding: 1.25rem !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

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

/* Google Maps Info Window close button positioning */
.gm-style-iw-chr {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
}

.gm-style-iw .map-info-window__title {
  margin: 0 1.75rem 0.75rem 0;
  color: var(--title-font-color, #000000);
  font-family: var(--primary-font);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.gm-style-iw .map-info-window__title:last-child {
  margin-bottom: 0;
}

.gm-style-iw .map-info-window__address,
.gm-style-iw .map-info-window__phone {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  color: var(--title-grey-color, #373536);
  font-size: 0.875rem;
  line-height: 1.4;
}

.gm-style-iw .map-info-window__address:last-child,
.gm-style-iw .map-info-window__phone:last-child {
  margin-bottom: 0;
}

.gm-style-iw .map-info-window__address i,
.gm-style-iw .map-info-window__phone i {
  flex-shrink: 0;
  width: 1rem;
  margin-top: 0.125rem;
  color: var(--link-color, #8a8a8a);
  font-size: 0.875rem;
  text-align: center;
}

.gm-style-iw .map-info-window__phone a {
  color: inherit;
  text-decoration: none;
}

.gm-style-iw .map-info-window__phone a:hover {
  text-decoration: underline;
}

.gm-style-iw .map-info-window__address-text {
  white-space: pre-line;
}

.map-info-window-template {
  display: none !important;
}

.gm-style-iw .map-info-window__directions {
  margin: 0.75rem 0 0;
}

.gm-style-iw .map-info-window__cta {
  display: inline-block;
  width: fit-content;
  margin: 0 !important;
  padding: 0.75rem 2.25rem;
  border-radius: 999px;
  font-family: var(--primary-font);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  background-color: color-mix(in srgb, var(--primary-theme-color, #4700f0) 8%, var(--footer-color, #ffffff));
  border: 1px solid var(--primary-theme-color, #4700f0);
  color: var(--primary-theme-color, #4700f0);
}

.gm-style-iw .map-info-window__cta:hover {
  background-color: var(--footer-color, #ffffff);
  color: var(--primary-darker-color, #3900bc);
}
