/* WN Smart Listings Premium CSS */

.wn-listings-container {
    display: grid;
    gap: 25px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wn-cols-1 {
    grid-template-columns: 1fr;
}

.wn-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wn-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wn-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Card Design */
.wn-listing-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.wn-listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Image Wrapper */
.wn-listing-img-wrap {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f4f6f8;
}

.wn-listing-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wn-listing-card:hover .wn-listing-img-wrap img {
    transform: scale(1.05);
    /* Zoom effect */
}

/* Body */
.wn-listing-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.wn-listing-title {
    margin: 0 0 10px;
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.4;
    color: #1a202c;
}

.wn-price {
    font-size: 1.1em;
    font-weight: 800;
    color: #25D366;
    /* Brand-ish color match */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.wn-loc {
    font-size: 0.9em;
    color: #718096;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wn-loc .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Actions */
.wn-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wn-listing-whatsapp-btn,
.wn-popup-trig {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
    line-height: 1;
}

.wn-listing-whatsapp-btn {
    background: #25D366;
    color: #fff;
    box-shadow: 0 2px 5px rgba(37, 211, 102, 0.3);
}

.wn-listing-whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-1px);
}

.wn-popup-trig {
    background: #edf2f7;
    color: #4a5568;
}

.wn-popup-trig:hover {
    background: #e2e8f0;
    color: #2d3748;
}

/* Popup */
.wn-popup-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.wn-popup-wrap[style*="display: flex"] {
    opacity: 1;
    pointer-events: auto;
}

.wn-popup-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.wn-popup-content {
    background: #fff;
    padding: 30px;
    width: 90%;
    max-width: 550px;
    border-radius: 16px;
    position: relative;
    z-index: 2;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.wn-popup-wrap[style*="display: flex"] .wn-popup-content {
    transform: translateY(0);
}

.wn-close {
    position: absolute;
    top: 15px;
    right: 20px;
    border: none;
    background: none;
    font-size: 28px;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.wn-close:hover {
    color: #2d3748;
}

.wn-popup-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.wn-popup-price {
    font-size: 1.25em;
    color: #25D366;
    margin-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 10px;
}

.wn-popup-details {
    line-height: 1.6;
    color: #4a5568;
}

.wn-popup-foot {
    margin-top: 25px;
    text-align: center;
}

.wn-popup-foot .wn-listing-whatsapp-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
}

/* Responsive */
@media(max-width: 900px) {
    .wn-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .wn-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 600px) {
    .wn-listings-container {
        grid-template-columns: 1fr;
    }

    .wn-actions {
        grid-template-columns: 1fr;
    }
}