/**
 * Greater Zion Map Popup Fixes
 * CSS to fix styling issues with Google Maps info windows
 */

/* Reset any existing styles */
body .gm-style .gm-style-iw-c,
body .gm-style-iw.gm-style-iw-c {
    padding: 0 !important;
    border-radius: 0 !important;
    max-width: 330px !important;
    min-width: 330px !important;
    width: 330px !important;
    box-shadow: 0 2px 7px 1px rgba(0, 0, 0, 0.3) !important;
    overflow: visible !important;
}

/* Hide the white bar at top */
.gm-style-iw-chr {
    display: none !important;
}

/* Also hide any potential padding containers */
.gm-style .gm-style-iw-c > div:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Meeting Venues title bar */
body .gm-style .gm-style-iw-c .meeting-venues,
body .gm-style-iw.gm-style-iw-c .meeting-venues,
body #map .gm-style .gm-style-iw-c .meeting-venues {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    background-color: rgba(54, 75, 84, 0.6) !important;
    color: white !important;
    padding: 15px !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    z-index: 2 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5) !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Close button container reset */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect,
.gm-style-iw.gm-style-iw-c button.gm-ui-hover-effect,
.gm-style button.gm-ui-hover-effect {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 48px !important;
    height: 48px !important;
    background-color: #eb6b40 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    min-width: 48px !important;
    min-height: 48px !important;
    color: #FFF !important;
}

/* Close button icon container */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect > span,
.gm-style-iw.gm-style-iw-c button.gm-ui-hover-effect > span,
.gm-style button.gm-ui-hover-effect > span {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #FFF !important;
}

/* Close button icon */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect > span > img,
.gm-style-iw.gm-style-iw-c button.gm-ui-hover-effect > span > img,
.gm-style button.gm-ui-hover-effect > span > img {
    width: 24px !important;
    height: 24px !important;
    filter: brightness(0) invert(1) !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    background: transparent !important;
}

/* View Details button */
body .gm-style .gm-style-iw-c .view-details,
body .gm-style-iw.gm-style-iw-c .view-details,
body .gm-style .gm-style-iw-c a[href*="greaterzion.com"],
body .gm-style-iw.gm-style-iw-c a[href*="greaterzion.com"],
body .gm-style-iw-d #bodyContent a.view-details-btn,
body #map .gm-style-iw-d .view-details-btn {
    display: block !important;
    width: calc(100% - 30px) !important;
    margin: 15px auto !important;
    padding: 12px 20px !important;
    background-color: #eb6b40 !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 200px !important;
}

/* Title for non-image popups */
.gm-style .gm-style-iw-c h4#firstHeading:not(.header-section *),
.gm-style-iw.gm-style-iw-c h4#firstHeading:not(.header-section *) {
    margin: 0 !important;
    padding: 15px !important;
    background-color: rgba(54, 75, 84, .9) !important;
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Content area */
.gm-style .gm-style-iw-d,
.gm-style-iw.gm-style-iw-c .gm-style-iw-d {
    overflow: hidden !important;
    max-width: 100% !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Content area body */
.gm-style .gm-style-iw-d #bodyContent,
.gm-style-iw.gm-style-iw-c .gm-style-iw-d #bodyContent {
    padding: 15px !important;
    text-align: center !important;
    background: white !important;
    position: relative !important;
    z-index: 4 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Remove the tail/arrow */
.gm-style .gm-style-iw-t::after,
.gm-style-iw.gm-style-iw-t::after {
    display: none !important;
}

.gm-style-iw-c {
    padding: 0 !important;
    max-width: none !important;
    border-radius: 4px !important;
}

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

/* Header/Category text styling */
.meeting-venues,
.grocery-stores,
.venue-type {
    display: block !important;
    width: 100% !important;
    color: #fff !important;
    padding: 5px 10px !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    position: relative !important;
    z-index: 2 !important;
}

.gz-info-window-wrapper {
    position: relative;
    padding: 0;
    max-width: 300px;
    background: #fff;
}

.gz-info-window-wrapper.no-image {
    background-color: rgba(54, 75, 84, .9) !important;
    padding: 0;
    color: #fff;
}

.gz-info-window-wrapper.no-image .content-wrapper {
    padding: 15px;
}

.gz-info-window-wrapper.no-image h2,
.gz-info-window-wrapper.no-image h4#firstHeading {
    color: #fff !important;
    margin: 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.gz-info-window-wrapper.with-image {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.gz-image-container {
    position: relative;
    width: 100%;
}

.gz-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px 4px 0 0;
}

.gz-text-container {
    padding: 15px;
    background-color: rgba(54, 75, 84, .9);
    color: #fff;
    position: relative;
    z-index: 1;
}

.gz-view-details {
    display: inline-block !important;
    padding: 12px 24px !important;
    background-color: #eb6b40 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    margin: 15px auto !important;
    transition: background-color 0.3s ease !important;
    text-align: center !important;
    width: auto !important;
    min-width: 160px !important;
}

.gz-view-details:hover {
    background-color: #d55c35 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Fix close button */
.gm-ui-hover-effect {
    top: 0 !important;
    right: 0 !important;
    background: rgba(54, 75, 84, .9) !important;
    border-radius: 0 4px 0 4px !important;
    z-index: 3 !important;
}

.gm-ui-hover-effect img {
    width: 20px !important;
    height: 20px !important;
    margin: 8px !important;
    filter: invert(1);
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .gz-info-window-wrapper {
        max-width: 260px;
    }
    
    .gz-info-window-wrapper.no-image h2,
    .gz-info-window-wrapper.no-image h4#firstHeading {
        font-size: 16px;
    }
}

/* Fix map scroll shrinking issue */
.greater-zion-listing-map-slider {
    height: auto !important;
    min-height: 600px !important;
    display: flex !important;
    flex-direction: column !important;
}

.greater-zion-listing-map-slider #map {
    flex: 1 !important;
    min-height: 400px !important;
    height: 100% !important;
    position: relative !important;
}

.greater-zion-listing-map-slider .listing-slider {
    position: relative !important;
    height: auto !important;
    min-height: 200px !important;
}

.greater-zion-listing-map-slider .listing-slider .posts-box {
    position: relative !important;
    height: auto !important;
    min-height: 200px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    display: flex !important;
    gap: 20px !important;
    padding: 20px !important;
    scroll-behavior: smooth !important;
}

/* Make images square and remove clip-path */
.greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
.greater-zion-listing-map-slider article .image-container {
    clip-path: none !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    aspect-ratio: 1/1 !important;
    width: 100% !important;
    height: auto !important;
    position: relative !important;
}

.greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap img,
.greater-zion-listing-map-slider article .image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Remove all clip paths from images and text */
.greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
.greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap,
.greater-zion-listing-map-slider article .image-container,
element.style,
[style*="clip-path"],
[style*="-webkit-clip-path"] {
    -webkit-clip-path: none !important;
    clip-path: none !important;
}

/* Ensure specific selectors override any other styles */
.greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap {
    -webkit-clip-path: none !important;
    clip-path: none !important;
    height: 325px !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
}

.greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    -webkit-clip-path: none !important;
    clip-path: none !important;
    background-color: #d5d2d2;
    padding: 1rem;
    overflow: hidden;
}

/* Override any inline styles */
.greater-zion-listing-map-slider *[style*="clip-path"],
.greater-zion-listing-map-slider *[style*="-webkit-clip-path"] {
    -webkit-clip-path: none !important;
    clip-path: none !important;
}

/* Force remove clip paths with maximum specificity */
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    border-radius: 0 !important;
}

/* Override theme styles with maximum specificity */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap {
    clip-path: unset !important;
    -webkit-clip-path: unset !important;
    height: 325px !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    clip-path: unset !important;
    -webkit-clip-path: unset !important;
    background-color: #d5d2d2 !important;
    padding: 1rem !important;
    overflow: hidden !important;
}

/* Additional override for any dynamic styles */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post *[style*="clip-path"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
}

/* Reset any transforms that might affect the layout */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post {
    transform: none !important;
}

/* Ensure images fill the container properly */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Fix close button visibility */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect,
.gm-style-iw.gm-style-iw-c button.gm-ui-hover-effect {
    background-color: #eb6b40 !important;
    top: 0 !important;
    right: 0 !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    border: none !important;
}

/* Style close button icon */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect img,
.gm-style-iw.gm-style-iw-c button.gm-ui-hover-effect img {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    filter: brightness(0) invert(1) !important;
}

/* Ensure info window has proper padding for close button */
.gm-style .gm-style-iw.gm-style-iw-c {
    padding-right: 30px !important;
}

/* Remove any transforms that might interfere */
.gm-style .gm-style-iw-c > * {
    transform: none !important;
}

/* Remove all clip paths with absolute maximum specificity */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap {
    position: relative !important;
    width: 100% !important;
    height: 325px !important;
    overflow: hidden !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override any possible clip path variations */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap[style],
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap[class] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Target any element with clip-path in inline styles */
html body *[style*="clip-path"],
html body *[style*="-webkit-clip-path"],
html body *[style*="clip:"],
html body *[style*="-webkit-clip:"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Remove clip paths from text-wrap with maximum specificity */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap,
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap.has-black-gray-color {
    position: relative !important;
    padding: 1rem !important;
    overflow: hidden !important;
    background-color: #d5d2d2 !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override any possible clip path variations for text-wrap */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap[style],
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap[class],
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap.has-black-gray-color[style],
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap.has-black-gray-color[class] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Global clip-path overrides with maximum specificity */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post *,
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override theme mixins */
html body .greater-zion-listing-map-slider [class*="curved-"],
html body .greater-zion-listing-map-slider [class*="clip"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override any dynamic styles */
html body .greater-zion-listing-map-slider *[style*="ellipse"],
html body .greater-zion-listing-map-slider *[style*="clip"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Ensure specificity for text-wrap and image-wrap */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post > .text-wrap,
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post > .image-wrap {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
    transform: none !important;
}

/* Force remove all clip paths with maximum specificity */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap,
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post > div,
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post *[class*="wrap"],
html body .greater-zion-listing-map-slider [class*="curved-"],
html body .greater-zion-listing-map-slider [class*="clip"],
#map .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
#map .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    position: relative !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
    transform: none !important;
}

/* Override any inline styles */
html body .greater-zion-listing-map-slider *[style*="clip-path"],
html body .greater-zion-listing-map-slider *[style*="-webkit-clip-path"],
html body .greater-zion-listing-map-slider *[style*="clip:"],
html body .greater-zion-listing-map-slider *[style*="-webkit-clip:"],
html body .greater-zion-listing-map-slider *[style*="ellipse"],
#map .greater-zion-listing-map-slider *[style*="clip-path"],
#map .greater-zion-listing-map-slider *[style*="-webkit-clip-path"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override theme mixins and utilities */
html body .greater-zion-listing-map-slider [class*="curved-"],
html body .greater-zion-listing-map-slider [class*="clip"],
html body .greater-zion-listing-map-slider [class*="ellipse"],
#map .greater-zion-listing-map-slider [class*="curved-"],
#map .greater-zion-listing-map-slider [class*="clip"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Ensure proper styling for text-wrap */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap,
#map .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    background-color: #d5d2d2 !important;
    padding: 1rem !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Ensure proper styling for image-wrap */
html body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
#map .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap {
    height: 325px !important;
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Override _mixins.scss and _blocks-listing-map-slider.scss styles */
body .greater-zion-listing-map-slider .listing-slider,
body .greater-zion-listing-map-slider .listing-slider .posts-box,
body .greater-zion-listing-map-slider .listing-slider .posts-box .post,
body .greater-zion-listing-map-slider .listing-slider .posts-box .post > *,
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap,
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override any mixin-generated styles */
body .greater-zion-listing-map-slider .listing-slider [class*="curved-"],
body .greater-zion-listing-map-slider .listing-slider [class*="clip-"],
body .greater-zion-listing-map-slider .listing-slider [style*="ellipse"],
body .greater-zion-listing-map-slider .listing-slider [style*="clip-path"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Direct override for image-wrap */
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap {
    position: relative !important;
    width: 100% !important;
    height: 325px !important;
    overflow: hidden !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Direct override for text-wrap */
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    position: relative !important;
    background-color: #d5d2d2 !important;
    padding: 1rem !important;
    overflow: hidden !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Override any dynamic styles */
body .greater-zion-listing-map-slider .listing-slider *[style*="clip-path"],
body .greater-zion-listing-map-slider .listing-slider *[style*="-webkit-clip-path"],
body .greater-zion-listing-map-slider .listing-slider *[style*="clip:"],
body .greater-zion-listing-map-slider .listing-slider *[style*="-webkit-clip:"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Ensure images fill their containers properly */
body .greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    position: relative !important;
}

/* Remove top bar and fix clip-path */
.greater-zion-listing-map-slider .listing-slider .posts-box .post {
    all: unset !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    background: white !important;
}

.greater-zion-listing-map-slider .listing-slider .posts-box .post *,
.greater-zion-listing-map-slider .listing-slider .posts-box .post *::before,
.greater-zion-listing-map-slider .listing-slider .posts-box .post *::after {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}

/* Image container styles */
.greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap {
    all: unset !important;
    display: block !important;
    width: 100% !important;
    height: 325px !important;
    position: relative !important;
    overflow: hidden !important;
}

.greater-zion-listing-map-slider .listing-slider .posts-box .post .image-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Text container styles */
.greater-zion-listing-map-slider .listing-slider .posts-box .post .text-wrap {
    all: unset !important;
    display: block !important;
    background-color: #d5d2d2 !important;
    padding: 1rem !important;
    position: relative !important;
}

/* Center View Details button */
.gz-view-details,
body .gm-style .gm-style-iw-c .view-details,
body .gm-style-iw.gm-style-iw-c .view-details,
body .gm-style .gm-style-iw-c a[href*="greaterzion.com"],
body .gm-style-iw.gm-style-iw-c a[href*="greaterzion.com"],
body .gm-style-iw-d #bodyContent a.view-details-btn,
body #map .gm-style-iw-d .view-details-btn {
    display: block !important;
    width: auto !important;
    max-width: 200px !important;
    margin: 15px auto !important;
    padding: 12px 20px !important;
    background-color: #eb6b40 !important;
    color: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Remove any remaining clip paths */
.greater-zion-listing-map-slider *,
.greater-zion-listing-map-slider *::before,
.greater-zion-listing-map-slider *::after {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    clip: none !important;
    -webkit-clip: none !important;
}