/* ── Listings Page Header ── */
.listings-header {
    background: linear-gradient(155deg, #e8f5ef 0%, #f7fbf9 55%, #fff7f4 100%);
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.listings-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 400"><defs><pattern id="p" width="80" height="80" patternUnits="userSpaceOnUse"><text y="50" font-size="30" opacity="0.04">🐾</text></pattern></defs><rect width="800" height="400" fill="url(%23p)"/></svg>');
    z-index: 1;
}
.listings-header-inner {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}
.listings-page-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.15;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}
.listings-page-title .highlight {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 60%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.listings-page-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 480px;
}
.listings-header-stats {
    display: flex;
    gap: 2rem;
    flex-shrink: 0;
}
.header-stat {
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.25rem 1.75rem;
    box-shadow: 0 4px 20px var(--shadow);
    min-width: 100px;
}
.header-stat-number {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.header-stat-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Filters Bar ── */
.filters-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 72px; /* below navbar */
    z-index: 100;
    box-shadow: 0 4px 20px var(--shadow);
}
.filters-form {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Search */
.filter-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.filter-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}
.filter-search {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1.5px solid var(--border);
    border-radius: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    background: var(--bg-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.filter-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: white;
}
.filter-search::placeholder { color: #9cad9e; }

/* Filter groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.filter-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.filter-select {
    padding: 0.7rem 2rem 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-main);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a7a6e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    outline: none;
    transition: border-color 0.2s ease;
    min-width: 140px;
}
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Status toggles */
.filter-toggle-row {
    display: flex;
    gap: 0.4rem;
}
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    border-radius: 0.65rem;
    border: 1.5px solid var(--border);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-main);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}
.filter-toggle input[type="radio"] { display: none; }
.filter-toggle:hover { border-color: var(--primary); color: var(--primary-dark); }
.filter-toggle.active {
    background: rgba(59,158,126,0.1);
    border-color: var(--primary);
    color: var(--primary-darker);
}
.filter-toggle-lost.active {
    background: rgba(249,123,79,0.1);
    border-color: var(--accent);
    color: var(--accent);
}
.filter-toggle-found.active {
    background: rgba(59,158,126,0.1);
    border-color: var(--primary);
    color: var(--primary-dark);
}

/* Buttons */
.filter-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.72rem 1.5rem;
    border-radius: 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px var(--primary-glow);
    white-space: nowrap;
    align-self: flex-end;
}
.filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59,158,126,0.4);
}
.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.72rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    align-self: flex-end;
}
.filter-clear-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(249,123,79,0.06);
}

/* ── Results bar ── */
.results-bar {
    background: var(--bg-main);
    padding: 0.85rem 2rem;
    border-bottom: 1px solid var(--border);
}
.results-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.results-count {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}
.active-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(59,158,126,0.1);
    border: 1px solid var(--border);
    color: var(--primary-darker);
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
}
.active-filter-chip a {
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.active-filter-chip a:hover { opacity: 1; }

/* ── Browse Grid ── */
.browse-section {
    background: var(--bg-main);
    padding: 3rem 2rem 4rem;
}
.browse-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

/* ── Pet Card ── */
.pet-browse-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: all 0.35s ease;
    box-shadow: 0 2px 12px var(--shadow);
}
.pet-browse-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(59,158,126,0.14);
    border-color: rgba(59,158,126,0.35);
}

/* Card image */
.pet-browse-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.pet-browse-img-lost { background: linear-gradient(135deg, #fff7f4, #ffe8df); }
.pet-browse-img-found { background: linear-gradient(135deg, #edf7f3, #d8f0e6); }
.pet-browse-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.pet-browse-card:hover .pet-browse-img img { transform: scale(1.05); }
.pet-browse-img > .fas {
    font-size: 4.5rem;
    opacity: 0.65;
    transition: transform 0.3s ease;
}
.pet-browse-img-lost > .fas { color: var(--accent); }
.pet-browse-img-found > .fas { color: var(--primary); }
.pet-browse-card:hover .pet-browse-img > .fas { transform: scale(1.08); }

.pet-browse-tag {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.pet-browse-time {
    position: absolute;
    bottom: 0.75rem;
    left: 0.85rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    color: var(--text-muted);
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Card body */
.pet-browse-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.pet-browse-name {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
    letter-spacing: 0.01em;
}
.pet-browse-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.pet-browse-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.pet-browse-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}
.pet-browse-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.pet-browse-contact {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pet-browse-arrow {
    color: var(--primary);
    font-size: 0.85rem;
    transition: transform 0.25s ease;
}
.pet-browse-card:hover .pet-browse-arrow { transform: translateX(4px); }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}
.empty-icon {
    width: 100px;
    height: 100px;
    background: rgba(59,158,126,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: var(--primary);
    border: 1px solid var(--border);
}
.empty-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}
.empty-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

/* ── Pagination ── */
.pagination-wrap {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}
.pagination-wrap nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pagination-wrap span,
.pagination-wrap a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 0.65rem;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}
.pagination-wrap a:hover {
    border-color: var(--primary);
    color: var(--primary-darker);
    background: rgba(59,158,126,0.06);
}
.pagination-wrap [aria-current="page"] span,
.pagination-wrap span.font-bold {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
}

/* ── Bottom CTA ── */
.listings-cta {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    padding: 3.5rem 2rem;
}
.listings-cta-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.listings-cta-icon {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
}
.listings-cta-text {
    flex: 1;
}
.listings-cta-text h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.4rem;
}
.listings-cta-text p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}
.listings-cta-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .listings-header-inner { flex-direction: column; align-items: flex-start; }
    .listings-header-stats { width: 100%; justify-content: flex-start; }
    .listings-cta-inner { flex-direction: column; text-align: center; }
    .listings-cta-actions { justify-content: center; }
}
@media (max-width: 768px) {
    .listings-page-title { font-size: 2.2rem; }
    .filters-form { flex-direction: column; align-items: stretch; }
    .filter-search-wrap { min-width: unset; }
    .filter-apply-btn, .filter-clear-btn { justify-content: center; }
    .filters-bar { position: static; }
    .browse-grid { grid-template-columns: 1fr; }
    .listings-header-stats { gap: 1rem; }
    .header-stat { flex: 1; padding: 1rem; }
}