/* --- MODERN STYLE RESET & VARIABLES --- */
:root {
    --primary-color: #0099de;       /* Основной синий (бренд) */
    --accent-color: #ff6163;        /* Акцентный (кнопки, важное) */
    --text-main: #191919;           /* Основной текст (не черный, а темно-серый) */
    --text-secondary: #7f8c99;      /* Вторичный текст */
    --bg-body: #f2f4f6;             /* Фон страницы */
    --bg-card: #ffffff;             /* Фон карточек */
    --radius-md: 12px;              /* Скругление карточек */
    --radius-sm: 8px;               /* Скругление кнопок/полей */
    --shadow-sm: 0 4px 20px rgba(0,0,0,0.05); /* Мягкая тень */
    --shadow-hover: 0 12px 24px rgba(0,0,0,0.12); /* Тень при наведении */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3 { margin: 0 0 15px 0; font-weight: 700; }

/* --- HEADER --- */
header {
    background-color: #fff;
    padding: 16px 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08); /* Тонкая линия снизу */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1240px; /* Чуть шире стандартного */
    margin: 0 auto;
    padding: 0 20px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 22px; /* Чуть меньше шрифт, так как есть иконка */
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary-color), #006296); /* Градиент */
    color: #fff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px; /* Скругленный квадрат */
    margin-right: 10px;
    font-size: 20px;
}

.logo span.highlight {
    color: var(--primary-color);
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
}

.nav-links a:hover { color: var(--primary-color); }

.btn-add {
    background-color: var(--accent-color);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: 30px; /* Овальная кнопка */
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 97, 99, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(255, 97, 99, 0.4);
}

/* --- LAYOUT --- */
.main-wrapper {
    display: flex;
    gap: 32px; /* Больше воздуха между меню и контентом */
    margin-top: 30px;
    align-items: flex-start;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: transparent; /* Убираем фон у сайдбара */
    box-shadow: none;
    padding: 0;
}

.sidebar h3 {
    font-size: 18px;
    margin-bottom: 12px;
    padding-left: 10px;
}

.category-list li {
    margin-bottom: 4px;
}

.category-list a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 15px;
}

.category-list a:hover {
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* --- CONTENT --- */
.content {
    flex-grow: 1;
    min-width: 0; /* Фикс для Grid */
}

h1 {
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 24px;
}

.breadcrumbs {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.breadcrumbs a { color: var(--text-secondary); border-bottom: 1px solid transparent; }
.breadcrumbs a:hover { border-bottom-color: var(--text-secondary); }

/* --- ADS GRID (MODERN CARDS) --- */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.ad-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    /* Убираем рамку, оставляем только тень */
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ad-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.ad-img {
    height: 180px; /* Картинки выше */
    background-color: #eef2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px; /* Большие эмодзи */
    position: relative;
}

.ad-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.3;
    /* Обрезка длинного текста */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-card:hover .ad-title {
    color: #0077b5; /* Чуть темнее при наведении */
}

.ad-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.ad-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: auto; /* Прижимает описание к низу, если есть место */
    
    /* Обрезка текста */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- ARTICLES BLOCK STYLES --- */
.articles-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 26px;
    margin: 0;
}

.link-all {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.article-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.article-img {
    height: 160px;
    background-color: #dfe6e9; /* Серый фон заглушка */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #b2bec3;
}

.article-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.article-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--text-main);
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}

.article-link {
    margin-top: auto;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

/* --- FOOTER --- */
footer {
    background-color: #fff;
    color: var(--text-secondary);
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid #eee;
    text-align: center;
}

footer a { color: var(--primary-color); }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .main-wrapper { flex-direction: column; }
    .sidebar { width: 100%; overflow-x: auto; }
    .category-list { display: flex; gap: 10px; padding-bottom: 10px; }
    .category-list a { white-space: nowrap; background: #fff; padding: 10px 16px; border: 1px solid #eee; }
    
    .header-inner { flex-direction: column; gap: 15px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
    .ads-grid { grid-template-columns: 1fr; } /* Одна колонка на телефонах */
    .ad-img { height: 220px; }
    .btn-add { width: 100%; text-align: center; }
}