/**
 * CSS styles;
 */

 .hidden {
    display: none;
}

/* Search Map */

.grm-search-container {
    position: relative;
    display: flex;
    flex-direction: row;
    z-index: 5;
}
.grm-map-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.grm-top-bar {
    position: relative;
    margin: 0 0 1rem 0;
    z-index: 10;
}
.grm-map {
    position: relative;
    width: 100%;
    height: 100%;
}
.grm-sidebar {
    width: 30%;
    position: relative;
    max-width: 320px;
    max-height: 100%;
}

@media(max-width: 768px) {
    .grm-sidebar {
        width: 35%;
    }
}

.grm-sidebar-closed {
    width: 0px;
}
.grm-sidebar-header {
    position: relative;
    width: 100%;
    background-color: #efefef;
    border-bottom: 1px solid #dddddd;
    padding: 0.5em 1em;
    z-index: 10;
}
.grm-sidebar-header .grm-sort {
    padding-top: 0.25rem;
}
.grm-sidebar-results {
    display: block;
    font-weight: 500;
}
.grm-sidebar-listings {
    position: relative;
    width: 100%;
    height: calc(100% - 150px);
    padding: 10px 10px 0 1rem;
    background-color: #efefef;
    border-bottom: 1px solid #dddddd;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 10;
}
.grm-sidebar-listings-inner {
    position: relative;
    width: 100%;
    height: 100%;
}
.grm-sidebar-listings-loading {
    padding: 3em;
    width:  100%;
    text-align: center;
}
.grm-sidebar-paging {
    position: relative;
    width: 100%;
    padding: 0.5em 1em;
    background-color: #efefef;
    z-index: 10;
    overflow: hidden;
}
.grm-sidebar-paging .grm-pagingation-label {
    font-weight: 500;
    font-size: 1.1rem;
}
.grm-sidebar-paging .grm-pagination {
    display: flex;
    align-items: flex-end;
    gap: 0.25em;
    margin: 0.5rem 0;
}
.grm-sidebar-paging .grm-pagination .page {
    display: inline-block;
    height: inherit;
    padding: 0 0.25rem;
    color: var(--contrast);
    cursor: pointer;
}
.grm-pagination .page.active, .grm-pagination .page:hover {
    background: var(--accent);
    color: var(--base);
    font-weight: 700;
}
.grm-sidebar-slide-toggle {
    position: absolute;
    display: flex;
    align-items: center;
    width: 25px;
    top: calc(50% - 20px);
    right: -23px;
    height: 40px;
    background-color: var(--white);
    box-shadow: 0px 4px 5px 0px rgba(0, 0, 0, 0.25);
    border-radius: 0 15px 15px 0;
    font-weight: bold;
    z-index: 10;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.grm-sort select {
    padding:  0.25rem;
    width: 100%;
    background-color: var(--base-3);
    font-size: 0.8rem;
}
.main_search .grm-facet input, .main_search .grm-facet select, .main_search .grm-facet .facet-select-mim {
    font-size: var(--wp--preset--font-size--small);
}

/* Listing Cards */

.grm-listing-card {
    margin-bottom: 0.75em;
    background: var(--base-3);
    padding: 0.25em;
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.2);
}
.grm-listing-link {
    display: flex;
    gap: 0.5rem;
    position: relative;
    text-decoration: none;
    color: var(--text);
}
@media(max-width: 992px) {
    .grm-listing-link {
        flex-direction: column;
    }
}
.grm-listing-body {
    font-size: 0.8rem;
}
.grm-listing-body span {
    display: block;
}
.grm-listing-body span.grm-listing-price {
    color: var(--primary);
    font-size: 0.9rem;
}
.grm-listing-thumbnail img{
    max-width: 115px;
    vertical-align: top;
    height: 84px;
    width: 115px;
    object-fit: contain;
}
.grm-listing-status {
    display: inline-block;
    position: absolute;top: 0;
    left: 0;
    z-index: 10;
    background: var(--contrast-3);
    color: var(--base);
}
.grm-listing-price {
    font-weight: bold;
}

/* Facet Filters */

.grm-filters-container {
    display: grid;
    gap: 1.25rem;
    z-index: 20;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 5%;
}
.grm-filters-container .main_search {
    display: flex;
    border-radius: 10px;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    background-color: #fff;
    width: 100%;
    grid-column: -1 / 1;
    grid-gap: unset;
}
.grm-filters-container .main_search .grm-facet:first-child {
    border-top-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
.grm-filters-container .ts-wrapper.single .ts-control {
    border-radius: 10px;
}
.main_search .grm-facet {
    display: flex;
    flex-direction: column;
    flex: 1 1 25%;
    position: relative;
}
.grm-filters-container .main_search input,
.grm-filters-container .main_search select,
.grm-filters-container .main_search .ts-control {
    border: none;
    text-align: center;
    appearance: none;
    cursor: pointer;
}
.grm-filters-container .main_search input,
.grm-filters-container .main_search select {
    background: 0 0;
    border: none;
    padding: .5rem;
    color: #000;
    height: 100%;
    flex: 1 1 auto;
}
.grm-filters-container .main_search .grm-facet:not(:nth-child(3))::after {
    content: "";
    position: absolute;
    display: block;
    height: 1rem;
    width: 0;
    border-left: 1px solid var(--primary);
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
    margin: auto;
}
.grm-filters-container .main_search .ts-wrapper .ts-control>div.item {
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.grm-filters-container .main_search .ts-wrapper .ts-control input:focus {
    text-align: left;
}
.grm-filters-container .main_search .ts-wrapper.focus .ts-control>div.item {
    position: absolute;
    pointer-events: none;
}
.grm-filters-container .main_search .facet-select-mim::after {
    display: none;
}
.grm-filters-container .main_search .grm-facet select, .grm-facet input {
    width: 100%;
}
.grm-filters-container .main_search .grm-facet .facet_min {
    width: 100%;
}
.grm-filters-container .main_search .grm-facet .ts-control {
    height: 100%;
}
.grm-filters-container .main_search .grm-facet label {
    display: none;
}
.grm-filters-container .main_search .grm-facet.facet-minmax-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.grm-filters-container .main_search .grm-facet .facet-select-dd {
    width: 100%;
}
.grm-filters-container .main_search button {
    position: relative;
    flex: 0 1 min-content;
    border-left-width: 1px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: var(--primary);
}

/* Legend */

.grm-legend {
    position: absolute;
    bottom: 30px;
    left: 25px;
    background: white;
    border: 1px solid var(--contrast);
    z-index: 999;
    padding: 0.25rem 0.5em;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}
.grm-legend h3 {
    font-size: 1.25rem;
    margin: 0.25rem 0;
}
.grm-legend ul {
    margin: 0.25rem 0;
    list-style: none;
    padding: 0 1rem 0;
}

/* options */

.grm-options {
    position: absolute;
    top: 10px;
    right: 55px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.grm-options-open {
    background: white;
    color: var(--base);
    font-size: 0.9rem;
    height: 40px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
}
.grm-options-open i {
    pointer-events: none;
}
.grm-options-items {
    padding: 0.5rem;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    background: white;
}
.grm-options-items ul {
    list-style: none;
    margin: 0 0 0 0.5rem;
}
.grm-options-items ul li input {
    margin-right: 8px;
}
.grm-options-items ul li {
    font-size: 0.8rem;
}

/* Responsive Styles */

@media(max-width: 768px) {
    .grm-filters-container .main_search {
       flex-direction: column;
    }
    .grm-filters-container .grm-facet {
        width: 100%;
        flex: 1 1 100%;
        max-width: 100%;
    }
    .grm-filters-container .grm-facet:first-child {
        border-bottom-left-radius: 0px;
        border-top-right-radius: 10px;
    }
    .grm-filters-container .main_search .grm-facet:not(:nth-child(5))::after {
        display: none;
    }
    .grm-filters-container .main_search .grm-facet:not(:first-child) {
        border-top: 1px solid var(--primary);
    }
    .grm-filters-container .main_search button {
        padding: 1.25rem;
        border-bottom-left-radius: 10px;
        border-top-right-radius: 0px;
    }
    .grm-filters-container .ts-wrapper .ts-control>div.item {
        width: 100%;
    }
    .grm-filters-container .grm-facet:first-child .ts-wrapper .ts-control {
        border-bottom-left-radius: 0px;
        border-top-right-radius: 10px;
    }
    .grm-listing-thumbnail img {
        width: 100%;
    }
}
@media only screen and (max-width: 768px) {
    div.grm-search-container {
        flex-direction: column;
    }
    div.grm-map-container {
        width: 380px;
    }
    div.grm-sidebar {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin-top: 20px;
    }
    div.grm-sidebar-header {
        display: none;
    }
    div.grm-sidebar-listings {
        display: block;
        width: 100%;
        min-height: 23vh;
        overflow: hidden;
        padding: 0;
        border: none;
    }
    div.grm-sidebar-listings-inner {
        display: flex;
        flex-direction: row;
    }
    div.grm-sidebar-listings-inner::-webkit-scrollbar {
        display: none;
    }
    div.grm-sidebar-listings-mobile-buttons {
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        margin: 0.5em 0 1em;
    }
    div.grm-sidebar-listings-mobile-buttons a.grm-sidebar-listings-prev,
    div.grm-sidebar-listings-mobile-buttons a.grm-sidebar-listings-next {
        display: block;
        height: 18px;
        width: 18px;
        border-color: #000;
        border-width: 2px;
    }
    div.grm-sidebar-listings-mobile-buttons a.grm-sidebar-listings-prev {
        border-left-style: solid;
        border-bottom-style: solid;
        transform: rotate(45deg);
    }
    div.grm-sidebar-listings-mobile-buttons a.grm-sidebar-listings-next {
        border-left-style: solid;
        border-bottom-style: solid;
        transform: rotate(-135deg);
    }
    article.grm-listing-card {
        flex: 0 0 118px;
        height: calc(100% - 0.7em);
        margin: 0 5px;
    }
    div.grm-sidebar-slide-toggle {
        display: none;
    }
    div.grm-listing-body {
        min-height: 7em;
    }
    span.grm-listing-info {
        display: none;
    }
    div#general-map-search-container {
        margin: 0 1em;
        height: auto;
        flex-direction: column-reverse;
    }
    div#general-map-legend h3 {
        font-size: 0.9rem;
    }
    div#general-map-legend ul {
        padding-left: 0;
    }
    div#general-map-legend li {
        font-size: 0.8rem;
    }
}
@media(min-width: 768px) {
    .grm-sidebar-listings-prev, .grm-sidebar-listings-next {
        display: none;
    }
    .grm-sidebar-listings-inner {
        left: 0 !important;
    }
}
@media(max-width: 1125px) {
    .grm-sidebar-listings {
        height: calc(100% - 200px);
    }
}
@media(max-width: 500px) {
    .grm-sidebar-listings {
        height: calc(100% - 250px);
    }
}
