/**
 * Rizal Pulse PH - Interactive Directory & Map Stylesheet
 * Responsive Split-View, Leaflet Clustering, Town Filter Pills & Claim Integration
 */

:root {
    --rp-bg-dark: #090d16;
    --rp-card-bg: #111827;
    --rp-card-hover: #1f2937;
    --rp-border-color: #1e293b;
    --rp-border-active: #0284c7;
    --rp-accent-blue: #0284c7;
    --rp-accent-cyan: #06b6d4;
    --rp-accent-gold: #f59e0b;
    --rp-text-main: #f8fafc;
    --rp-text-muted: #94a3b8;
    --rp-text-dim: #64748b;
    --rp-success: #10b981;
    --rp-radius: 12px;
    --rp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --rp-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rp-directory-wrapper {
    font-family: var(--rp-font-stack);
    color: var(--rp-text-main);
    background: var(--rp-bg-dark);
    border-radius: var(--rp-radius);
    padding: 18px;
    box-shadow: var(--rp-shadow);
    margin: 20px auto;
    max-width: 1360px;
    box-sizing: border-box;
}

.rp-directory-wrapper *,
.rp-directory-wrapper *::before,
.rp-directory-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================================
   1. Header Controls & Filters
   ============================================================ */
.rp-directory-header-controls {
    background: #0d131f;
    border: 1px solid var(--rp-border-color);
    border-radius: var(--rp-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rp-controls-top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.rp-search-box-wrap {
    position: relative;
    flex: 1 1 280px;
    display: flex;
    align-items: center;
}

.rp-search-icon {
    position: absolute;
    left: 14px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.7;
}

.rp-filter-search-input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    border-radius: 8px;
    color: var(--rp-text-main);
    font-size: 14px;
    transition: all 0.2s ease;
}

.rp-filter-search-input:focus {
    outline: none;
    border-color: var(--rp-accent-blue);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
    background: #182338;
}

.rp-search-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--rp-text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.rp-category-filter-wrap {
    flex: 0 1 200px;
}

.rp-filter-select {
    width: 100%;
    padding: 10px 14px;
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    border-radius: 8px;
    color: var(--rp-text-main);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.rp-filter-select:focus {
    outline: none;
    border-color: var(--rp-accent-blue);
}

.rp-filter-verified-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--rp-text-muted);
    user-select: none;
    padding: 6px 10px;
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.rp-filter-verified-toggle input {
    cursor: pointer;
    accent-color: var(--rp-accent-blue);
}

.rp-filter-verified-toggle:hover {
    color: var(--rp-text-main);
    border-color: var(--rp-accent-blue);
}

/* Mobile View Switcher */
.rp-mobile-view-toggle {
    display: none;
    margin-left: auto;
    background: #151d2d;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--rp-border-color);
}

.rp-view-toggle-btn {
    background: none;
    border: none;
    color: var(--rp-text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rp-view-toggle-btn.active {
    background: var(--rp-accent-blue);
    color: #fff;
}

/* 14 Municipalities Pill Bar */
.rp-towns-scroller-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.rp-towns-pills-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
    padding: 4px 2px;
    scroll-behavior: smooth;
    width: 100%;
}

.rp-towns-pills-bar::-webkit-scrollbar {
    display: none;
}

.rp-town-pill {
    white-space: nowrap;
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    color: var(--rp-text-muted);
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rp-town-pill:hover {
    background: #1f2c42;
    color: var(--rp-text-main);
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.rp-town-pill.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-color: #38bdf8;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.rp-towns-scroll-btn {
    background: #1e293b;
    border: 1px solid var(--rp-border-color);
    color: var(--rp-text-main);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    z-index: 2;
    transition: background 0.2s;
    flex-shrink: 0;
}

.rp-towns-scroll-btn:hover {
    background: var(--rp-accent-blue);
}

.rp-scroll-left {
    margin-right: 6px;
}

.rp-scroll-right {
    margin-left: 6px;
}

/* ============================================================
   1.5 Main Container & Faceted Sidebar
   ============================================================ */
.rp-directory-main-container {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.rp-faceted-sidebar {
    background: #0d131f;
    border: 1px solid var(--rp-border-color);
    border-radius: var(--rp-radius);
    padding: 16px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.rp-faceted-sidebar::-webkit-scrollbar {
    width: 6px;
}
.rp-faceted-sidebar::-webkit-scrollbar-track {
    background: #0d131f;
}
.rp-faceted-sidebar::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 3px;
}
.rp-faceted-sidebar::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

.rp-sidebar-backdrop {
    display: none;
}

.rp-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rp-border-color);
}

.rp-sidebar-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--rp-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rp-facet-reset-btn {
    background: none;
    border: none;
    color: var(--rp-accent-cyan);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.rp-facet-reset-btn:hover {
    color: #fff;
    background: rgba(6, 182, 212, 0.15);
}

.rp-sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--rp-text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* Active Chips */
.rp-active-chips-wrap {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--rp-border-color);
}

.rp-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    color: var(--rp-text-main);
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rp-chip-remove {
    background: none;
    border: none;
    color: var(--rp-text-muted);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.rp-chip-remove:hover {
    color: #ef4444;
}

/* Facet Groups */
.rp-facet-group {
    margin-bottom: 18px;
}

.rp-facet-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rp-facet-group-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--rp-text-main);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rp-facet-quick-clear {
    background: none;
    border: none;
    color: var(--rp-text-dim);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}
.rp-facet-quick-clear:hover {
    color: var(--rp-text-muted);
    text-decoration: underline;
}

.rp-facet-search-box {
    margin-bottom: 8px;
}

.rp-facet-search-input {
    width: 100%;
    padding: 6px 10px;
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    border-radius: 6px;
    color: var(--rp-text-main);
    font-size: 12px;
}
.rp-facet-search-input:focus {
    outline: none;
    border-color: var(--rp-accent-blue);
}

.rp-facet-scroll-box {
    max-height: 170px;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rp-facet-scroll-box::-webkit-scrollbar {
    width: 4px;
}
.rp-facet-scroll-box::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 2px;
}

.rp-facet-items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rp-facet-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--rp-text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.rp-facet-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--rp-text-main);
}
.rp-facet-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--rp-accent-blue);
    width: 14px;
    height: 14px;
}

.rp-facet-label-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-facet-count {
    font-size: 11px;
    color: var(--rp-text-dim);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 9999px;
    font-weight: 600;
}

/* Price Range Pills */
.rp-price-pills-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.rp-price-pill {
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    color: var(--rp-text-muted);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s;
}
.rp-price-pill:hover {
    border-color: var(--rp-accent-blue);
    color: var(--rp-text-main);
}
.rp-price-pill.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
}
.rp-price-desc {
    font-size: 10px;
    opacity: 0.8;
    font-weight: normal;
}

/* Mobile Drawer Controls */
.rp-mobile-drawer-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    border-radius: 8px;
    color: var(--rp-text-main);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.rp-mobile-drawer-btn:hover {
    border-color: var(--rp-accent-blue);
}
.rp-sidebar-footer-mobile {
    display: none;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--rp-border-color);
}
.rp-sidebar-apply-btn {
    width: 100%;
    padding: 12px;
    background: var(--rp-accent-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Right Content Area */
.rp-directory-content-area {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Results Status Bar & Sorting */
.rp-directory-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--rp-text-dim);
    padding: 8px 12px;
    background: #0d131f;
    border: 1px solid var(--rp-border-color);
    border-radius: 8px;
}

.rp-results-count-text {
    font-weight: 500;
    color: var(--rp-accent-cyan);
}

.rp-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rp-sort-label {
    font-size: 12px;
    color: var(--rp-text-dim);
}
.rp-sort-select {
    background: #151d2d;
    border: 1px solid var(--rp-border-color);
    color: var(--rp-text-main);
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.rp-sort-select:focus {
    outline: none;
    border-color: var(--rp-accent-blue);
}

/* ============================================================
   2. Split Viewport Container
   ============================================================ */
.rp-split-viewport {
    display: grid;
    grid-template-columns: 54% 46%;
    gap: 16px;
    height: var(--map-height, 640px);
}

/* Column 1: Map Column */
.rp-map-column {
    position: relative;
    border-radius: var(--rp-radius);
    overflow: hidden;
    border: 1px solid var(--rp-border-color);
    background: #0e1420;
    height: 100%;
}

.rp-interactive-map {
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 1;
}

.rp-map-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 1000;
    font-size: 14px;
    font-weight: 500;
    color: var(--rp-text-main);
    transition: opacity 0.3s ease;
}

.rp-map-loading-overlay.loaded {
    opacity: 0;
    pointer-events: none;
}

.rp-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--rp-accent-cyan);
    border-radius: 50%;
    animation: rpSpin 0.8s linear infinite;
}

@keyframes rpSpin {
    to { transform: rotate(360deg); }
}

.rp-map-floating-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 400;
}

.rp-map-float-btn {
    background: #111827;
    border: 1px solid var(--rp-border-color);
    color: var(--rp-text-main);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.rp-map-float-btn:hover {
    background: var(--rp-accent-blue);
    border-color: #38bdf8;
}

/* Column 2: Listings Column */
.rp-list-column {
    overflow-y: auto;
    height: 100%;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rp-list-column::-webkit-scrollbar {
    width: 6px;
}

.rp-list-column::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

.rp-list-column::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.rp-list-column::-webkit-scrollbar-thumb:hover {
    background: var(--rp-accent-blue);
}

.rp-listings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================
   3. Listing Cards in Directory
   ============================================================ */
.rp-card-item {
    background: var(--rp-card-bg);
    border: 1px solid var(--rp-border-color);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    gap: 14px;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}

.rp-card-item:hover,
.rp-card-item.is-highlighted {
    background: var(--rp-card-hover);
    border-color: var(--rp-accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.15);
}

.rp-card-item.is-active-marker {
    border-color: var(--rp-accent-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.4);
}

.rp-card-thumb-wrap {
    width: 105px;
    height: 105px;
    border-radius: 8px;
    overflow: hidden;
    background: #1e293b;
    flex-shrink: 0;
    position: relative;
}

.rp-card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rp-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.rp-card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.rp-card-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

.rp-card-town-tag {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--rp-accent-cyan);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.rp-card-cat-tag {
    font-size: 11px;
    color: var(--rp-text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.rp-card-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--rp-text-main);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rp-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.rp-card-title a:hover {
    color: var(--rp-accent-blue);
}

.rp-card-address {
    font-size: 12px;
    color: var(--rp-text-muted);
    margin: 0 0 8px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rp-card-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-card-claim-area {
    display: inline-flex;
    align-items: center;
}

.rp-card-action-links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.rp-btn-directions {
    font-size: 11.5px;
    color: var(--rp-accent-blue);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: color 0.2s;
}

.rp-btn-directions:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* ============================================================
   4. Badges & Claim Buttons in Directory Cards
   ============================================================ */
.rp-badge-verified-enterprise {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rp-check-icon {
    font-weight: bold;
}

.rp-badge-pending-verification {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
}

.rp-claim-trigger-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.25) 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fef08a;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rp-claim-trigger-btn:hover {
    background: #f59e0b;
    color: #0f172a;
    border-color: #fbbf24;
    transform: translateY(-1px);
}

/* Empty State */
.rp-listings-empty {
    padding: 40px 20px;
    text-align: center;
    background: var(--rp-card-bg);
    border: 1px dashed var(--rp-border-color);
    border-radius: 10px;
    color: var(--rp-text-muted);
}

.rp-empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.rp-listings-empty h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: var(--rp-text-main);
}

.rp-listings-empty p {
    font-size: 13px;
    margin: 0 0 14px 0;
}

.rp-btn-inline {
    background: var(--rp-accent-blue);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

/* ============================================================
   5. Custom Leaflet Pin Markers & Popups
   ============================================================ */
.rp-map-custom-marker {
    background: none;
    border: none;
}

.rp-marker-pin {
    width: 32px;
    height: 42px;
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s ease;
}

.rp-marker-pin:hover {
    transform: scale(1.18) translateY(-4px);
    z-index: 1000 !important;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    background: #111827 !important;
    border: 1px solid var(--rp-border-color) !important;
    color: var(--rp-text-main) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 12px !important;
    font-family: var(--rp-font-stack) !important;
    line-height: 1.4 !important;
    width: 250px !important;
}

.leaflet-popup-tip {
    background: #111827 !important;
    border-left: 1px solid var(--rp-border-color) !important;
    border-top: 1px solid var(--rp-border-color) !important;
}

.rp-popup-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rp-popup-meta {
    font-size: 11px;
    color: var(--rp-accent-cyan);
    font-weight: 600;
}

.rp-popup-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--rp-text-main);
}

.rp-popup-title a {
    color: inherit;
    text-decoration: none;
}

.rp-popup-address {
    font-size: 11.5px;
    color: var(--rp-text-muted);
    margin: 0;
}

.rp-popup-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cluster Custom Styling */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(2, 132, 199, 0.4) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: #0284c7 !important;
    color: #fff !important;
    font-weight: bold !important;
    font-family: var(--rp-font-stack) !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.6) !important;
}

/* ============================================================
   6. Mobile & Responsive Layouts
   ============================================================ */
@media (max-width: 991px) {
    .rp-directory-main-container {
        grid-template-columns: 1fr;
    }

    .rp-mobile-drawer-btn {
        display: inline-flex;
    }

    /* Faceted Sidebar becomes fixed slide-in drawer on mobile */
    .rp-faceted-sidebar {
        position: fixed;
        top: 0;
        left: -330px;
        width: 310px;
        max-width: 86vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 999999;
        background: #0b101a;
        transition: left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 0;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
        display: flex;
        flex-direction: column;
    }

    .rp-faceted-sidebar.open {
        left: 0;
    }

    .rp-sidebar-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
    }

    .rp-sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.75);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999998;
    }

    .rp-sidebar-backdrop.active {
        display: block;
    }

    .rp-sidebar-close-btn {
        display: block;
    }

    .rp-sidebar-footer-mobile {
        display: block;
    }

    .rp-split-viewport {
        grid-template-columns: 1fr;
        height: auto;
        gap: 14px;
    }

    .rp-map-column {
        height: 380px;
    }

    .rp-list-column {
        max-height: 480px;
    }

    .rp-mobile-view-toggle {
        display: inline-flex;
    }

    /* Tabbed toggle states on mobile */
    .rp-directory-wrapper[data-mobile-view="map"] .rp-map-column {
        display: block;
        height: 520px;
    }
    .rp-directory-wrapper[data-mobile-view="map"] .rp-list-column {
        display: none;
    }

    .rp-directory-wrapper[data-mobile-view="list"] .rp-map-column {
        display: none;
    }
    .rp-directory-wrapper[data-mobile-view="list"] .rp-list-column {
        display: flex;
        max-height: 650px;
    }

    .rp-directory-wrapper[data-mobile-view="split"] .rp-map-column {
        display: block;
        height: 320px;
    }
    .rp-directory-wrapper[data-mobile-view="split"] .rp-list-column {
        display: flex;
        max-height: 440px;
    }
}

@media (max-width: 600px) {
    .rp-directory-wrapper {
        padding: 12px;
        margin: 10px 0;
    }

    .rp-directory-header-controls {
        padding: 12px;
    }

    .rp-card-item {
        padding: 10px;
        gap: 10px;
    }

    .rp-card-thumb-wrap {
        width: 80px;
        height: 80px;
    }

    .rp-card-title {
        font-size: 13.5px;
    }

    .rp-card-address {
        font-size: 11px;
    }
}

/* ============================================================
   Business Registry Mode, Trust Banner & Seal Badges
   ============================================================ */
.rp-directory-mode-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #0d131f;
    border: 1px solid var(--rp-border-color);
    border-radius: var(--rp-radius);
    padding: 8px 12px;
    margin-bottom: 14px;
}

.rp-mode-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rp-mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--rp-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.rp-mode-tab:hover {
    color: var(--rp-text-main);
    background: #151d2d;
}

.rp-mode-tab.active {
    color: #ffffff;
    background: #1a2538;
    border-color: var(--rp-border-active);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rp-mode-tab[data-mode="registry"].active {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(15, 23, 42, 0.9));
    color: #ecfdf5;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.rp-mode-tab-icon {
    font-size: 14px;
}

.rp-mode-tab-pill {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    background: #1e293b;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rp-mode-tab-pill.rp-pill-gold {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.rp-registry-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
}

.rp-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: rp-pulse-glow 2s infinite;
}

@keyframes rp-pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Registry Trust Banner */
.rp-registry-trust-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.09) 0%, rgba(13, 19, 31, 0.96) 100%);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--rp-radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    animation: rpFadeSlideDown 0.25s ease-out;
}

@keyframes rpFadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rp-trust-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rp-seal-badge-emblem {
    font-size: 24px;
    line-height: 1;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rp-seal-title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 800;
    color: #34d399;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rp-seal-subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

.rp-trust-banner-desc {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.55;
    color: #cbd5e1;
}

.rp-trust-badges-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rp-trust-chip {
    font-size: 11px;
    font-weight: 600;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    padding: 3px 10px;
}

/* Card Registry Seal Box */
.rp-registry-seal-box {
    margin-top: 8px;
    margin-bottom: 4px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rp-seal-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.rp-seal-badge-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.rp-seal-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rp-seal-id-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rp-seal-id-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 11.5px;
    color: #a7f3d0;
    letter-spacing: 0.04em;
    background: rgba(6, 78, 59, 0.6);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.rp-seal-status-badge {
    font-size: 9.5px;
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.18);
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rp-seal-desc {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-btn-locate-pin {
    padding: 5px 10px;
    background: #151d2d;
    border: 1px solid rgba(16, 185, 129, 0.45);
    border-radius: 6px;
    color: #6ee7b7;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.rp-btn-locate-pin:hover {
    background: #10b981;
    color: #022c22;
    border-color: #10b981;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

/* Marker Popup Registry Badge */
.rp-popup-registry-badge {
    margin-bottom: 6px;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
    font-weight: 600;
}

.rp-popup-seal-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: #a7f3d0;
}

.rp-popup-seal-status {
    color: #34d399;
}

