/* Maps Grid v2 — AVID Elevation campaign layout */

.madeneat-maps-grid-v2 {
    --mgv2-navy: #1e3f4b;
    --mgv2-teal: #00a499;
    --mgv2-border: #d4d4d4;
    --mgv2-toggle-bg: #e7e7e7;
    color: var(--mgv2-navy);
}

.madeneat-mgv2__title {
    font-size: 35px;
    line-height: 1.15;
    margin: 0 0 24px;
    color: var(--mgv2-navy);
}

.madeneat-mgv2__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.madeneat-mgv2__filter {
    flex: 0 1 280px;
    min-width: 200px;
}

.madeneat-mgv2__select {
    width: 100%;
    height: 52px;
    padding: 10px 20px;
    border: 1px solid var(--mgv2-border);
    border-radius: 30px;
    background: #fff;
    font-size: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
	line-height: 100%;
}

.madeneat-mgv2__select--multiple,
.madeneat-mgv2__select[multiple] {
    height: auto;
    min-height: 52px;
    max-height: 160px;
    padding: 10px 16px;
    border-radius: 16px;
    background-image: none;
    line-height: 1.4;
}

.madeneat-mgv2__view-toggle {
    display: flex;
    margin-left: auto;
    background: var(--mgv2-toggle-bg);
    border: 1px solid var(--mgv2-toggle-bg);
    border-radius: 30px;
    height: 52px;
    overflow: hidden;
    min-width: 280px;
}

.madeneat-mgv2__view-btn {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #000;
    padding: 0 16px;
}

.madeneat-mgv2__view-btn.is-active {
    background: #fff;
    border: 4px solid var(--mgv2-toggle-bg);
    border-radius: 30px;
}

.madeneat-mgv2__view-icon {
    width: 13px;
    height: 13px;
    display: inline-block;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.madeneat-mgv2__view-icon--grid {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Crect width='5' height='5' fill='black'/%3E%3Crect x='8' width='5' height='5' fill='black'/%3E%3Crect y='8' width='5' height='5' fill='black'/%3E%3Crect x='8' y='8' width='5' height='5' fill='black'/%3E%3C/svg%3E");
}

.madeneat-mgv2__view-icon--pin {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 15'%3E%3Cpath fill='black' d='M6 0C2.7 0 0 2.7 0 6c0 4.5 6 9 6 9s6-4.5 6-9c0-3.3-2.7-6-6-6zm0 8.2a2.2 2.2 0 110-4.4 2.2 2.2 0 010 4.4z'/%3E%3C/svg%3E");
}

.madeneat-mgv2__list-view.hidden,
.madeneat-mgv2__map-view.hidden {
    display: none !important;
}

.madeneat-mgv2__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.madeneat-mgv2__card {
    min-width: 0;
    position: relative;
}

.madeneat-mgv2__map-view {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    min-height: 600px;
    min-width: 0;
}

.madeneat-mgv2__map-col {
    flex: 1 1 60%;
    min-width: 0;
    position: static;
    align-self: flex-start;
}

.madeneat-mgv2__map.acf-map {
    width: 100%;
    height: 600px;
    min-height: 400px;
    border-radius: 5px;
}

.madeneat-mgv2__sidebar {
    flex: 0 1 40%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;   
}

@media (min-width: 992px) {
    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__stage {
        position: sticky;
        top: var(--mgv2-map-sticky-top, 120px);
        height: calc(100vh - var(--mgv2-map-sticky-top, 120px));
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 4;
        background: #fff;
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__filters {
        position: static;
        flex-shrink: 0;
        /* margin-bottom: 16px;
        padding-bottom: 8px; */
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__map-view {
        flex: 1 1 auto;
        min-height: 0;
        align-items: stretch;
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__map-col {
        position: static;
        align-self: stretch;
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__map.acf-map {
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__sidebar {
        align-self: stretch;
        height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        min-height: 0;
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__pagination-wrap {
        flex-shrink: 0;
        margin-top: 12px;
        padding-bottom: 8px;
    }

    .madeneat-maps-grid-v2.is-map-view .madeneat-mgv2__pagination {
        margin-top: 0;
    }
}

.madeneat-mgv2__card.is-highlighted {
    outline: 2px solid var(--mgv2-teal);
    outline-offset: 2px;
}

.madeneat-mgv2__map-tooltip {
    text-decoration: none !important;
    max-width: 240px;
    color: #1f1f1f;
}

.madeneat-mgv2__map-tooltip__content {
    padding: 0 !important;
    min-height: 0;
}

.madeneat-mgv2__map-tooltip .map-link {
    outline: none !important;
    text-decoration: none !important;
    display: block;
}

.madeneat-mgv2__map-tooltip .map-link img {
    display: block;
    width: 240px;
    height: auto;
    object-fit: cover;
    max-width: 100%;
    max-height: 180px;
}

.madeneat-mgv2__map-tooltip .map-link h2 {
    text-decoration: none !important;
    width: 240px;
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: inherit;
}

.madeneat-mgv2__map-tooltip .map-link.now-selling h2 {
    color: #00a499;
    outline: none;
    padding: 10px 10px 0;
}

.madeneat-mgv2__map-tooltip .map-link.sold-out h2,
.madeneat-mgv2__map-tooltip .map-link.completed h2 {
    color: #702f89;
    outline: none;
    padding: 10px 10px 0;
}

.madeneat-mgv2__map-tooltip .map-link.coming-soon h2 {
    color: #fdbe59;
    outline: none;
    padding: 10px 10px 0;
}

.madeneat-mgv2__map-tooltip p {
    width: 240px;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    padding: 10px 10px 12px;
    font-family: Campton, sans-serif;
    color: #1f1f1f;
    box-sizing: border-box;
}

/* Google Maps caps InfoWindow height on small viewports and clips the address. */
.madeneat-maps-grid-v2 .gm-style-iw-d {
    max-height: none !important;
    overflow: visible !important;
}

.madeneat-maps-grid-v2 .gm-style-iw-c {
    max-height: none !important;
    padding: 0 !important;
}

.gm-style-iw-chr {
    display: flex !important;
    flex-direction: row-reverse !important;
    align-self: flex-end !important;
    position: absolute !important;
}

.gm-style-iw-ch {
    padding: 0 !important;
}

/* Pagination */
.madeneat-mgv2__pagination {
    margin-top: 40px;
}

.madeneat-mgv2__pagination--center {
    text-align: center;
}

.madeneat-mgv2__pagination--left {
    text-align: left;
}

.madeneat-mgv2__pagination--right {
    text-align: right;
}

.madeneat-mgv2__pagination--load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.madeneat-mgv2__pagination--load-more.madeneat-mgv2__pagination--left {
    align-items: flex-start;
}

.madeneat-mgv2__pagination--load-more.madeneat-mgv2__pagination--right {
    align-items: flex-end;
}

.madeneat-mgv2__progress-text {
    margin: 0;
    font-size: var(--mgv2-progress-text-size, 16px);
    font-weight: var(--mgv2-progress-text-weight, 400);
    line-height: 1.4;
    color: var(--mgv2-progress-text-color, var(--mgv2-navy));
    text-align: var(--mgv2-progress-text-align, center);
}

.madeneat-mgv2__progress-track {
    width: 100%;
    max-width: var(--mgv2-progress-track-width, 246px);
    margin: 0;
    height: var(--mgv2-progress-height, 3px);
    background: var(--mgv2-progress-track, #e7e7e7);
    border-radius: 2px;
    overflow: hidden;
}

.madeneat-mgv2__progress-fill {
    height: 100%;
    background: var(--mgv2-progress-fill, var(--mgv2-teal));
    transition: width 0.3s ease;
}

.madeneat-mgv2__load-more {
    display: inline-block;
    min-width: var(--mgv2-loadmore-min-width, 212px);
    height: var(--mgv2-loadmore-height, 52px);
    padding: 0 var(--mgv2-loadmore-padding-x, 24px);
    border: var(--mgv2-loadmore-border-width, 2px) solid var(--mgv2-loadmore-border, var(--mgv2-teal));
    border-radius: var(--mgv2-loadmore-radius, 30px);
    background: var(--mgv2-loadmore-bg, var(--mgv2-teal));
    color: var(--mgv2-loadmore-color, #fff);
    font-size: var(--mgv2-loadmore-font-size, 18px);
    font-weight: var(--mgv2-loadmore-font-weight, 500);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.madeneat-mgv2__load-more:hover {
    background: var(--mgv2-loadmore-hover-bg, var(--mgv2-loadmore-bg, var(--mgv2-teal)));
    color: var(--mgv2-loadmore-hover-color, var(--mgv2-loadmore-color, #fff));
    border-color: var(--mgv2-loadmore-hover-border, var(--mgv2-loadmore-border, var(--mgv2-teal)));
}

.madeneat-mgv2__numbered {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mgv2-page-gap, 8px);
    justify-content: center;
}

.madeneat-mgv2__pagination--left .madeneat-mgv2__numbered {
    justify-content: flex-start;
}

.madeneat-mgv2__pagination--right .madeneat-mgv2__numbered {
    justify-content: flex-end;
}

.madeneat-mgv2__page-link {
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--mgv2-border);
    border-radius: 50%;
    background: transparent;
    color: var(--mgv2-page-inactive-color, var(--mgv2-navy));
    cursor: pointer;
    font-size: 15px;
}

.madeneat-mgv2__page-link.is-active {
    background: var(--mgv2-page-active-bg, var(--mgv2-navy));
    color: var(--mgv2-page-active-color, #fff);
    border-color: var(--mgv2-page-active-bg, var(--mgv2-navy));
}

@media (max-width: 991px) {
    .madeneat-mgv2__grid {
        grid-template-columns: 1fr;
    }

    .madeneat-mgv2__map-view {
        flex-direction: column;
    }

    .madeneat-mgv2__map-col {
        position: static;
        width: 100%;
    }

    .madeneat-mgv2__map.acf-map {
        height: 400px;
        min-height: 400px;
    }

    .madeneat-mgv2__sidebar {
        max-width: none;
        max-height: none;
    }

    .madeneat-mgv2__view-toggle {
        margin-left: 0;
        width: 100%;
    }

    .madeneat-mgv2__map-tooltip .map-link h2 {
        font-size: 24px;
        line-height: 1.15;
    }

    .madeneat-mgv2__map-tooltip .map-link img {
        max-height: 140px;
    }

    .madeneat-mgv2__map-tooltip p {
        font-size: 13px;
        padding: 8px 10px 12px;
    }
}
