/* ========================================
   ДОГОНИМ.РФ — Минималистичный дизайн
   ======================================== */

/* --- Сброс --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Переменные --- */
:root {
    --bg: #faf9f6;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #6b6b6b;
    --border: #e8e5df;
    --accent: #2c2c2c;
    --accent-hover: #1a1a1a;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --max-width: 640px;
}

/* --- Базовые стили --- */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* --- Навигация --- */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 56px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--text-secondary);
    font-weight: 400;
}

/* --- Контент --- */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* --- Разделы материалов --- */
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* --- Карточки --- */
.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card + .card {
    margin-top: 12px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* --- Сетка брендов --- */
.brands-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.brand-card {
    text-align: center;
    padding: 16px 12px;
}

.brand-card .card-title {
    font-size: 0.9375rem;
}

/* --- Список моделей --- */
.models-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- Кнопка телефона --- */
.button-card {
    margin-bottom: 0;
}

.button-howto {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.button-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 4px 0 12px;
    padding-left: 12px;
    border-left: 3px solid var(--border);
}

.button-actions {
    list-style: none;
    padding: 0;
}

.button-actions li {
    font-size: 0.9375rem;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.button-actions li:last-child {
    border-bottom: none;
}

.button-actions li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 13px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* --- Комбинации --- */
.combo-card .card-title {
    font-size: 1rem;
    color: var(--accent);
}

/* --- Вступление --- */
.intro-card {
    margin-bottom: 24px;
}

.intro-card .card-text {
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Советы --- */
.tips-card {
    margin-top: 32px;
    padding: 20px 20px 16px;
}

.tips-card .section-title {
    margin-top: 0;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    font-size: 0.9375rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    padding-left: 24px;
    position: relative;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    font-weight: 700;
    color: var(--accent);
}

/* --- Кнопка --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: var(--font);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--accent);
    color: #fff;
}

.btn:hover {
    background: var(--accent-hover);
}

/* --- Ссылка назад --- */
.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9375rem;
    margin-bottom: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- 404 --- */
.page-404 {
    text-align: center;
    padding: 60px 20px;
}

.page-404-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}

.page-404-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* --- Мобильная адаптация --- */
@media (max-width: 480px) {
    .header-inner {
        height: 52px;
    }

    .logo {
        font-size: 1.125rem;
    }

    main {
        padding: 16px 12px 32px;
    }

    .page-title {
        font-size: 1.375rem;
    }

    .card {
        padding: 16px;
    }

    .brands-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .brand-card {
        padding: 14px 10px;
    }

    .brand-card .card-title {
        font-size: 0.875rem;
    }

    .section-title {
        margin: 24px 0 10px;
    }
}

@media (max-width: 360px) {
    .logo {
        font-size: 1rem;
    }

    .brands-grid {
        grid-template-columns: 1fr;
    }
}