/* ==========================================================================
   [БЛОК 1] 💾 КОРНЕВЫЕ НАСТРОЙКИ, ФОН И ПЕРЕМЕННЫЕ (ПРИМЕНЯЮТСЯ КО ВСЕМУ САЙТУ)
   ========================================================================== */
:root {
    --color-brand-green: #065f46;       
    --color-brand-green-light: #a7f3d0; 
    --color-brand-red: #fca5a5;         
    --color-text-main: #0f172a;         
    --color-text-muted: #64748b;        
    --color-bg-page: #f8fafc;          
}

body.carshub-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-bg-page);
    color: var(--color-text-main);
    padding-bottom: 84px;
    box-sizing: border-box;
}


/* ==========================================================================
   [БЛОК 2] 📱 ШАПКА САЙТА (ЛОГОТИП И ПОДЗАГОЛОВОК)
   ========================================================================== */
.app-header {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    margin: 16px 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.logo-main { margin: 0; font-size: 20px; font-weight: 900; color: var(--color-brand-green); letter-spacing: -0.5px; }
.logo-dot { color: var(--color-brand-red); }
.logo-sub { margin: 2px 0 0 0; font-size: 11px; font-weight: 700; color: var(--color-text-muted); }

/* ==========================================================================
   [БЛОК 3] 🚗 ЛЕНТА ОБЪЯВЛЕНИЙ (НАШ СОБСТВЕННЫЙ СВЕРХБЫСТРЫЙ СЛАЙДЕР)
   ========================================================================== */
.feed-ad-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin: 0 12px 16px 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01);
    position: relative;
}

/* Наша облегченная галерея свайпов */
.card-photo-slider {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
/* Скрываем уродливую полосу прокрутки браузера */
.card-photo-slider::-webkit-scrollbar { display: none; }

.card-photo-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #475569;
    cursor: pointer;
    scroll-snap-align: start;
}

/* СДВОЕННЫЙ КОНТЕЙНЕР: ВЫРАВНИВАЕТ МАРКУ И ЦЕНУ НА ОДНОЙ ЛИНИИ ПО КРАЯМ */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.card-top-row .card-title-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text-main);
    margin-bottom: 0;
}

.card-top-row .card-price-byn {
    font-size: 18px;
    font-weight: 900;
    color: var(--color-text-main);
    margin: 0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}

.price-exchange-icon {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.card-price-byn:active .price-exchange-icon {
    transform: rotate(180deg);
}

.card-gen-text {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 13px;
    margin-top: 2px;
    margin-bottom: 12px;
}

.card-grid-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin: 12px 0;
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

.card-grid-specs div { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.card-location-block {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-top: 10px;
}





/* ==========================================================================
   [БЛОК 4] ❤️ ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ КАРТОЧКИ (КНОПКА ИЗБРАННОГО / СЕРДЕЧКО)
   ========================================================================== */
.btn-favorite-heart {
    position: absolute;
    top: 26px;
    right: 26px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    z-index: 10;
}
.btn-favorite-heart.active { color: #ef4444; border-color: #fca5a5; }
.btn-favorite-heart.active svg { fill: #ef4444; }


/* ==========================================================================
   [БЛОК 5] 📱 НИЖНИЙ НАВИГАЦИОННЫЙ БАР (ТАББАР САЙТА И КНОПКИ)
   ========================================================================== */
.app-navbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100000;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    height: 64px;
    box-sizing: border-box;
}
.nav-btn-stock {
    background: none; border: none; font-size: 22px; cursor: pointer; padding: 8px;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted); -webkit-tap-highlight-color: transparent;
}
.nav-btn-center-plus {
    background: var(--color-brand-green-light); 
    border: 1px solid #6ee7b7; 
    color: var(--color-brand-green);
    font-size: 26px; font-weight: 900; width: 54px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.15); margin-top: -24px; z-index: 100001;
    transition: transform 0.2s; outline: none; -webkit-tap-highlight-color: transparent;
}
.nav-btn-chats-ghost { background: none; border: none; font-size: 22px; width: 44px; height: 44px; opacity: 0; pointer-events: none; margin-right: -44px; }
.nav-btn-cabinet-vector { background: none; border: none; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); margin-right: 12%; }



/* ==========================================================================
   [БЛОК 5] 📱 НИЖНИЙ НАВИГАЦИОННЫЙ БАР И СТИЛИ КНОПОК ПАГИНАЦИИ
   ========================================================================== */

/* 🔢 Кнопки переключения страниц (1, 2, 3...) */
.ch-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 24px 12px 20px 12px;
}

.ch-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--color-text-main);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

/* Активная страница в фирменном изумрудном цвете CARSHUB */
.ch-page-btn.active {
    background: var(--color-brand-green-light);
    border-color: #6ee7b7;
    color: var(--color-brand-green);
    box-shadow: 0 3px 8px rgba(6, 95, 70, 0.1);
}

/* 📱 Нижний фиксированный таббар сайта */
.app-navbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100000;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    height: 64px;
    box-sizing: border-box;
}

.nav-btn-stock {
    background: none; border: none; font-size: 22px; cursor: pointer; padding: 8px;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted); -webkit-tap-highlight-color: transparent;
}

.nav-btn-center-plus {
    background: var(--color-brand-green-light); 
    border: 1px solid #6ee7b7; 
    color: var(--color-brand-green);
    font-size: 26px; font-weight: 900; width: 54px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 4px 12px rgba(6, 95, 70, 0.15); margin-top: -24px; z-index: 100001;
    transition: transform 0.2s; outline: none; -webkit-tap-highlight-color: transparent;
}

.nav-btn-chats-ghost { background: none; border: none; font-size: 22px; width: 44px; height: 44px; opacity: 0; pointer-events: none; margin-right: -44px; }
.nav-btn-cabinet-vector { background: none; border: none; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); margin-right: 12%; }




/* ==========================================================================
   [БЛОК 6] 🚗 СТРАНИЦА АНКЕТЫ (ШАПКА И ВЕРХНЯЯ ГАЛЕРЕЯ ФОТО)
   ========================================================================== */
.ad-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.btn-back-link {
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ad-page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: -0.3px;
    text-align: center;
}

/* Оболочка под большую галерею внутри анкеты */
.ad-photo-gallery-wrapper {
    margin: 12px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

/* Переиспользуем наш сверхбыстрый горизонтальный скролл свайпами */
.ad-photo-gallery-wrapper .card-photo-slider {
    height: 240px; /* Делаем главное фото в анкете крупнее и солиднее */
    margin-bottom: 0;
}
