:root {
    /* === ОСНОВНІ КОЛЬОРИ === */
    --bg-main: #0b1120;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent-blue: #2AABEE;
    
    /* === КАРТКИ ТА БОРДЕРИ === */
    --card-bg: #111827;
    --card-border: #1f2937;
    --success-color: #10b981;
    
    /* === СПЕЦИФІЧНІ КОЛЬОРИ СТОРІНКИ ОГОЛОШЕННЯ === */
    --text-breadcrumbs: #64748b;
    --text-slash: #475569;
    --text-desc: #cbd5e1;
    
    /* === ПРОЗОРІ КОЛЬОРИ ТА ТІНІ (RGBa) === */
    --nav-bg: rgba(11, 17, 32, 0.85);
    --blue-10: rgba(42, 171, 238, 0.1);
    --blue-15: rgba(42, 171, 238, 0.15);
    --blue-20: rgba(42, 171, 238, 0.2);
}

@font-face { font-family: 'e-Ukraine'; src: url('/static/fonts/e-Ukraine-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'e-Ukraine'; src: url('/static/fonts/e-Ukraine-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'e-Ukraine', -apple-system, sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; width: 100%; }
main { flex-grow: 1; padding: 40px 0 80px; }

/* ========================================== */
/* === 1. ШАПКА === */
/* ========================================== */
.top-nav { background-color: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--card-border); position: sticky; top: 0; z-index: 100; width: 100%; }
.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.nav-logo { font-size: 1.4rem; font-weight: 800; color: var(--text-main); letter-spacing: 0.5px; text-decoration: none; }
.nav-logo span { color: var(--accent-blue); }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; text-decoration: none; transition: all 0.3s ease; }
.btn-primary { background-color: var(--blue-10); color: var(--accent-blue); border: 1px solid var(--blue-15); padding: 10px 20px; font-size: 0.9rem; font-weight: 700; box-shadow: none; }
.btn-primary:hover { background-color: var(--accent-blue); color: var(--text-main); border-color: var(--accent-blue); transform: translateY(-2px); }

/* ========================================== */
/* === 2. БАНЕР === */
/* ========================================== */
.banner-section { width: 100%; margin: 20px 0 10px; display: block; }
.promo-banner-link { display: block; width: 100%; aspect-ratio: 1000 / 150; border-radius: 12px; overflow: hidden; border: 1px solid var(--card-border); background: var(--card-bg); transition: transform 0.3s ease, border-color 0.3s ease; will-change: transform; }
.promo-banner-link:hover, .promo-banner-link:focus-visible { border-color: var(--accent-blue); transform: scale(1.005); outline: none; }
.promo-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ========================================== */
/* === 3. ХЛІБНІ КРИХТИ === */
/* ========================================== */
.page-navigation { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; padding-top: 10px; } 
.page-navigation::-webkit-scrollbar { display: none; } 
.back-btn { display: flex; align-items: center; gap: 6px; color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.2s ease; flex-shrink: 0; background: none; border: none; padding: 0; cursor: pointer; } 
.back-btn:hover { color: var(--accent-blue); } 
.breadcrumbs { display: flex; align-items: center; gap: 4px; font-size: 0.9rem; color: var(--text-breadcrumbs); } 
.breadcrumbs a { color: var(--text-breadcrumbs); text-decoration: none; transition: color 0.2s ease; } 
.breadcrumbs a:hover { color: var(--accent-blue); } 
.breadcrumbs .slash { color: var(--text-slash); margin: 0 4px; } 
.breadcrumbs .current { color: var(--text-breadcrumbs); cursor: default; }

/* ========================================== */
/* === 4. СТИЛЬ ОГОЛОШЕННЯ === */
/* ========================================== */
.post-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 24px; overflow: hidden; margin-bottom: 30px; }
.post-image-container { width: 100%; border-bottom: 1px solid var(--card-border); background: var(--bg-main); }
.post-image { width: 100%; height: auto; display: block; }
.post-content { padding: 40px; }
.post-title { color: var(--text-main); font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.post-price-simple { color: var(--accent-blue); font-size: 2.5rem; font-weight: 800; margin-bottom: 25px; }
.post-description { color: var(--text-desc); font-size: 1.15rem; line-height: 1.8; margin-bottom: 40px; white-space: pre-line; }

/* ========================================== */
/* === КНОПКИ ЗВ'ЯЗКУ === */
/* ========================================== */
.action-buttons { display: flex; gap: 16px; }
.btn-contact { flex: 1; padding: 18px; border-radius: 16px; font-weight: 700; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.1rem; transition: 0.3s ease; }
.btn-telegram { background: var(--accent-blue); color: var(--text-main); }
.btn-phone { background: transparent; color: var(--accent-blue); border: 1px solid var(--accent-blue); }
.btn-contact:hover { transform: translateY(-3px); filter: brightness(1.1); }
.no-contacts { width: 100%; padding: 20px; text-align: center; color: var(--text-muted); border: 1px dashed var(--card-border); border-radius: 16px; font-style: italic; }

@media (max-width: 600px) { .post-content { padding: 25px; } .post-title { font-size: 1.6rem; } .post-price-simple { font-size: 1.8rem; } .action-buttons { flex-direction: column; } }

/* ========================================== */
/* === 5. ТЕЛЕГРАМ === */
/* ========================================== */
.post-tg-promo { background: linear-gradient(135deg, var(--blue-10) 0%, var(--card-bg) 100%); border: 1px solid var(--blue-20); border-radius: 20px; padding: 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 25px; }
.promo-info { display: flex; align-items: center; gap: 15px; }
.promo-info strong { display: block; font-size: 1.15rem; color: var(--text-main); margin-bottom: 4px; }
.promo-info p { font-size: 0.95rem; color: var(--text-muted); margin: 0; }
.promo-link { background: var(--accent-blue); color: var(--text-main); text-decoration: none; padding: 14px 28px; border-radius: 14px; font-weight: 700; transition: 0.3s; white-space: nowrap; }
.promo-link:hover { transform: scale(1.03); filter: brightness(1.1); }
@media (max-width: 600px) { .post-tg-promo { flex-direction: column; text-align: center; padding: 20px; } .promo-info { flex-direction: column; gap: 10px; } .promo-link { width: 100%; } }

/* ========================================== */
/* === 6. СІТКА СХОЖИХ ОГОЛОШЕНЬ (КАРУСЕЛЬ) === */
/* ========================================== */
#relatedAdsGrid { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 15px; padding-bottom: 20px; scrollbar-width: thin; scrollbar-color: var(--accent-blue) var(--card-border); }
#relatedAdsGrid::-webkit-scrollbar { height: 8px; }
#relatedAdsGrid::-webkit-scrollbar-track { background: var(--card-border); border-radius: 10px; }
#relatedAdsGrid::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 10px; }
#relatedAdsGrid .ad-card { flex: 0 0 auto; width: 240px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; transition: 0.3s ease; display: flex; flex-direction: column; cursor: pointer; text-decoration: none; color: var(--text-main); }
#relatedAdsGrid .ad-card:hover { transform: translateY(-5px); border-color: var(--accent-blue); box-shadow: 0 10px 20px rgba(0,0,0,0.2), 0 0 15px var(--blue-10); }
#relatedAdsGrid .ad-image-container { width: 100%; height: 140px; position: relative; overflow: hidden; background-color: #1e293b; }
#relatedAdsGrid .ad-image { width: 100%; height: 100%; object-fit: cover; transition: 0.5s ease; }
#relatedAdsGrid .ad-card:hover .ad-image { transform: scale(1.05); }
#relatedAdsGrid .ad-emoji-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; background: linear-gradient(135deg, #1e293b, var(--bg-main)); }
#relatedAdsGrid .ad-content { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
#relatedAdsGrid .ad-meta { margin-bottom: 12px; }
#relatedAdsGrid .badge-niche { background: var(--blue-10); color: var(--accent-blue); padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }
#relatedAdsGrid .ad-title-small { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; color: var(--text-main); }
#relatedAdsGrid .ad-price-small { font-size: 1.15rem; font-weight: 800; color: var(--accent-blue); margin-bottom: 12px; }
#relatedAdsGrid .ad-btn { margin-top: auto; display: block; width: 100%; text-align: center; padding: 8px; font-size: 0.9rem; background: var(--blue-5); color: var(--accent-blue); border-radius: 8px; font-weight: 600; border: 1px solid var(--blue-20); transition: 0.2s; }
#relatedAdsGrid .ad-card:hover .ad-btn { background: var(--accent-blue); color: var(--text-main); }

/* ========================================== */
/* === 7. ПІДВАЛ === */
/* ========================================== */
.seo-links-container { margin-top: 20px; padding-top: 10px; text-align: center; padding-bottom: 60px; }
.seo-links-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 25px; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px; }
.seo-wrapper { position: relative; padding-bottom: 10px; margin: 0 auto; max-width: 1000px; }
.seo-links-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-height: 130px; overflow: hidden; transition: max-height 0.6s ease; padding-top: 4px; }
.seo-links-grid.expanded { max-height: 3000px; }
.seo-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; padding: 8px 16px; background: var(--white-2); border-radius: 12px; transition: 0.3s; border: 1px solid var(--white-5); display: inline-block; }
.seo-link:hover { color: var(--accent-blue); background: var(--blue-5); border-color: var(--blue-20); transform: translateY(-2px); }
.seo-fade { position: absolute; bottom: 0; left: 0; width: 100%; height: 60px; background: linear-gradient(to bottom, transparent, var(--bg-main)); pointer-events: none; transition: opacity 0.3s ease; }
.seo-links-grid.expanded + .seo-fade { opacity: 0; }
.seo-toggle-btn { margin-top: 15px; background: transparent; border: none; color: var(--accent-blue); font-size: 1rem; font-weight: 600; cursor: pointer; transition: 0.2s; padding: 10px 20px; border-radius: 8px; }
.seo-toggle-btn:hover { background: var(--blue-5); }
footer { border-top: 1px solid var(--card-border); padding: 40px 20px; text-align: center; background: var(--footer-bg); }
.footer-text { color: var(--text-muted); font-size: 0.95rem; }