/* --- Square Property Card --- */
.property-card {
    position: relative;
    overflow: hidden;
    /* MAGIA: Esto fuerza que sea un cuadrado perfecto siempre */
    aspect-ratio: 1 / 1; 
    background-color: var(--surface-secondary);
    transition: transform 0.3s ease;
    cursor: pointer;
    /* border: 1px solid red; */
    border: none;
    border-radius: var(--radius-md);
}

.property-card:hover {
    transform: translateY(-5px);
    border-color: var(--sni-primary);
    border: 1px solid var(--sni-primary);
}

/* La imagen ocupa todo el espacio absoluto detrás */
.card-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Badges flotantes arriba */
.card-badges-top {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.card-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    backdrop-filter: blur(4px);
    background-color: var(--sni-primary);
}

.like-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    background: transparent;
    border:none;
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.like-btn:hover { color: red; }

.card-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 60%, transparent 100%);
    padding: 2rem 1rem 1rem 1rem;
    color: white;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}

.prop-title {
    order: 1;
    width: 100%;
    text-align: left;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prop-price {
    order: 2;
    text-align: left;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.prop-location {
    order: 3;
    width: auto;
    text-align: right;
    margin-bottom: 0.25rem;
    margin-left: 1rem;        
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.overlay-features {
    order: 4;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.5rem;
}

.feat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.feat-item:only-child {
    margin: 0 auto;
}

.feat-item i { color: var(--sni-primary); }


.carousel-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden; 
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.card-bg-img {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    
    opacity: 1; 
    position: relative;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.4);
    scale: 1.1;
}

.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    width: 12px;
    border-radius: 4px;
}


.property-card:hover .carousel-nav {
    opacity: 1;
}

.card-hover-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px;
    
    background-color: var(--sni-primary);
    color: white;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 50;
}

.property-card:hover .card-hover-header {
    transform: translateY(0);
}

.like-btn {
    z-index: 6;
    transition: all 0.3s ease;
}

.property-card:hover .like-btn {
    color: white; 
}

.listing-container.filters-open .carousel-nav {
    display: none !important;
}

.listing-container.filters-open .carousel-nav,
.listing-container.filters-open .carousel-dots {
    display: none !important;
}