/*#properties-grid-container {*/
/*    max-width: 1200px;*/
/*    margin: 0 auto;*/
/*}*/

.properties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
}

.property-card {
    background: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.property-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.flag {
    position: absolute;
    top: 0px;
    left: 0px;
    background: #b6ced0;
    color: #00393d;
    padding: 10px 30px;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.flag.available { background: #00393d; color: #fff; }
/*.flag.escrow { background: #ffc107; }*/
/*.flag.recent-closing { background: #dc3545; }*/

.property-card h3 {
    margin: 10px;
    font-size: 18px;
}

.property-card h3 a{
    color: #000;
    text-decoration: none !important;
}

.property-card h3 a:hover {
    color: #00393d;
}

.property-card .address {
    margin: 0 10px;
    color: #666;
    font-size: 14px;
}

.property-card .info {
    margin: 10px;
    font-size: 14px;
    color: #333;
}

.contact-btn,
.more-btn{
    display: inline-flex;
    margin: 10px 10px;
    padding: 10px 16px;
    background: #00393d;
    color: #fff;
    font-size: 16px;
    line-height: 16px;
    font-weight: 500;
    height: 36px;
    border: none;
    border-radius: 0px;
    text-decoration: none !important;
    cursor: pointer;
}

.contact-btn:hover, .more-btn:hover { background: #b6ced0; color: #00393d!important; }

.properties-filter {
    /*text-align: center;*/
    margin-bottom: 20px;
}

.filter-btn {
    margin: 0 5px;
    padding: 10px 30px;
    border: none;
    border-radius: 0;
    background: #b6ced0;
    color: #00393d;
    cursor: pointer;
}

.filter-btn.active, .filter-btn:hover {
    background: #00393d;
    color: #fff;
}

.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination .page-item {
    margin: 0 5px;
    display: inline-block;
}

.pagination .page-item a {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0px;
    text-decoration: none;
    color: #00393d;
}

.pagination .page-item a:hover { 
    background: #00393d; 
    color: #fff;
}

.pagination .page-item .current { 
    background: #00393d; 
    color: #fff; 
    padding: 8px 12px; 
    border-radius: 0px; 
    display: inline-block;
}

#contact-modal.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    overflow-y: auto;
    transition: opacity 0.3s ease;
    opacity: 0;
}

#contact-modal.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

#contact-modal .modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

#contact-modal.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

.modal h2 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal input, .modal textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal button {
    padding: 10px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal button:hover { background: #0056b3; }

/* Responsive: Tablets */
@media (max-width: 992px) {
    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }

    .property-image {
        height: 180px;
    }

    .property-card h3 {
        font-size: 16px;
    }

    .property-card .address,
    .property-card .info {
        font-size: 13px;
    }

    .contact-btn {
        padding: 8px 12px;
    }

    .filter-btn {
        padding: 8px 20px;
        margin: 5px 3px;
    }

    .pagination .page-item a,
    .pagination .page-item .current {
        padding: 6px 10px;
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .properties-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .property-image {
        height: 160px;
    }

    .property-card h3 {
        font-size: 15px;
    }

    .property-card .address,
    .property-card .info {
        font-size: 12px;
    }

    .contact-btn {
        padding: 7px 10px;
        font-size: 14px;
    }

    .filter-btn {
        padding: 7px 15px;
        margin: 5px 2px;
        font-size: 13px;
    }

    .pagination .page-item a,
    .pagination .page-item .current {
        padding: 5px 8px;
        font-size: 13px;
    }

    /* Modal adjustments */
    #contact-modal .modal-content {
        width: 95%;
        padding: 15px;
    }

    #contact-modal .modal h2 {
        font-size: 20px;
    }

    #contact-modal .modal input,
    #contact-modal .modal textarea {
        padding: 8px;
    }

    #contact-modal .modal button {
        padding: 8px;
        font-size: 14px;
    }
}

/* Extra small devices (very small phones) */
@media (max-width: 480px) {
    .flag {
        padding: 6px 15px;
        font-size: 12px;
    }

    .property-card h3 {
        font-size: 14px;
    }

    .contact-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .pagination .page-item a,
    .pagination .page-item .current {
        padding: 4px 6px;
        font-size: 12px;
    }

    #contact-modal .modal h2 {
        font-size: 18px;
    }
}
