/* ══════════════════════════════════════════════════════════════
   Archive Listing Template — NP Listings
   ══════════════════════════════════════════════════════════════ */

.np-archive {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    font-family: inherit;
    color: #1a1a1a;
    line-height: 1.6;
}

.np-archive *,
.np-archive *::before,
.np-archive *::after {
    box-sizing: border-box;
}


/* ── Archive Header ─────────────────────────────────────────── */

.np-archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.np-archive-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

.np-archive-desc {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.np-archive-desc p {
    margin: 0;
}

.np-archive-count {
    font-size: 0.875rem;
    color: #999;
    margin: 0;
}


/* ── Filter Bar ────────────────────────────────────────────── */

.np-filter-bar {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* Dropdowns row */
.np-filter-bar .np-filter-selects {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.np-filter-bar .np-filter-field {
    display: flex !important;
    flex-direction: column;
    gap: 0.3rem;
}

.np-filter-bar .np-filter-label {
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin: 0;
    padding: 0;
}

.np-filter-bar .np-filter-label svg {
    color: #4a7cff;
    flex-shrink: 0;
}

.np-filter-bar .np-filter-field select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background: #f8f9fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    padding: 0.6rem 2.25rem 0.6rem 0.75rem !important;
    font-size: 0.875rem !important;
    font-family: inherit;
    color: #333 !important;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.np-filter-bar .np-filter-field select:hover {
    border-color: #ccc !important;
}

.np-filter-bar .np-filter-field select:focus {
    outline: none !important;
    border-color: #4a7cff !important;
    box-shadow: 0 0 0 3px rgba(74, 124, 255, 0.1) !important;
}

/* Bottom row: pills + actions */
.np-filter-bar .np-filter-bottom {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* Feature pills */
.np-filter-bar .np-filter-pills {
    display: flex !important;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.np-filter-bar .np-filter-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 999px;
    font-size: 0.8125rem !important;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
    margin: 0;
}

.np-filter-bar .np-filter-pill:hover {
    border-color: #c8d8ff;
    background: #f0f5ff;
    color: #4a7cff;
}

.np-filter-bar .np-filter-pill.active {
    background: #f0f5ff;
    border-color: #4a7cff;
    color: #4a7cff;
    font-weight: 600;
}

.np-filter-bar .np-filter-pill input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #4a7cff;
    cursor: pointer;
    flex-shrink: 0;
}

.np-filter-bar .np-filter-pill svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.np-filter-bar .np-filter-pill.active svg {
    opacity: 1;
}

/* Actions */
.np-filter-bar .np-filter-actions {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.np-filter-bar .np-filter-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem !important;
    background: #4a7cff !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 600;
    font-family: inherit;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(74, 124, 255, 0.25) !important;
    line-height: 1.4;
    min-height: 0;
}

.np-filter-bar .np-filter-submit:hover {
    background: #3a65d4 !important;
    box-shadow: 0 4px 14px rgba(74, 124, 255, 0.35) !important;
}

.np-filter-bar .np-filter-submit svg {
    flex-shrink: 0;
}

.np-filter-bar .np-filter-clear {
    display: inline-flex !important;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem !important;
    color: #999;
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.np-filter-bar .np-filter-clear:hover {
    color: #e74c3c;
}

.np-filter-bar .np-filter-clear svg {
    flex-shrink: 0;
}


/* ── Card Grid ──────────────────────────────────────────────── */

.np-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}


/* ── Card ───────────────────────────────────────────────────── */

.np-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.np-card:hover {
    border-color: #c8d8ff;
}

.np-card-body {
    text-decoration: none;
    color: inherit;
}

.np-card-body:hover {
    text-decoration: none;
    color: inherit;
}


/* ── Card Image ─────────────────────────────────────────────── */

.np-card-img {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.np-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}


/* Image link overlay (clickable to listing page) */
.np-card-img-link {
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    bottom: 0;
    z-index: 8;
    cursor: pointer;
}

/* Card mini Swiper */
.np-card-swiper {
    position: absolute;
    inset: 0;
}

.np-card-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-card-swiper-prev,
.np-card-swiper-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 12;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    cursor: pointer;
    color: #333;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.np-card-swiper-prev { left: 8px; }
.np-card-swiper-next { right: 8px; }

.np-card:hover .np-card-swiper-prev,
.np-card:hover .np-card-swiper-next {
    opacity: 1;
}

.np-card-swiper-prev:hover,
.np-card-swiper-next:hover {
    background: #fff;
}

.np-card-swiper-pagination {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    z-index: 12;
    display: flex;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}

.np-card-swiper-pagination .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    opacity: 1;
    transition: background 0.2s, transform 0.2s;
    pointer-events: auto;
}

.np-card-swiper-pagination .swiper-pagination-bullet-active {
    background: #fff;
    transform: scale(1.3);
}

.np-card-price {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 12;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.np-card-type {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 12;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

/* T09: Construction-status badge sits opposite the type badge in the top-right. */
.np-card-construction-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.np-card-construction-badge.is-ready {
    background: rgba(31, 138, 76, 0.92);
    color: #fff;
}

.np-card-construction-badge.is-offplan {
    background: rgba(74, 124, 255, 0.92);
    color: #fff;
}

.np-card-construction-badge.is-progress {
    background: rgba(194, 103, 10, 0.92);
    color: #fff;
}

.np-card-construction-badge.is-resale {
    background: rgba(92, 100, 112, 0.92);
    color: #fff;
}

.np-card-construction-badge.is-newbuild {
    background: rgba(74, 124, 255, 0.92);
    color: #fff;
}


/* ── Card Body ──────────────────────────────────────────────── */

.np-card-body {
    display: block;
    padding: 0.75rem 1rem;
}

.np-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    line-height: 1.3;
    color: #1a1a1a;
}

.np-card-location {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #777;
    margin: 0 0 0.5rem;
}

.np-card-location svg {
    flex-shrink: 0;
    color: #4a7cff;
}

.np-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.np-card-stats {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.np-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: #555;
    white-space: nowrap;
}

.np-card-stat svg {
    flex-shrink: 0;
    color: #4a7cff;
}

.np-card-body-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}


/* ── Pagination ─────────────────────────────────────────────── */

.np-archive-pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.np-archive-pagination ul {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.np-archive-pagination li {
    margin: 0;
}

.np-archive-pagination a,
.np-archive-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.np-archive-pagination a:hover {
    border-color: #4a7cff;
    color: #4a7cff;
    background: #f7f9ff;
}

.np-archive-pagination .current {
    background: #4a7cff;
    border-color: #4a7cff;
    color: #fff;
}


/* ── Empty State ────────────────────────────────────────────── */

.np-archive-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #999;
    font-size: 1.125rem;
}


/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .np-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .np-filter-bar .np-filter-selects {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .np-archive {
        padding: 1.5rem 1rem 3rem;
    }

    .np-filter-bar {
        padding: 1rem;
    }

    .np-filter-bar .np-filter-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .np-filter-bar .np-filter-actions {
        justify-content: space-between;
    }

    /* Larger tap targets on touch devices */
    .np-filter-bar .np-filter-pill {
        padding: 0.55rem 0.95rem;
        font-size: 0.875rem !important;
    }

    .np-filter-bar .np-filter-submit {
        flex: 1;
        justify-content: center;
    }

    /* Arrows only show on hover, so recover the edge tap area on touch */
    .np-card-img-link {
        left: 0;
        right: 0;
    }
}

@media (max-width: 599px) {
    .np-archive-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .np-archive-title {
        font-size: 1.5rem;
    }

    .np-filter-bar .np-filter-selects {
        grid-template-columns: 1fr 1fr;
    }

    .np-archive-pagination a,
    .np-archive-pagination span {
        min-width: 44px;
        height: 44px;
    }
}
