/* client/main_style.css */

/* ==========================================================================
   1. ОБЩИЕ СБРОСЫ И БАЗОВЫЕ СТИЛИ
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5; 
    color: #333;           
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: #007bff; 
    text-decoration: none;
}
a:hover {
    color: #0056b3;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    color: #6c757d;
}
.breadcrumb-item a {
    text-decoration: none;
    color: #007bff;
}
.breadcrumb-item a:hover {
    text-decoration: underline;
}
.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* ==========================================================================
   2. ЕДИНЫЙ СТИЛЬ ДЛЯ КНОПОК
   ========================================================================== */
.btn {
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.4375rem 0.875rem;
    font-size: 0.9rem;       
    border-radius: 0.25rem;    
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus, .btn.focus { outline: 0; box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); }
.btn:disabled, .btn.disabled { opacity: 0.65; cursor: not-allowed; box-shadow: none; }

.btn i.icon-main,
.btn i { 
    margin-right: 0.4em; 
}
.btn.icon-only i,
.btn .icon-only-tablet { 
    margin-right: 0; 
}

.btn-primary { color: #fff; background-color: #007bff; border-color: #007bff; }
.btn-primary:hover { color: #fff; background-color: #0069d9; border-color: #0062cc; }
.btn-primary:focus, .btn-primary.focus { box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5); }

.btn-secondary { color: #fff; background-color: #6c757d; border-color: #6c757d; }
.btn-secondary:hover { color: #fff; background-color: #5a6268; border-color: #545b62; }
.btn-secondary:focus, .btn-secondary.focus { box-shadow: 0 0 0 0.2rem rgba(130, 138, 145, 0.5); }

.btn-success { color: #fff; background-color: #28a745; border-color: #28a745; }
.btn-success:hover { color: #fff; background-color: #218838; border-color: #1e7e34; }
.btn-success:focus, .btn-success.focus { box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5); }

.btn-danger { color: #fff; background-color: #dc3545; border-color: #dc3545; }
.btn-danger:hover { color: #fff; background-color: #c82333; border-color: #bd2130; }
.btn-danger:focus, .btn-danger.focus { box-shadow: 0 0 0 0.2rem rgba(225, 83, 97, 0.5); }

.btn-warning { color: #212529; background-color: #ffc107; border-color: #ffc107; }
.btn-warning:hover { color: #212529; background-color: #e0a800; border-color: #d39e00; }
.btn-warning:focus, .btn-warning.focus { box-shadow: 0 0 0 0.2rem rgba(222, 170, 12, 0.5); }

.btn-info { color: #fff; background-color: #17a2b8; border-color: #17a2b8; }
.btn-info:hover { color: #fff; background-color: #138496; border-color: #117a8b; }
.btn-info:focus, .btn-info.focus { box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5); }

.btn-light { color: #212529; background-color: #f8f9fa; border-color: #dee2e6; }
.btn-light:hover { color: #212529; background-color: #e2e6ea; border-color: #dae0e5; }
.btn-light:focus, .btn-light.focus { box-shadow: 0 0 0 0.2rem rgba(216, 217, 219, 0.5); }

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; border-radius: 0.2rem; }
.btn-lg { padding: 0.5rem 1rem; font-size: 1.1rem; border-radius: 0.3rem; }

.card-icons-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
}

.boost-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.boost-icon i {
    color: #28a745;
    font-size: 1rem;
}

.vip-badge-icon {
    background-color: #FFD700;
    color: #333;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 4px;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
   3. СТИЛИ ШАПКИ САЙТА
   ========================================================================== */
header {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    top: 0;
    z-index: 1020; 
    border-bottom: 1px solid #e9ecef;
}

header .container {
    width: 90%;
    max-width: 900px;
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 6px 15px; 
    gap: 15px; 
    min-height: 56px; 
    position: relative; 
}

.logo a {
    text-decoration: none;
    font-size: 1.5rem; 
    font-weight: 700;
    color: #007bff; 
    margin-right: 20px; 
    white-space: nowrap;
}
.menu-toggle {
    display: none; 
    background: transparent; border: none; cursor: pointer; padding: 5px;
    font-size: 1.5rem; color: #007bff; 
}
.header-nav { 
    display: flex;
    align-items: center;
    flex-grow: 1; 
    justify-content: flex-end; 
    gap: 12px; 
}
.search-bar {
    display: flex;
    flex-grow: 1; 
    max-width: 400px; 
    height: 38px;
}
.search-bar input[type="search"] {
    flex-grow: 1; padding: 0.375rem 0.75rem; border: 1px solid #ced4da;
    border-right: none; border-radius: 0.25rem 0 0 0.25rem; outline: none;
    font-size: 0.9rem; box-sizing: border-box;
}
.search-bar input[type="search"]::placeholder { color: #6c757d; }
.search-bar .btn-search {
    border-radius: 0 0.25rem 0.25rem 0; padding: 0.375rem 0.75rem;
    font-size: 0.9rem; height: 100%;
}
.city-filter, .language-selector { display: flex; align-items: center; }
#cityFilter, .language-selector select {
    padding: 0.4375rem 2rem 0.4375rem 0.75rem; border: 1px solid #ced4da; 
    border-radius: 0.25rem; font-size: 0.9rem; background-color: #fff; 
    color: #495057; cursor: pointer; outline: none; appearance: none; 
    -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23495057' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.5rem center;
    background-size: 0.75em 0.75em; height: 38px; box-sizing: border-box;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
#cityFilter { min-width: 160px; }
.language-selector select { min-width: auto; padding-left: 0.5rem; padding-right: 1.75rem; }
#cityFilter:focus, .language-selector select:focus { border-color: #80bdff; box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); }

.auth-user-container { display: flex; align-items: center; }
.auth-button { height: 38px; font-size: 0.9rem; }
.user-info { display: none; align-items: center; gap: 10px; }


/* ==========================================================================
   5. СТИЛИ КОНТЕНТА
   ========================================================================== */

/* Слайдер главного баннера */
.slider-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.slide {
    min-width: 100%;
    box-sizing: border-box;
    position: relative;
}
.slide img {
    width: 100%;
    height: auto;
    max-height: 400px;
    display: block;
    object-fit: cover;
}
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.prev:hover, .next:hover {
    background: rgba(0, 0, 0, 0.7);
}
.prev { left: 10px; }
.next { right: 10px; }

/* ==========================================================================
   6. КНОПКА "НАВЕРХ" (SCROLL TO TOP)
   ========================================================================== */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 20px;
    line-height: 45px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0; /* Изначально кнопка невидима */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Слайдер Категорий Услуг */
.categories-slider-wrapper {
    position: relative;
    margin: 30px 0;
}
.categories.categories-slider {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
    gap: 15px;
    align-items: stretch;
}
.categories.categories-slider::-webkit-scrollbar {
    display: none;
}

.category {
    width: 100px;
    height: 80px;
    padding: 12px 8px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}
.category:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: #cccccc;
}
.category i {
    font-size: 28px;
    color: #4a76a8;
    transition: color 0.2s ease;
}
.category div {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333333;
    line-height: 1.25;
    transition: color 0.2s ease;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category:hover i, .category:hover div {
    color: #3a5d8a;
}
.category.active {
    background-color: #4a76a8;
    border-color: #4a76a8;
    box-shadow: 0 2px 8px rgba(74, 118, 168, 0.3);
    transform: translateY(0);
}
.category.active i, .category.active div {
    color: #ffffff;
}
.category.active div {
    font-weight: 600;
}

.categories-slider-wrapper .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background-color 0.2s, box-shadow 0.2s;
}
.categories-slider-wrapper .slider-nav:hover {
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.categories-slider-wrapper .slider-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.categories-slider-wrapper .slider-nav.prev {
    left: -15px;
}
.categories-slider-wrapper .slider-nav.next {
    right: -15px;
}

/* Подкатегории */
.subcategories-container {
    background-color: #eef2f7;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #d8dfea;
    margin-top: 10px;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    animation: fadeInSubcats 0.3s ease-out;
}
@keyframes fadeInSubcats {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.subcategory-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #fff;
    color: #4a76a8;
    border: 1px solid #cdd5e0;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    margin-bottom: 5px;
}
.subcategory-link:hover {
    background-color: #f0f5fc;
    border-color: #a8b9d0;
    color: #3a5d8a;
}
.subcategory-link.active {
    background-color: #4a76a8;
    color: #fff;
    border-color: #4a76a8;
    font-weight: 500;
}

/* Секции (Рекомендации, Акции, Все услуги) */
.section {
    margin-bottom: 30px;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}
.section-title h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}
.show-all {
    color: #4a76a8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}
.show-all:hover {
    text-decoration: underline;
}
.show-all i {
    margin-left: 4px;
}

/* Карточки объявлений */
.cards-container {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1280px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
    }
}


.card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}
.card.vip {
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    background: linear-gradient(180deg, #FFF8E1, #FFFFFF);
}
.card.vip:hover {
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

.card.vip .card-info h3 {
    color: #DAA520;
}
.card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.card-rating, .card-comments, .card-views, .card-discount {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    line-height: 1;
    z-index: 5;
}
.card-rating { top: 10px; right: 10px; }
.card.vip .card-rating { right: 70px; }
.card-comments {
    bottom: 12px; right: 10px; 
}
.card-discount { top: 10px; left: 10px; background-color: #e52e71; font-weight: bold; }
.card-views { bottom: 10px; left: 10px; }
.card-rating i, .card-comments i, .card-views i {
    margin-right: 4px;
}
.card-rating i { color: #ffc107; }
.card-comments i { color: #a8dadc; }
.card-views i { color: #f1faee; }

.card-info {
    padding-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 35px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.card-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.3;
    color: #2b2d42;
}
.card-info p {
    color: #495057;
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 8px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-info .location {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 0.5rem;
    margin-top: auto;
    padding-top: 8px;
}
.card-info .location i {
    margin-right: 5px;
}
.listing-date {
    font-size: 0.5rem;
    color: #8690A0;
    margin-top: 5px;
    text-align: right;
}

.card-location-date{
    font-size: 12px;
}
.listing-date i {
    margin-right: 5px;
}

.favorite-btn {
    position:absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}
.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}
.favorite-btn i {
    color: #dc3545;
    font-size: 1rem;
}
.favorite-btn.active i {
    font-weight: 900;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}
.modal-content {
    background-color: white;
    margin: 5vh auto;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}
.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.close:hover {
    color: black;
}
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.auth-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
    outline: none;
}
.auth-tab:hover {
    color: #000;
}
.auth-tab.active {
    color: #4a76a8;
    border-bottom-color: #4a76a8;
    font-weight: bold;
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.form-group input:focus, .form-group select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}
.form-group .radio-group { display: flex; gap: 15px; }
.form-group .radio-option { display: flex; align-items: center; }
.form-group .radio-option input { width: auto; margin-right: 5px; }

.submit-btn {
    background-color: #4a76a8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-size: 1rem;
    transition: background-color 0.2s;
}
.submit-btn:hover {
    background-color: #3a5d8a;
}
.error-message, .success-message {
    font-size: 0.85rem;
    text-align: center;
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 4px;
    min-height: 1.2em;
}
.error-message { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; }
.success-message { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; }

#forgotPasswordLink, #backToLoginLink {
    font-size: 0.9rem;
    color: #4a76a8;
    text-decoration: none;
}
#forgotPasswordLink:hover, #backToLoginLink:hover {
    text-decoration: underline;
}

#scrollLoadingIndicator {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}
#scrollObserverMarker {
    height: 10px;
}

/* Подвал */
.footer {
    background: #f5f5f5;
    color: #1F2937;
    padding: 35px 0;
    font-family: 'Inter', 'Arial', sans-serif;
    font-size: 1em;
    border-top: 1px solid #E5E7EB;
}
.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 0 20px;
}
.footer-logo h2 {
    font-size: 1.4em;
    margin: 0 0 8px;
    color: #111827;
    font-weight: 700;
}
.footer-logo p {
    font-size: 0.85em;
    color: #6B7280;
    margin: 0;
}
.footer-links h3,
.footer-contact h3,
.footer-social h3 {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 10px;
    color: #111827;
}
.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links ul li {
    margin-bottom: 5px;
}
.footer-links ul li a {
    color: #1F2937;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s ease;
}
.footer-links ul li a:hover {
    color: #374151;
}
.footer-contact p {
    font-size: 0.9em;
    color: #6B7280;
    margin: 5px 0;
}
.footer-contact a { 
    color: #1F2937;
    text-decoration: none;
}
.footer-contact a:hover {
    color: #374151;
}
.footer-social a {
    color: #1F2937;
    font-size: 1.1em;
    margin-right: 10px;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-social a:hover {
    color: #374151;
}
.footer-bottom {
    text-align: center;
    padding: 15px 0;
    margin-top: 25px;
    border-top: 1px solid #E5E7EB;
}
.footer-bottom p {
    font-size: 0.8em;
    color: #6B7280;
    margin: 2px 0;
}
.footer-bottom a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-bottom a:hover {
    color: #374151;
}

.card-status-info {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 4px 8px;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.status-active { background-color: #28a745; }
.status-pending { background-color: #ffc107; color: #333; text-shadow: none; }
.status-expired, .status-rejected { background-color: #6c757d; }
.status-vip { background-color: #f9a825; }

.card-status-info .fa-crown {
    margin-right: 4px;
}

.card.boosted {
    border: 2px solid #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

/* ==========================================================================
   4. АДАПТИВНОСТЬ
   ========================================================================== */

/* --- Мобильные устройства (до 767px) --- */
@media (max-width: 767px) {
    header .container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .top-bar {
        flex-wrap: wrap; 
        justify-content: space-between; 
        align-items: center;
        padding: 10px; 
        min-height: 54px;
        position: relative; 
    }
    .logo a { font-size: 1.25rem; margin-right: 0; }
    .menu-toggle {
        display: flex !important; 
        order: 3; 
        font-size: 1.5rem; 
    }
    .header-nav { 
        display: none; 
        flex-direction: column; 
        align-items: stretch;   
        width: 100%;           
        position: absolute;     
        top: 100%;             
        left: 0;
        background-color: #fff; 
        box-shadow: 0 3px 5px rgba(0,0,0,0.1); 
        padding: 15px;         
        border-top: 1px solid #e0e0e0; 
        gap: 12px;           
        z-index: 1010; 
    }
    .top-bar.menu-active .header-nav { display: flex; }

    .header-nav > * { width: 100%; margin: 0 0 10px 0; max-width:none; }
    .header-nav > *:last-child { margin-bottom: 0; }

    .search-bar { height: 40px; }
    #cityFilter { height: 40px; }
    
    /* Исправление 1: Круглые кнопки в бургер-меню */
    .auth-user-container {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        width: 100%;
    }
    
    .auth-user-container 
    .user-info .header-nav-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 4px;
    }
    
    .auth-user-container
    .user-info .header-nav-btn i {
        margin-right: 0;
        font-size: 1.2rem;
    }
    
    .auth-user-container .auth-button .btn-text,
    .user-info .header-nav-btn .btn-text {
        display: none;
    }
    
    /* Исправление 2: Компактные карточки объявлений */
      .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Компактный отступ между карточками */
    }
    
    .card {
        border-radius: 8px; /* Слегка увеличим скругление для современного вида */
        display: flex;
        flex-direction: column;
    }
    
    .card-image {
        height: 110px; /* Уменьшаем высоту изображения */
    }

    .card-info {
        padding: 8px; /* Уменьшаем общие отступы */
        padding-bottom: 30px;
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Позволяем этому блоку занять все оставшееся место */
    }
    
    .card-info h3 {
        font-size: 0.9rem; /* Немного уменьшаем заголовок */
        line-height: 1.3;
        margin-bottom: 4px;
        /* Ограничение в 2 строки для длинных заголовков */
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .card-info p {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 6px; /* Небольшой отступ под описанием */
        -webkit-line-clamp: 1; /* Оставляем 1 строку */
        flex-grow: 1; /* Заставляем описание занять доступное место, чтобы дата была внизу */
    }
    
    .card-location-date {
        font-size: 0.7rem;
        color: #6c757d;
        margin-top: auto; /* Главное изменение: прижимает дату к низу карточки */
        padding-top: 4px;
    }
    
    .favorite-btn {
        width: 30px; /* Немного увеличим для удобства нажатия */
        height: 30px;
    }
    
    .card-rating, 
    .card-comments, 
    .card-views, 
    .card-discount {
        font-size: 0.7rem; /* Увеличим для читаемости */
        padding: 3px 7px;
    }
    
    .card-status-info {
        font-size: 0.7rem; /* Увеличим для читаемости */
        padding: 3px 6px;
    }
    /* === КОНЕЦ ИЗМЕНЕНИЙ ДЛЯ КАРТОЧЕК === */
}

/* --- Планшеты и Десктопы (от 768px) --- */
@media (min-width: 768px) {
    .top-bar {
        min-height: 52px;
    }
    .menu-toggle { display: none !important; }
    .header-nav {
        display: flex !important; 
        position: static; 
        flex-direction: row;
        width: auto; 
        flex-grow: 1; 
        justify-content: flex-end;
        background: none; 
        box-shadow: none; 
        border: none; 
        padding: 0;
        gap: 8px;
    }
    .top-bar { flex-wrap: nowrap; padding: 6px 15px; }
    .logo a { font-size: 1.3rem; margin-right: 15px; }
    .search-bar { max-width: 300px; height: 36px; }
    #cityFilter { height: 36px; font-size: 0.85rem; }
    
    #userGreeting.user-greeting-text { display: none !important; }

    .user-info .header-nav-btn {
        width: 36px; 
        height: 36px; 
        padding: 0; 
        border-radius: 50%;
        font-size: 1rem;  
        align-items: center; 
        justify-content: center;
    }
    
    .user-info .header-nav-btn .btn-text { display: none; }
    
    .user-info .header-nav-btn i.icon-main { 
        margin-right: 0; 
        font-size: 1em; 
        line-height: 36px;
    }

    #newListingBtn.header-nav-btn { background-color: #28a745; color: white; border-color: #218838; }
    #newListingBtn.header-nav-btn:hover { background-color: #218838; }
    
    #moderationLink.header-nav-btn.moderation-link-custom { background-color: #ffebee; border: 1px solid #f5c6cb;}
    #moderationLink.header-nav-btn.moderation-link-custom i.icon-main { color: #dc3545; }
    #moderationLink.header-nav-btn.moderation-link-custom:hover { background-color: #f8d7da; }
    
    #cabinetLink.header-nav-btn { background-color: #e7f1ff; color: #007bff; border: 1px solid #b8daff;}
    #cabinetLink.header-nav-btn:hover { background-color: #d0e3ff; }
    
    #logoutButtonHeader.header-nav-btn { border-radius: 50%; }
    
    .auth-user-container > .auth-button { font-size: 0.85rem; padding: 0.3rem 0.8rem; height: 36px; }
    .user-info { gap: 8px; }
}