/* --- REF GRID CARD V8.0.48 (Glassmorphism & Fixes) --- */

/* Vars */
:root {
    --ref-primary: #231F5C;
    --ref-secondary: #008797;
    --ref-accent: #FFAF00;
    --ref-white: #FFFFFF;
    --ref-gray-text: #666666;
    --ref-border: #e0e0e0;
}

/* Base Card */
.ref-imovel-card {
    background-color: var(--ref-card-bg, #ffffff);
    border: 1px solid var(--ref-border);
    border-radius: var(--ref-radius, 8px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    text-decoration: none;
    /* Reset link styles if article is wrapped */
}

.ref-imovel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ref-card-shadow, 0 15px 30px rgba(35, 31, 92, 0.15));
}

/* Clickable Overlay (Wrapper) */
.ref-card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
}

/* Stretched Link (Clickable Card) */
.ref-stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    /* Below Badge & Overlay */
    content: "";
}

/* Card Thumb */
.ref-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 60%;
    /* Aspect Ratio 3:2 */
    background-color: #f0f0f0;
    overflow: hidden;
}

.ref-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ref-imovel-card:hover .ref-card-thumb img {
    transform: scale(1.08);
}

/* Badges */
.ref-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: flex;
    gap: 5px;
}

.ref-badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--ref-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ref-badge-novo {
    background: rgba(39, 174, 96, 0.9);
    color: #fff;
}

/* Wishlist */
.ref-wishlist-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 11;
    color: var(--ref-white);
    font-size: 18px;
    cursor: pointer;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s;
}

.ref-wishlist-icon:hover {
    transform: scale(1.1);
}

.ref-wishlist-icon.active {
    color: #e74c3c;
}

/* SMART OVERLAY (Glassmorphism) */
.ref-overlay-glass {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transform: translateY(100%);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 10px;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 5;
    pointer-events: none;
    /* Let clicks pass through to Stretched Link? No, we want to see data */
}

/* Trigger on Hover */
.ref-imovel-card:hover .ref-overlay-glass {
    transform: translateY(0);
}

.ref-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
    gap: 5px;
    width: 33%;
}

.ref-feature-item i {
    font-size: 16px;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.9);
}

.ref-feature-item span {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Card Body */
.ref-card-body {
    padding: var(--ref-card-padding, 20px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
    background: #fff;
    position: relative;
    z-index: 6;
    /* Above Overlay when collapsed */
}

/* Meta Data */
.ref-meta-context {
    color: var(--ref-tipo-color, #008797);
    font-size: var(--ref-tipo-size, 13px);
    font-weight: var(--ref-tipo-weight, 400);
    line-height: 1.4;
    margin-bottom: 6px;
    display: block;
    text-transform: capitalize;
}

.ref-meta-address {
    color: var(--ref-bairro-color, #666666);
    font-size: var(--ref-bairro-size, 13px);
    font-weight: var(--ref-bairro-weight, 400);
    line-height: 1.4;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ref-meta-address i {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

/* Title */
.ref-card-title {
    color: var(--ref-card-title-color, #231F5C);
    font-size: var(--ref-card-title-size, 18px);
    font-weight: var(--ref-title-weight, 800);
    margin: 0 0 12px 0;
    line-height: var(--ref-card-line-height, 1.25);
}

.ref-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.ref-card-title a:hover {
    color: var(--ref-secondary);
}

/* Specs */
.ref-specs-list {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0 0 15px 0;
    list-style: none;
    gap: 0;
}

.ref-spec-item {
    color: var(--ref-spec-color, #008797);
    font-size: var(--ref-card-spec-size, 13px);
    font-weight: var(--ref-spec-weight, 400);
    display: inline-flex;
    align-items: center;
}

.ref-spec-separator {
    color: #ccc;
    font-size: var(--ref-spec-separator-size, 0.7em);
    margin: 0 8px;
    display: inline-flex;
    align-items: center;
    align-self: center;
}

/* Price */
.ref-card-price {
    margin-top: auto;
    color: var(--ref-accent);
    font-size: var(--ref-card-price-size, 18px);
    font-weight: var(--ref-price-weight, 800);
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.ref-price-prefix {
    font-size: var(--ref-price-prefix-size, 12px);
    font-weight: 500;
    color: var(--ref-accent);
    opacity: 0.9;
}

.sob-consulta .ref-card-price-value {
    font-size: var(--ref-sob-consulta-size, 16px);
    font-weight: 600;
    color: var(--ref-sob-consulta-color, #999999);
}

/* --- TOOLBAR RESTORATION (V8.0.49) --- */
.ref-results-toolbar {
    width: 100%;
    margin: 0 0 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    flex-wrap: wrap;
    gap: 15px;
}

.ref-results-count {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ref-count-main {
    color: var(--ref-primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.ref-count-details {
    color: var(--ref-primary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    opacity: 0.9;
}

.ref-sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ref-sort-label {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}

.ref-sort-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 35px 8px 15px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: var(--ref-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23231F5C%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 8px auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ref-sort-select:hover {
    border-color: var(--ref-secondary);
    outline: none;
}