/* ============================================================================
   RIGHT SIDEBAR (Avito-style)
   ============================================================================ */

/* Лейаут с сайдбаром: основной контент + правая колонка */
.with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: flex-start;
}
.with-sidebar-main { min-width: 0; }

.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}

.sidebar-block {
    background: var(--bg-elev);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(20,24,43,0.04), 0 4px 16px rgba(20,24,43,0.04);
}
.sidebar-block-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

/* Сервисы */
.sidebar-services { display: flex; flex-direction: column; gap: 4px; }
.sidebar-service {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.15s;
    color: var(--text);
}
.sidebar-service:hover { background: var(--bg-soft); color: var(--text); }
.sidebar-service-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-service-name { font-weight: 600; font-size: 14px; }
.sidebar-service-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

/* Вы смотрели */
.sidebar-viewed { display: flex; flex-direction: column; gap: 14px; }
.sidebar-viewed-item {
    display: flex;
    gap: 12px;
    color: var(--text);
    transition: opacity 0.15s;
}
.sidebar-viewed-item:hover { opacity: 0.85; color: var(--text); }
.sidebar-viewed-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
    flex-shrink: 0;
}
.sidebar-viewed-img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-viewed-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-faint); font-size: 24px; }
.sidebar-viewed-info { flex: 1; min-width: 0; }
.sidebar-viewed-price { font-weight: 700; font-size: 15px; color: var(--text); }
.sidebar-viewed-title { font-size: 13px; color: var(--text-soft); line-height: 1.35; margin: 3px 0; }
.sidebar-viewed-city { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.sidebar-viewed-city i { color: var(--brand); font-size: 10px; }

/* Реклама */
.sidebar-ad { position: relative; }
.sidebar-ad-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* Промо-блок помощи */
.sidebar-promo {
    background: #F44336;
    color: #fff;
    text-align: center;
}
.sidebar-promo-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.9; }
.sidebar-promo-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.sidebar-promo-text { font-size: 13px; opacity: 0.9; margin-bottom: 16px; line-height: 1.4; }

/* Footer links */
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 4px;
}
.sidebar-links a { font-size: 13px; color: var(--text-muted); }
.sidebar-links a:hover { color: var(--brand); }
.sidebar-copyright { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* Скрываем сайдбар на планшетах и мобильных */
@media (max-width: 1100px) {
    .with-sidebar { grid-template-columns: 1fr; }
    .right-sidebar { display: none; }
}