/* ==========================================================================
   RESF - Frontend Styles
   ========================================================================== */

:root {
    --resf-border: #e2e8f0;
    --resf-bg: #f8fafc;
    --resf-text: #334155;
    --resf-text-light: #64748b;
    --resf-radius: 8px;
    --resf-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.resf-loading-opacity {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Spinner */
.resf-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--resf-border);
    border-top-color: var(--resf-primary);
    border-radius: 50%;
    animation: resf-spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes resf-spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   HERO SEARCH
   ═══════════════════════════════════════════════════════════════ */
.resf-hero-search {
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

/* Floating Tabs */
.resf-hero-search__tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
    width: max-content;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 12px 24px 12px 24px;
}

.resf-hero-tab {
    background: transparent !important;
    border: none !important;
    padding: 8px 24px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    color: #1a1a1a !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: all 0.2s !important;
}

.resf-hero-tab:hover {
    color: var(--resf-primary) !important;
}

.resf-hero-tab--active {
    background: #00a651 !important; /* Green from the design */
    color: #fff !important;
}

.resf-hero-tab--active:hover {
    color: #fff !important;
}

/* Form Wrapper */
.resf-hero-search__form-wrapper {
    background: #fff !important;
    padding: 24px 32px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
}

.resf-hero-search__form {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-end;
}

.resf-hs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    flex: 1;
}

.resf-hs-field {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.resf-hs-field--range {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex: 2; /* takes more space */
}

.resf-hs-field-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resf-hs-field label, .resf-hs-field-half label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    display: block;
    margin: 0 !important;
}

.resf-hs-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.resf-hs-input-wrap i {
    position: absolute;
    right: 12px;
    color: #00a651 !important; /* Green icon */
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
}

.resf-select, .resf-input {
    width: 100% !important;
    padding: 14px 40px 14px 14px !important; /* 40px on right for icon in RTL */
    border: none !important;
    background: #fafafa !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: #666 !important;
    transition: background 0.2s !important;
    box-shadow: none !important;
    outline: none !important;
    height: 48px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.resf-select:focus, .resf-input:focus {
    background: #f0f0f0 !important;
}

/* Fake chevron for select */
.resf-hs-input-wrap::after {
    content: '\2304'; /* Down arrow */
    position: absolute;
    left: 12px;
    color: #ccc;
    font-size: 16px;
    pointer-events: none;
}
.resf-hs-input-wrap:has(input[type="number"])::after {
    display: none;
}

.resf-hs-submit {
    flex: 0 0 auto;
}

.resf-hs-btn {
    background: #00a651 !important; /* Green */
    color: #fff !important;
    border: none !important;
    padding: 0 40px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s !important;
    height: 48px !important;
    width: 100% !important;
}

.resf-hs-btn:hover {
    background: #008f45 !important;
}

@media (max-width: 992px) {
    .resf-hero-search__form {
        flex-direction: column;
        align-items: stretch;
    }
    .resf-hs-filters {
        flex-direction: column;
    }
    .resf-hs-field--range {
        flex-direction: column;
    }
    .resf-hs-btn {
        width: 100% !important;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR FILTER
   ═══════════════════════════════════════════════════════════════ */
.resf-filter {
    background: #fff;
    border-radius: var(--resf-radius);
    box-shadow: var(--resf-shadow);
    padding: 24px;
}

.resf-filter__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--resf-border);
    padding-bottom: 16px;
}

.resf-filter__head h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.resf-filter__head h2 i {
    color: var(--resf-primary);
}

.resf-filter__reset {
    background: none;
    border: none;
    color: var(--resf-text-light);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.resf-filter__reset:hover {
    color: var(--resf-primary);
}

/* CPT Tabs */
.resf-filter__cpt-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--resf-bg);
    padding: 4px;
    border-radius: var(--resf-radius);
}

.resf-filter__cpt-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--resf-text-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.resf-filter__cpt-tab--active {
    background: #fff;
    color: var(--resf-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Accordions */
.resf-filter__group {
    border-bottom: 1px solid var(--resf-border);
}

.resf-filter__group:last-child {
    border-bottom: none;
}

.resf-filter__toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--resf-text);
    font-size: 15px;
}

.resf-filter__toggle span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resf-filter__toggle i {
    color: var(--resf-primary);
    transition: transform 0.3s;
}

.resf-filter__toggle[aria-expanded="false"] > i.ti-chevron-down {
    transform: rotate(90deg);
}

.resf-filter__body {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 600px;
}

.resf-filter__body--closed {
    max-height: 0;
}

/* Range */
.resf-range {
    padding: 8px 0 24px;
}

.resf-range__labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--resf-text);
    background: var(--resf-bg);
    padding: 6px 12px;
    border-radius: 4px;
}

.resf-range__unit {
    color: var(--resf-text-light);
}

.resf-range__track {
    position: relative;
    height: 4px;
    background: var(--resf-border);
    border-radius: 2px;
    margin: 0 8px;
}

.resf-range__input {
    position: absolute;
    top: -6px;
    width: 100%;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}

.resf-range__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--resf-primary);
    cursor: pointer;
    pointer-events: auto;
}

/* Checkboxes */
.resf-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
}

.resf-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--resf-text);
}

.resf-checkbox input {
    display: none;
}

.resf-checkbox__mark {
    width: 18px;
    height: 18px;
    border: 1px solid var(--resf-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.resf-checkbox input:checked + .resf-checkbox__mark {
    background: var(--resf-primary);
    border-color: var(--resf-primary);
}

.resf-checkbox input:checked + .resf-checkbox__mark::after {
    content: '\2714';
    color: #fff;
    font-size: 12px;
}

/* Toggles */
.resf-toggles-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-bottom: 16px;
}

.resf-toggle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--resf-border);
    border-radius: var(--resf-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    color: var(--resf-text-light);
}

.resf-toggle-item input {
    display: none;
}

.resf-toggle-item i {
    font-size: 20px;
    color: var(--resf-text-light);
    transition: color 0.2s;
}

.resf-toggle-item input:checked ~ i,
.resf-toggle-item input:checked ~ span {
    color: var(--resf-primary);
}

.resf-toggle-item input:checked ~ .resf-toggle-item__check {
    border-color: var(--resf-primary);
}

/* Sidebar Submit Button */
.resf-filter__actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--resf-border);
}

.resf-filter__submit-btn {
    width: 100%;
    background: #00a651; /* Green */
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.resf-filter__submit-btn:hover {
    background: #008f45;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS GRID
   ═══════════════════════════════════════════════════════════════ */
.resf-results {
    position: relative;
}

.resf-results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.resf-results__count {
    font-size: 15px;
    color: var(--resf-text);
}

.resf-results__sort {
    padding: 8px 12px;
    border: 1px solid var(--resf-border);
    border-radius: var(--resf-radius);
    background: #fff;
}

.resf-results__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.resf-results__loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    z-index: 10;
}

.resf-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--resf-radius);
    color: var(--resf-text-light);
}

.resf-no-results i {
    font-size: 48px;
    color: var(--resf-border);
    margin-bottom: 16px;
    display: block;
}

/* Pagination */
.resf-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.resf-pagination__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--resf-border);
    border-radius: var(--resf-radius);
    color: var(--resf-text);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.resf-pagination__btn:hover:not(.resf-pagination__dots) {
    border-color: var(--resf-primary);
    color: var(--resf-primary);
}

.resf-pagination__btn--active {
    background: var(--resf-primary);
    border-color: var(--resf-primary);
    color: #fff;
}

.resf-pagination__dots {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--resf-text-light);
}

/* ═══════════════════════════════════════════════════════════════
   PROPERTY CARDS (Default UI if Elementor Loop not used)
   ═══════════════════════════════════════════════════════════════ */
.resf-card {
    background: #fff;
    border-radius: var(--resf-radius);
    box-shadow: var(--resf-shadow);
    overflow: hidden;
    transition: transform 0.2s;
}

.resf-card:hover {
    transform: translateY(-4px);
}

.resf-card__img {
    height: 200px;
    overflow: hidden;
}

.resf-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resf-card__body {
    padding: 20px;
}

.resf-card__title {
    margin: 0 0 12px;
    font-size: 18px;
}

.resf-card__title a {
    color: var(--resf-text);
    text-decoration: none;
}

.resf-card__price {
    font-size: 20px;
    font-weight: 700;
    color: var(--resf-primary);
    margin: 0 0 16px;
}

.resf-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--resf-text-light);
    padding-top: 16px;
    border-top: 1px solid var(--resf-border);
}

.resf-card__meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .resf-hero-search__form {
        flex-direction: column;
        align-items: stretch;
    }
    .resf-hs-btn {
        width: 100%;
        justify-content: center;
    }
}
