/**
 * Location Map — layout, marker images, and the popup card.
 *
 * The canvas height matches a regional store locator (500px). Popup
 * colours, type, spacing, border, and shadow come from the module Design
 * tab. These rules are the fallback and the reset that lets that card
 * replace the Google InfoWindow chrome.
 */

.spruce-location-map__canvas {
    width: 100%;
    height: 500px;
    background: #e8eef2;
}

.spruce-location-map .gm-style img {
    max-width: none !important;
    max-height: none !important;
}

.spruce-location-map__fallback,
.spruce-location-map__notice,
.spruce-location-map__preview {
    margin: 0;
}

.spruce-location-map__fallback {
    padding: 1em;
}

.spruce-location-map.is-ready .spruce-location-map__fallback {
    display: none;
}

.spruce-location-map__preview {
    margin-bottom: 0.75em;
}

.spruce-location-map__locations {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.spruce-location-map .gm-style-iw-c {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.spruce-location-map .gm-style-iw-d {
    overflow: visible !important;
    max-width: none !important;
    max-height: none !important;
}

.spruce-location-map .gm-style-iw-tc,
.spruce-location-map .gm-style-iw-t::after {
    display: none !important;
}

.spruce-location-map__popup {
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    max-width: 260px;
    padding: 12px 28px 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    font: 14px/1.45 Arial, Helvetica, sans-serif;
    color: #1a1a1a;
}

.spruce-location-map__popup p {
    margin: 0;
}

.spruce-location-map__name {
    font-weight: 700;
}

.spruce-location-map__info {
    box-sizing: border-box;
    white-space: pre-wrap;
}

.spruce-location-map__popup a {
    color: inherit;
}

/*
 * Every visible line is a p or an a inside Google's .gm-style wrapper.
 * Divi paints Popup Text on the card, which is enough for the background.
 * Theme and map rules then set color, font, and paragraph padding on those
 * inner nodes, so the card colour never reaches the words. Inherit from the
 * card, and let the more specific title and link rules below win.
 */
.spruce-location-map .gm-style .spruce-location-map__popup p,
.spruce-location-map .gm-style .spruce-location-map__popup a {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-style: inherit !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
    text-align: inherit !important;
    text-transform: inherit !important;
}

/*
 * Line gap is the only space between the other lines. The description is
 * left out so its own padding and margin can show.
 */
.spruce-location-map .gm-style .spruce-location-map__popup p:not(.spruce-location-map__info) {
    margin: 0 !important;
    padding: 0 !important;
}

.spruce-location-map .gm-style .spruce-location-map__popup .spruce-location-map__name {
    font-weight: 700;
}

/*
 * A fact line becomes a row only when that fact has an icon. The icon span
 * is omitted otherwise, so the line has no empty gap.
 */
.spruce-location-map__fact {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.spruce-location-map__fact-icon {
    display: inline-block;
    flex: 0 0 auto;
    line-height: 1;
}

.spruce-location-map .gm-style .spruce-location-map__popup .spruce-location-map__fact-icon:before,
.spruce-location-map .gm-style .spruce-location-map__reset .spruce-location-map__fact-icon:before {
    content: attr(data-icon) !important;
    display: block;
    line-height: 1 !important;
    font-style: normal !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.spruce-location-map .gm-style .spruce-location-map__popup .spruce-location-map__fact-icon[data-icon-family="ETmodules"]:before,
.spruce-location-map .gm-style .spruce-location-map__reset .spruce-location-map__fact-icon[data-icon-family="ETmodules"]:before {
    font-family: ETmodules !important;
    font-weight: 400 !important;
}

.spruce-location-map .gm-style .spruce-location-map__popup .spruce-location-map__fact-icon[data-icon-family="FontAwesome"]:before,
.spruce-location-map .gm-style .spruce-location-map__reset .spruce-location-map__fact-icon[data-icon-family="FontAwesome"]:before {
    font-family: FontAwesome !important;
    font-weight: 400 !important;
}

.spruce-location-map .gm-style .spruce-location-map__popup .spruce-location-map__fact-icon[data-icon-weight="900"]:before,
.spruce-location-map .gm-style .spruce-location-map__reset .spruce-location-map__fact-icon[data-icon-weight="900"]:before {
    font-weight: 900 !important;
}

/*
 * The view icon is its own row at the lower right, pulled into the card
 * padding so it does not sit on the description or the contact lines.
 */
.spruce-location-map__view {
    align-self: flex-end;
    display: inline-block;
    margin: 0 -14px -6px 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.spruce-location-map .gm-style .spruce-location-map__popup .spruce-location-map__view {
    margin: 0 -14px -6px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
}

/*
 * Top-left overlay. Hidden until the zoom leaves the starting level, and
 * removed from the corner when no icon is chosen. The glyph sits on an inner
 * span so the button's own baseline layout cannot shift it. That span's
 * :before is a 1em square, centered in the control.
 */
.spruce-location-map__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    height: auto;
    margin: 10px;
    padding: 6px;
    border: 0;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    line-height: 0;
    text-align: center;
    cursor: pointer;
    color: #1a1a1a;
    appearance: none;
    -webkit-appearance: none;
}

.spruce-location-map .gm-style button.spruce-location-map__reset {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 10px !important;
    padding: 6px !important;
    border: 0 !important;
    line-height: 0 !important;
    text-align: center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.spruce-location-map .gm-style .spruce-location-map__reset .spruce-location-map__fact-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

.spruce-location-map .gm-style .spruce-location-map__reset .spruce-location-map__fact-icon:before {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 1em !important;
    height: 1em !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
}

.spruce-location-map .gm-style button.spruce-location-map__reset[hidden] {
    display: none !important;
}
