/* ================= БАЗОВЫЕ НАСТРОЙКИ ================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    /* Системный шрифт для быстрой загрузки */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
}

body { 
    background-color: #f5f5f5; /* Светло-серый фон */
    color: #333; 
    padding-bottom: 80px; /* Отступ снизу, чтобы контент не перекрывался нижним меню */
}

a { 
    text-decoration: none; 
    color: inherit; 
    -webkit-tap-highlight-color: transparent; /* Убирает синюю подсветку при клике на мобильном */
}

/* ================= ШАПКА (HEADER) ================= */
.header {
    position: sticky; /* Меню "прилипает" к верху */
    top: 0;
    background: #fff;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
    z-index: 1001;
}

.burger-menu { 
    font-size: 26px; 
    cursor: pointer; 
    padding: 5px; /* Увеличиваем область нажатия */
}

.logo { 
    font-size: 18px; 
    font-weight: 700; 
}

/* --- ВЫПАДАЮЩЕЕ МЕНЮ (МОБИЛЬНОЕ) --- */
.mobile-menu {
    display: none; /* Скрыто по умолчанию */
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    animation: slideDown 0.3s ease-out;
}

/* Класс active добавляется через JS, чтобы показать меню */
.mobile-menu.active {
    display: block;
}

.menu-link {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    border-bottom: 1px solid #f9f9f9;
}
.menu-link:last-child { border-bottom: none; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ГОРИЗОНТАЛЬНОЕ МЕНЮ КАТЕГОРИЙ --- */
.category-nav {
    display: flex;
    overflow-x: auto; /* Горизонтальная прокрутка */
    white-space: nowrap;
    padding: 0 10px;
    background: #fff;
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
.category-nav::-webkit-scrollbar { display: none; }

.cat-link {
    padding: 12px 15px;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid transparent;
}
.cat-link.active {
    color: #000;
    border-bottom: 2px solid #000;
}

/* ================= КОНТЕНТ ================= */
.main-container {
    padding: 15px;
    max-width: 600px; 
    margin: 0 auto;
}

h1 {
    font-size: 22px;
    margin: 20px 0;
    text-align: center;
    line-height: 1.3;
}

/* ПЕРЕКЛЮЧАТЕЛЬ (ТАБЫ) */
.rent-type-toggle {
    display: flex;
    background: #e0e0e0;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.toggle-btn.active {
    background: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ================= КАРТОЧКА ОБЪЯВЛЕНИЯ ================= */
.listing-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.card-header {
    padding: 12px 15px;
    background: #f9f9f9;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #eee;
    /* Обрезаем длинный текст троеточием */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

/* СЛАЙДЕР ФОТО */
.photo-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* Магнитная прокрутка */
    -webkit-overflow-scrolling: touch;
    height: 250px;
}

.slide {
    flex: 0 0 92%; /* Показываем 92% слайда, чтобы было видно край следующего */
    scroll-snap-align: center;
    margin-right: 8px;
    background-color: #ddd;
    /* Центровка заглушки (потом удалим) */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #888;
}
.slide:first-child { margin-left: 0; } 

.card-info {
    padding: 15px;
}

.card-features {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.6;
}

.card-price {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
}

/* КНОПКИ МЕССЕНДЖЕРОВ */
.contact-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.btn-whatsapp { background-color: #25D366; }
.btn-whatsapp:active { background-color: #1EBE57; }

.btn-telegram { background-color: #0088cc; }
.btn-telegram:active { background-color: #0077b5; }

.post-date {
    margin-top: 10px;
    text-align: right;
    font-size: 12px;
    color: #999;
}

/* РЕКЛАМНЫЙ БЛОК */
.ad-block {
    background: #eef;
    border: 1px dashed #bbc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
    color: #668;
    font-size: 14px;
}

/* ================= НИЖНЕЕ МЕНЮ ================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom)); /* Учет айфона без кнопки */
    z-index: 1000;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: #999;
    width: 25%;
}

.nav-item.active { color: #000; }

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}