/* ========================================
   FIND EQUIPMENT PAGE
   ======================================== */

/* --- Page wrapper --- */
.sf-fe-page {
    font-family: 'Inter', sans-serif;
    color: #2D3436;
    background-color: #F5F6F5;
    min-height: 100vh;
}

/* --- Banner styles are in extra-style.css (shared across pages) ---*/

/* --- Container --- */
.sf-fe-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 0px 60px;
}

/* --- Search Card --- */
.sf-fe-search-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.sf-fe-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.sf-fe-search-input-wrap {
    position: relative;
    flex: 1 1 100%;
    display: flex;
    gap: 12px;
}

.sf-fe-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.sf-fe-search-input[type='text'] {
    width: 100%;
    flex: 1;
    height: 46px;
    background-color: #F5F6F5;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 12px 4px 40px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #2D3436;
    outline: none;
    box-sizing: border-box;
    box-shadow: none;
    margin: 0;
}

.sf-fe-search-input:focus {
    border-color: #334A34;
    background-color: #F5F6F5;
    box-shadow: none;
}

.sf-fe-search-input::placeholder {
    color: #636E72;
    letter-spacing: -0.15px;
}

.sf-fe-select-wrap {
    position: relative;
    flex: 1 1 160px;
    min-width: 140px;
}

.sf-fe-select-wrap--radius {
    flex: 0 0 160px;
    min-width: 140px;
    display: none;
    /* hidden for now */
}

/* Hide State and City filters for now — both :has() and direct selector for cross-browser support */
.sf-fe-select-wrap:has(#sf-fe-state-filter),
.sf-fe-select-wrap:has(#sf-fe-city-filter) {
    display: none;
}

/* Fallback for browsers without :has() support (older Safari/Chrome mobile) */
#sf-fe-state-filter,
#sf-fe-city-filter {
    display: none;
}

/* When the select itself is hidden, collapse the wrapper too */
.sf-fe-select-wrap:not(:has(> .sf-fe-select:not([style*='display: none']))) {
    min-height: 0;
}

.sf-fe-select {
    width: 100%;
    height: 46px;
    background-color: #F5F6F5;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 36px 4px 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #2D3436;
    letter-spacing: -0.15px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow: none;
    margin: 0;
}

.sf-fe-select:focus {
    border-color: #334A34;
    box-shadow: none;
}

.sf-fe-select-chevron {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* --- Results Bar --- */
.sf-fe-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 16px;
    margin-top: 16px;
}

.sf-fe-results-count {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #636E72;
    letter-spacing: -0.15px;
}

.sf-fe-results-count strong {
    font-weight: 500;
}

.sf-fe-view-toggle {
    display: flex;
    gap: 8px;
}

.sf-fe-view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #2D3436;
    letter-spacing: -0.15px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sf-fe-view-btn:hover {
    background: #F5F6F5;
}

.sf-fe-view-btn--active {
    background: #334A34;
    color: #FFFFFF;
    border-color: #334A34;
}

.sf-fe-view-btn--active:hover {
    background: #2a3d2b;
}

/* --- Content Area --- */
.sf-fe-content {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.sf-fe-map-area {
    flex: 1;
    min-height: 600px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sf-fe-map-placeholder {
    width: 100%;
    height: 100%;
    display: none;
    /* Hide the old placeholder, but keep it in markup if useful later */
}

/* Respect WP Maps Pro's inline map height; only normalize wrapper width. */
.sf-fe-map-area>div,
.sf-fe-map-area .wpgmp_map_container,
.sf-fe-map-area .wpgmp_map_parent {
    width: 100% !important;
}

.sf-fe-map-area .wpgmp_map {
    width: 100% !important;
    display: block !important;
}

@media screen and (min-width: 1201px) {
    .sf-fe-map-area {
        height: 700px;
        min-height: 700px;
    }

    .sf-fe-map-area > div,
    .sf-fe-map-area .wpgmp_map_container,
    .sf-fe-map-area .wpgmp_map_parent,
    .sf-fe-map-area .wpgmp_map {
        height: 100% !important;
    }
}

/* Prevent theme-wide responsive image rules from shrinking Google Maps tiles. */
.sf-fe-map-area .gm-style img,
.sf-fe-map-area .gm-style object,
.sf-fe-map-area .gm-style embed {
    max-width: none !important;
}

/* --- Cards Sidebar --- */
.sf-fe-cards {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 4px;
}

.sf-fe-cards::-webkit-scrollbar {
    width: 4px;
}

.sf-fe-cards::-webkit-scrollbar-track {
    background: transparent;
}

.sf-fe-cards::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* --- Equipment Card --- */
.sf-fe-card {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.sf-fe-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sf-fe-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 16px;
    position: relative;
    display: flex;
    flex-flow: column-reverse;
    flex-wrap: wrap;
    align-items: start;
    justify-content: start;
}

.sf-fe-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sf-fe-card-name {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 28px;
    letter-spacing: -0.44px;
    color: #2D3436;
    margin: 0;
}

.sf-fe-card-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.15px;
    color: #636E72;
}

/* --- Badges --- */
.sf-fe-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
    width: fit-content;
    margin-bottom: 10px;
}

.sf-fe-badge--verified {
    background-color: #326E32;
    color: #FFFFFF;
}

.sf-fe-badge--available {
    background-color: #E0EDE3;
    color: #2D3436;
}

.sf-fe-badge--booked {
    background-color: #FFF3CD;
    color: #856404;
}

/* --- Card Body --- */
.sf-fe-card-body {
    padding: 0 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sf-fe-card-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    flex: 1;
}

.sf-fe-spec {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.15px;
    color: #2D3436;
}

.sf-fe-spec-label {
    font-weight: 500;
}

.sf-fe-card-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    margin-top: 16px;
    background-color: #2D5016;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.15px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sf-fe-card-btn:hover {
    background-color: #224010;
    color: #FFFFFF;
    text-decoration: none;
}

/* --- Search Button --- */
.sf-fe-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 28px;
    background-color: #2D5016;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: none;
}

.sf-fe-search-btn:hover {
    background-color: #224010;
}

.sf-fe-search-btn:focus {
    outline: 2px solid #2D5016;
    outline-offset: 2px;
}

/* --- Empty State --- */
.sf-fe-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 24px;
    text-align: center;
    color: #636E72;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    grid-column: 1 / -1;
}

/* --- Pagination --- */
.sf-fe-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

.sf-fe-pagination ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sf-fe-pagination li {
    margin: 0;
}

.sf-fe-pagination a,
.sf-fe-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #2D3436;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.sf-fe-pagination a:hover {
    background: #F5F6F5;
    border-color: #334A34;
    color: #334A34;
    text-decoration: none;
}

.sf-fe-pagination .current {
    background: #334A34;
    color: #FFFFFF;
    border-color: #334A34;
    cursor: default;
}

.sf-fe-pagination .dots {
    border: none;
    background: none;
    cursor: default;
    min-width: 24px;
    padding: 0;
    color: #636E72;
}

.sf-fe-pagination .prev,
.sf-fe-pagination .next {
    font-weight: 500;
    letter-spacing: -0.15px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media screen and (max-width: 1200px) {
    .sf-fe-content {
        flex-direction: column;
    }

    .sf-fe-cards {
        width: 100%;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .sf-fe-map-area {
        min-height: 400px;
        width: 100%;
    }

    .sf-fe-container {
        padding: 24px 20px 60px;
    }
}

@media screen and (max-width: 768px) {
    .sf-fe-page {
        overflow-x: hidden;
    }

    /* Banner responsive rules are in extra-style.css */

    .sf-fe-container {
        padding: 16px 16px 40px;
    }

    .sf-fe-filters {
        flex-direction: column;
        gap: 8px;
    }

    .sf-fe-search-input-wrap {
        width: 100%;
    }

    .sf-fe-select-wrap {
        width: 100%;
        flex: none;
    }

    /* Ensure hidden state/city wrappers take zero space on mobile */
    .sf-fe-select-wrap:has(#sf-fe-state-filter),
    .sf-fe-select-wrap:has(#sf-fe-city-filter) {
        display: none !important;
        height: 0;
        margin: 0;
        padding: 0;
    }

    .sf-fe-search-btn {
        width: 100%;
    }

    .sf-fe-search-card {
        padding: 16px;
        border-radius: 8px;
    }

    .sf-fe-view-toggle {
        display: none;
    }

    .sf-fe-results-count {
        font-size: 14px;
    }

    .sf-fe-cards {
        grid-template-columns: 1fr;
    }

    .sf-fe-map-area {
        min-height: 250px;
    }

    .sf-fe-map-placeholder {
        min-height: 250px;
    }



    .sf-fe-card-header {
        padding: 16px 16px 12px;
    }

    .sf-fe-card-body {
        padding: 0 16px 16px;
    }

    .sf-fe-card-name {
        font-size: 16px;
        line-height: 24px;
    }
}

@media screen and (max-width: 480px) {
    /* Banner responsive rules are in extra-style.css */

    .sf-fe-container {
        padding: 12px 12px 32px;
    }

    .sf-fe-search-card {
        padding: 12px;
        margin-bottom: 16px;
    }

    .sf-fe-search-input[type='text'] {
        font-size: 15px;
        height: 42px;
    }

    .sf-fe-select {
        font-size: 15px;
        height: 42px;
    }

    .sf-fe-search-btn {
        font-size: 15px;
        height: 42px;
    }

    .sf-fe-pagination a,
    .sf-fe-pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 8px;
    }

    .sf-fe-map-area {
        min-height: 200px;
        border-radius: 8px;
    }

    .sf-fe-map-placeholder {
        min-height: 200px;
    }

    .sf-fe-content {
        gap: 16px;
    }

    .sf-fe-cards {
        gap: 12px;
    }
}

/* ─────────────────────────────────────────────
   Map marker infowindow popup
   ───────────────────────────────────────────── */

/* Reset Google Maps infowindow container */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15) !important;
    max-width: 280px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: none !important;
    padding: 0 !important;
}

/* Reset plugin wrapper */
.gm-style .gm-style-iw .fc-item-box {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Use the custom popup title instead of the plugin's built-in post title header. */
.sf-fe-map-area .wpgmp_iw_head {
    display: none !important;
}

/* Our popup */
.sf-map-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 14px 16px;
    min-width: 210px;
    max-width: 260px;
}

.sf-map-popup__title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
    line-height: 1.3;
}

.sf-map-popup__title a {
    color: inherit;
    text-decoration: none;
}

.sf-map-popup__title a:hover {
    color: #3b6e22;
}

.sf-map-popup__location {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.sf-map-popup__location svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.sf-map-popup__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sf-map-popup__type,
.sf-map-popup__status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: capitalize;
    line-height: 1.4;
}

.sf-map-popup__type {
    background: #f1f1f1;
    color: #555;
}

.sf-map-popup__status {
    background: #e8f5e9;
    color: #2e7d32;
}

.sf-map-popup__btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: #3b6e22;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.wpgmp_infowindow.fc-item-fano {
    max-width: 290px;
}

.wpgmp_infowindow.fc-item-fano .sf-map-popup {
    max-width: 290px;
}

.sf-map-popup__btn:hover {
    background: #2d5a18;
    color: #fff !important;
    text-decoration: none !important;
}