.btn-fav { width: 100%; background: #fff; color: #475569; border: 2px solid #cbd5e1; padding: 0.7rem; border-radius: 6px; font-size: 0.95rem; font-weight: bold; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-fav:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-fav.active { color: #ef4444; border-color: #fca5a5; background: #fef2f2; }
.btn-fav svg { fill: transparent; stroke: currentColor; transition: 0.2s; }
.btn-fav.active svg { fill: currentColor; }

.btn-fav-mobile { width: auto; padding: 0.45rem 0.8rem; font-size: 0.85rem; margin: 0; box-shadow: none; flex-shrink: 0; }
.btn-fav-mobile svg { width: 18px; height: 18px; }

.mobile-price-box { display: none; margin-bottom: 1.5rem; padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.mobile-price-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 0.8rem; border-bottom: 1px dashed #cbd5e1; padding-bottom: 0.8rem; }
.mobile-price-val { font-size: 1.6rem; font-weight: 900; color: #2563eb; margin: 0; word-break: break-word; line-height: 1.1; }

.mobile-loc-wrapper { display: flex; flex-direction: column; gap: 4px; }
.mobile-loc-main { font-size: 1rem; font-weight: bold; color: #1e293b; display: flex; align-items: flex-start; gap: 6px; line-height: 1.3;}
.mobile-loc-sub { font-size: 0.85rem; color: #64748b; margin-left: 26px; }

.btn-map-link { display: inline-flex; align-items: center; justify-content: center; width: fit-content; gap: 5px; color: #3b82f6; font-size: 0.9rem; font-weight: bold; cursor: pointer; background: none; border: none; padding: 5px 0; transition: 0.2s; }
.btn-map-link:hover { color: #1d4ed8; text-decoration: none; }

.listing-view-wrap { max-width: 1200px; margin: 1.1rem auto; font-family: 'Segoe UI', system-ui, sans-serif; }
.listing-breadcrumb { font-size: 0.95rem; color: #64748b; margin-bottom: 1.1rem; font-weight: 500; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.listing-breadcrumb a { color: #3b82f6; text-decoration: none; }
.listing-breadcrumb a:hover { text-decoration: underline; }
.listing-breadcrumb .sep { color: #cbd5e1; font-size: 0.8rem; }

.listing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: flex-start; }
.listing-main-col { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.listing-gallery { width: 100%; background: #fff; position: relative; user-select: none; }
.inline-slider-wrap { width: 100%; aspect-ratio: 16/10; overflow: hidden; position: relative; touch-action: pan-y; background: #f8fafc; }
.inline-slider-track, .lb-slider-track { display: flex; height: 100%; width: 100%; align-items: center; cursor: grab; transition: transform 0.3s ease-out; will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden; transform: translate3d(0,0,0); }
.inline-slider-track:active, .lb-slider-track:active { cursor: grabbing; }

.inline-slide { flex: 0 0 100%; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.inline-slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.zoom-hint { position: absolute; top: 15px; right: 15px; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); color: #fff; border-radius: 50%; cursor: pointer; z-index: 10; transition: 0.2s; }
.zoom-hint:hover { background: #3b82f6; transform: scale(1.1); }
.listing-gallery-counter { position: absolute; bottom: 15px; left: 15px; background: rgba(0,0,0,0.6); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; pointer-events: none; z-index: 5; }

.inline-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(255,255,255,0.8); border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #1e293b; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: 0.2s; }
.inline-nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.inline-prev { left: 15px; }
.inline-next { right: 15px; }

.listing-thumbs-wrap { display: flex; gap: 10px; padding: 12px; overflow-x: auto; background: #fff; border-top: 1px solid #e2e8f0; scrollbar-width: none; -ms-overflow-style: none; justify-content: safe center; }
.listing-thumbs-wrap::-webkit-scrollbar { display: none; }
.listing-thumb { width: 80px; height: 60px; border-radius: 4px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: 0.6; transition: 0.2s; flex-shrink: 0; background: #f1f5f9; }
.listing-thumb.active { border-color: #3b82f6; opacity: 1; }
.listing-thumb:hover { opacity: 1; }
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.btn-map-link { margin-top: 5px; }
.map-modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85); z-index: 999999; display: none; align-items: center; justify-content: center; padding: 1rem; opacity: 0; transition: opacity 0.2s; }
.map-modal-box { background: #fff; width: 100%; max-width: 800px; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transform: scale(0.95); transition: transform 0.2s; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); }
.map-modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; }
.map-modal-header h3 { margin: 0; font-size: 1.1rem; color: #1e293b; font-weight: bold; }
.map-close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #64748b; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; transition: 0.2s; }
.map-close-btn:hover { color: #ef4444; }
.map-modal-body { padding: 1rem; height: 60vh; min-height: 400px; display: flex; flex-direction: column; }

.listing-details-box { padding: 0.3rem 1rem 1.2rem; }
.listing-title { font-size: 1.6rem; font-weight: bold; color: #1e293b; margin: 1rem 0 1.5rem 0; line-height: 1.3; }

.listing-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-box { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; padding: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.desktop-price-box { display: block; }
.listing-price { font-size: 2rem; font-weight: 800; color: #2563eb; text-align: center; margin: 0 0 1rem 0; word-break: break-word; }
.listing-location { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }

.seller-header { display: flex; align-items: center; gap: 15px; margin-bottom: 1.5rem; }
.seller-avatar { width: 50px; height: 50px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; color: #94a3b8; overflow: hidden; flex-shrink: 0; }
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-info h3 { margin: 0 0 4px 0; font-size: 1.1rem; color: #1e293b; word-break: break-word; }
.seller-info p { margin: 0; font-size: 0.8rem; color: #64748b; }
.seller-meta { font-size: 0.8rem; color: #94a3b8; display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }

.btn-msg { width: 100%; background: #f97316; color: #fff; border: none; padding: 1rem; border-radius: 6px; font-size: 1.05rem; font-weight: bold; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px;}
.btn-msg:hover { background: #ea580c; }
.btn-phone { width: 100%; background: #fff; color: #1e293b; border: 2px solid #cbd5e1; padding: 1rem; border-radius: 6px; font-size: 1.05rem; font-weight: bold; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-phone:hover { background: #f8fafc; border-color: #94a3b8; }

#messageText { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 4px; resize: vertical; margin-bottom: 10px; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; outline: none; transition: all 0.2s; }
#messageText:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3); }
.msg-file-btn { display: inline-flex; align-items: center; gap: 6px; background: #e2e8f0; border: none; border-radius: 4px; padding: 6px 12px; font-size: 0.85rem; color: #475569; font-weight: 600; cursor: pointer; transition: 0.2s; }
.msg-file-btn:hover { background: #cbd5e1; color: #1e293b; }
#msgFileName { font-size: 0.8rem; color: #64748b; margin-left: 10px; word-break: break-all; }

.listing-specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2rem; margin-bottom: 1.5rem; padding-bottom: 2rem; border-bottom: 1px solid #e2e8f0; }
.listing-spec-item { display: flex; flex-direction: column; }
.listing-spec-label { font-size: 0.8rem; color: #64748b; margin-bottom: 4px; }
.listing-spec-val { font-size: 1rem; font-weight: bold; color: #334155; }
.listing-desc-title { font-size: 1.2rem; font-weight: bold; color: #1e293b; margin-bottom: 1rem; }
.listing-description { font-size: 1.05rem; color: #475569; line-height: 1.6; white-space: pre-wrap; }

.lightbox { display: none; position: fixed; inset: 0; background: #000; z-index: 99999; flex-direction: column; }
.lightbox.active { display: flex; }
.lb-header { height: 60px; flex-shrink: 0; display: flex; align-items: center; padding: 0 20px; color: #fff; background: rgba(0,0,0,0.5); z-index: 10; width: 100%; box-sizing: border-box; position: relative; }
.lb-counter { font-size: 1.1rem; font-weight: bold; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; }
.lb-close { position: absolute; width: 60px !important; height: 60px !important; right: 0; background: none; border: none; color: #fff; cursor: pointer; padding: 10px; display: flex; align-items: center; justify-content: right; opacity: 0.8; transition: 0.2s; z-index: 20; }
.lb-close:hover { opacity: 1; color: #ef4444; }

.lb-slider-wrap { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; touch-action: pan-y; }
.lb-slider-track:active { cursor: grabbing; }
.lb-slide { flex: 0 0 100%; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 20px; box-sizing: border-box; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; user-select: none; }

.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.15); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; transition: 0.2s; z-index: 10; }
.lb-nav:hover { background: rgba(255,255,255,0.4); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.lb-thumbs-container { height: 90px; flex-shrink: 0; background: #111; display: flex; align-items: center; padding: 10px; gap: 10px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.lb-thumbs-container::-webkit-scrollbar { display: none; }
.lb-thumb { height: 100%; aspect-ratio: 4/3; opacity: 0.4; cursor: pointer; transition: 0.2s; border: 2px solid transparent; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.lb-thumb.active { opacity: 1; border-color: #3b82f6; }
.lb-thumb:hover { opacity: 1; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

@media (max-width: 992px) {
    .listing-layout { grid-template-columns: 1fr; }
    .lb-nav, .inline-nav { display: none; }
    .lb-slide { padding: 0; }
    .desktop-price-box { display: none !important; }
    .mobile-price-box { display: block; }
    .listing-sidebar > .btn-fav { display: none !important; }
    .listing-title { margin-bottom: 0.8rem; }
}


.inactive-banner { background: #fee2e2; color: #b91c1c; padding: 15px 20px; border-radius: 8px; font-weight: bold; border: 2px solid #fca5a5; display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.inactive-icon { width: 24px; height: 24px; flex-shrink: 0; }
.safety-tips-link { display: inline-block; margin-top: 15px; width: 100%; text-align: center; background: #f0fdf4; color: #166534; padding: 10px; border-radius: 6px; font-weight: 600; text-decoration: none; border: 1px solid #bbf7d0; transition: all 0.2s; box-sizing: border-box; }
.safety-tips-link:hover { background: #dcfce7; }

.url-removed-box { margin-top: 20px; padding: 15px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; }
.url-removed-title { color: #475569; font-size: 0.9rem; display: block; margin-bottom: 12px; font-weight: bold; }
.url-removed-placeholder { color: #94a3b8; font-style: italic; border: 1px dashed #cbd5e1; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.url-reveal-item { margin-top: 8px; display: flex; align-items: flex-start; } 

.btn-reveal { 
    display: inline-flex !important; 
    width: auto !important; 
    background: #f1f5f9; 
    border: 1px solid #cbd5e1; 
    padding: 6px 14px; 
    border-radius: 4px; 
    cursor: pointer; 
    color: #3b82f6; 
    font-weight: 600; 
    font-size: 0.9rem;
    transition: 0.2s; 
}
.btn-reveal:hover { background: #e2e8f0; }
.revealed-link { color: #2563eb; font-weight: bold; word-break: break-all; display: inline-block; padding: 6px 0; }

.ad-uploaded-date { margin-top: 25px; color: #64748b; font-size: 0.95rem; }
.ad-id-box { color: #64748b; font-size: 0.85rem; padding: 10px 0; border-top: 1px dashed #e2e8f0; margin-top: 15px; text-align: left; }

.related-section { margin-top: 40px; }
.related-title { font-size: 1.3rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 20px; margin-top: 0; color: #1e293b; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }

.related-sidebar-section { margin-top: 0; }
.related-sidebar-title { font-size: 1.1rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 15px; margin-top: 0; color: #1e293b; }
.related-sidebar-grid { display: flex; flex-direction: column; gap: 15px; }

.rel-ad-card { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow 0.2s; display: flex; flex-direction: column; background: #fff; }
.rel-ad-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.rel-ad-img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; background: #f1f5f9; flex: 0 0 auto; }
.rel-ad-img.np { display: flex; align-items: center; justify-content: center; font-size: 3.5rem; color: #cbd5e1; margin: 0; }
.rel-ad-info { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.rel-ad-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; min-height: 2.6em; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-ad-loc { color: #64748b; font-size: 0.8rem; margin-bottom: 5px; }
.rel-ad-price { color: #b91c1c; font-weight: bold; margin-top: auto; }

.seller-name-wrapper { margin: 0; display: flex; align-items: center; gap: 8px; }
.online-dot { width: 10px; height: 10px; background-color: #10b981; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff; flex-shrink: 0; }
.seller-meta-dates { color: #334155; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.last-active-highlight { color: #334155; }
.last-active-highlight strong { color: #334155; font-weight: 700; padding: 2px 6px; }


.listing-no-image { width: 100%; aspect-ratio: 16/10; background: #f8fafc; display: flex; align-items: center; justify-content: center; font-size: 5rem; color: #cbd5e1; }

.mobile-loc-icon { flex-shrink: 0; margin-top: 2px; }
.mobile-loc-map-btn { margin-left: 26px; margin-bottom: 15px; }
.desktop-loc-main { font-size: 1.25rem; font-weight: bold; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.desktop-loc-sub { font-size: 0.9rem; color: #64748b; }

.seller-name-link { color: #1e293b; text-decoration: none; }
.seller-name-link:hover { text-decoration: underline; }
.seller-all-ads-link { font-size: 0.85rem; color: #3b82f6; text-decoration: none; font-weight: 600; display: inline-block; margin-top: 4px; }
.seller-all-ads-link:hover { text-decoration: underline; }

.inline-msg-container { margin-bottom: 10px; }
.inline-msg-wrap { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 15px; }
.inline-msg-title { margin: 0 0 10px 0; font-size: 1rem; color: #1e293b; }
.msg-attach-wrap { display: flex; align-items: center; margin-bottom: 10px; }
.msg-error-text { color: #ef4444; font-size: 0.85rem; margin-bottom: 10px; font-weight: bold; }
.btn-msg-submit { margin: 0; width: 100%; padding: 0.7rem; }
.msg-success-wrap { text-align: center; padding: 1rem 0; }
.msg-success-icon { font-size: 2.5rem; line-height: 1; margin-bottom: 10px; }
.msg-success-text { color: #10b981; font-weight: bold; }

.inline-auth-wrap { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 15px; text-align: center; }
.inline-auth-icon { font-size: 2rem; margin-bottom: 10px; line-height: 1; }
.inline-auth-text { color: #475569; font-size: 0.95rem; margin-top: 0; margin-bottom: 15px; }
.inline-auth-link { text-decoration: none; display: block; margin-bottom: 10px; }
.btn-auth-login { margin: 0; padding: 0.7rem; background: #3b82f6; }
.btn-auth-register { margin: 0; padding: 0.7rem; }
.btn-auth-cancel { margin: 0; padding: 0.7rem; width: 100%; border: none; background: #e2e8f0; color: #475569; }
.btn-show-phone { margin-top: 10px; }

.report-btn-wrapper { margin-top: 3rem; padding-top: 1rem; border-top: 1px dashed #e2e8f0; text-align: right; }
.btn-open-report { background: none; border: none; padding:0; color: #94a3b8; font-size: 0.85rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: 0.2s; }
.btn-open-report:hover { color: #64748b; }

.osm-map-container { width: 100%; height: 100%; border-radius: 6px; overflow: hidden; border: 1px solid #e2e8f0; z-index: 1; }
.osm-map-loading { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f8fafc; color: #64748b; font-weight: bold; }
.modal-box-md { max-width: 550px; }
.modal-box-sm { max-width: 450px; }
.modal-title-danger { color: #ef4444; display: flex; align-items: center; gap: 8px; margin: 0; }
.modal-body-auto { height: auto !important; min-height: auto !important; padding: 1.5rem !important; }
.modal-desc-text { margin-top: 0; color: #475569; font-size: 0.95rem; line-height: 1.5; }
.report-textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; outline: none; margin-bottom: 10px; resize: vertical; transition: 0.2s; }
.report-textarea:focus { border-color: #94a3b8; }
.report-error-msg { color: #ef4444; font-size: 0.85rem; margin-bottom: 15px; font-weight: bold; background: #fef2f2; padding: 10px; border-radius: 6px; border: 1px solid #fca5a5; }
.modal-footer-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-modal-cancel { padding: 10px 20px; background: #f1f5f9; color: #475569; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-modal-cancel:hover { background: #e2e8f0; }
.btn-modal-submit { padding: 10px 20px; background: #ef4444; color: #fff; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-modal-submit:hover { background: #dc2626; }
.alert-msg-text { margin-top: 0; color: #475569; font-size: 1rem; line-height: 1.5; margin-bottom: 1.5rem; }
.btn-modal-close { padding: 10px 30px; background: #e2e8f0; color: #475569; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-modal-close:hover { background: #cbd5e1; }
.text-center { text-align: center; }

@media (max-width: 576px) {
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .rel-ad-info {
        padding: 8px;
    }
    .rel-ad-title {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    .rel-ad-price {
        font-size: 0.9rem;
    }
    .rel-ad-loc {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
}

.rel-ad-title-h4 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}