#map {
    width: 100%;
    height: calc(100dvw / 3);
    border-bottom: var(--border);
}

/* Hide "Keyboard shortcuts" and other Google Maps links */
#map a[href*="keyboard"],
#map a[href*="shortcuts"],
#map a:contains("Scorciatoie"),
#map a:contains("Keyboard"),
#map .gm-style-cc a[href*="keyboard"],
#map .gm-style-cc a[href*="shortcuts"],
#map .gm-style-cc a {
    display: none !important;
    visibility: hidden !important;
}

/* Hide all links in Google Maps copyright section */
#map .gm-style-cc {
    display: none !important;
}

/* Hide "Terms" and "Report an error" links if present */
#map a[href*="terms"],
#map a[href*="report"],
#map a[href*="error"] {
    display: none !important;
}

/* Hide scroll/zoom warning aggressively */
#map *[title*="scorrimento"],
#map *[title*="scroll"],
#map *[aria-label*="scorrimento"],
#map *[aria-label*="scroll"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide gm-style-moc */
#map .gm-style-moc {
    display: none !important;
    visibility: hidden !important;
}

/* -------------------- INFO WINDOW -------------------- */
/* InfoWindow container */
#map .gm-style-iw {
    width: min(320px, calc(100dvw - 2*var(--grid-margin))) !important;
    max-width: calc(100dvw - 2*var(--grid-margin)) !important;
    padding: 0 !important;
    border: var(--border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: var(--white) !important;
}

/* InfoWindow content wrapper */
#map .gm-style-iw-c,
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    max-width: calc(100dvw - 2*var(--grid-margin)) !important;
    top: 4px !important;
}

/* InfoWindow content div */
#map .gm-style-iw-d {
    padding: 0 !important;
    overflow: visible !important;
    max-width: calc(100dvw - 2*var(--grid-margin)) !important;
}

/* InfoWindow arrow/tail pointing to pin */
#map .gm-style-iw-t {
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Hide InfoWindow top container */
#map .gm-style-iw-tc,
.gm-style .gm-style-iw-tc {
    display: none !important;
}

#map .gm-style-iw-t::after {
    background-color: var(--white) !important;
    border: var(--border) !important;
    border-top: none !important;
}

/* InfoWindow bubble tail (the arrow pointing down) */
#map .gm-style-iw-b {
    background-color: var(--white) !important;
    border: var(--border) !important;
    border-top: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Custom info window content */
.map-info-window {
    width: min(320px, calc(100dvw - 2*var(--grid-margin)));
    padding: var(--menu-brick-padding);
    max-width: calc(100dvw - 2*var(--grid-margin));
}

.map-info-window-title {
    margin: 0;
}

.map-info-window-title a {
    text-decoration: none;
    color: inherit;
}

.map-info-window-title a:hover {
    background-color: var(--black) !important;
    color: var(--white) !important;
}

.map-info-window-location {
    margin-top: 4px;
    margin-bottom: 0;
    font-size: var(--fs-xxs);
    line-height: var(--lh);
}

.map-info-window-address {
    margin-top: 0;
    margin-bottom: 0;
    font-size: var(--fs-xxs);
    line-height: var(--lh);
}

/* Hide default Google Maps close button */
#map .gm-ui-hover-effect,
#map .gm-style-iw-ch {
    display: none !important;
}

/* Custom close button styling */
.map-info-window-close {
    position: absolute;
    top: var(--menu-brick-padding);
    right: var(--menu-brick-padding);
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}

.map-info-window-close svg {
    width: 13px;
    height: 13px;
    display: block;
    pointer-events: none;
}

.map-info-window {
    position: relative;
}

/* Mobile */
@media screen and (max-width: 1023px) {
    #map {
        width: 100%;
        height: 100vw
    }
}