.listing-main-title {
    font-size: 44px;
    color: var(--blue-500);
    text-align: center;
    max-width: 600px;
}

@media (max-width: 768px) {
    .listing-main-title {
        font-size: 28px;
        max-width: 100%;
        padding: 0 16px;
    }
}

.listing-main-title-wrapper {
    display: flex;
    justify-content: center;
}

.listing-header-main-categories-wrapper {
    display: flex;
    padding: 64px 0;
    justify-content: center;
    gap: 44px;
    flex-wrap: wrap;
}

.listing-main-category-title {
    max-width: 100px;
    word-break: break-word;
    text-align: center;
    font-weight: 500;
}

.listing-main-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;

}

.listing-main-category-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ограничение ширины формы объявлений */
.listing-form-wrapper {
    max-width: 800px;
    width: 100%;
    margin-left: 0;
    box-sizing: border-box;
}

/* Стили для формы создания объявления */
.class-form-wrapper {
    max-width: 700px;
    box-sizing: border-box;
}
.class-form-contact-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* Стили для заголовка формы */
.class-form-title {
    margin-bottom: 40px;
    margin-top: 40px;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.class-form-sub-title {
    margin-bottom: 20px;
    margin-top: 40px;
    font-size: 26px;
    font-weight: 700;
    color: #333;
}

/* Стили для полей в ряд */
.form-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Мобильная адаптация для раздела цен */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row .form-group {
        flex: none;
        width: 100%;
        min-width: auto;
    }
}

/* Специальные стили для полей возраста */
.form-row .form-group:has(select[name*="age"]) {
    flex: 0 0 120px;
    /* Фиксированная ширина для полей возраста */
}

/* На мобилке поля возраста тоже в столбец */
@media (max-width: 768px) {
    .form-row .form-group:has(select[name*="age"]) {
        flex: none;
        width: 100%;
    }
}

/* Стили для чекбокса в ряду */
.form-row .form-group .checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    min-height: 38px;
    /* Высота как у input полей */
    padding-top: 8px;
    /* Добавляем отступ сверху для выравнивания по центру */
}

/* Кастомный класс для контейнера чекбокса */
.form-group-checkbox {
    margin-bottom: 0;
    padding: 0 0 10px 0;
}

/* Стили для чекбокса */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding-top: 0;
    /* Убираем отступ, так как теперь выравниваем по центру */
}

.checkbox-wrapper input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Сетка для интересных объявлений */
.listing-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.listing-cards-grid>* {
    width: 100%;
}

.listing-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0, 51, 153, .04), 0 2px 2px rgba(0, 51, 153, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s;
}

.listing-card:hover {
    box-shadow: 0 8px 32px rgba(0, 51, 153, .10), 0 4px 8px rgba(0, 51, 153, .12);
}

.listing-card-img-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    background: #f6f6f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-card-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 18px;
    background: #e5edff;
    display: block;
}

.listing-card-img-placeholder {
    width: 100%;
    height: 240px;
    background: #e5edff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-card-fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
    padding: 0;
}

.listing-card-content {
    padding: 18px 18px 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.listing-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-top: 12px;
    padding: 0;
    color: var(--blue-900);
    transition: color 0.15s;
}

.listing-card-link:hover .listing-card-title {
    color: #4f7eff;
}

.listing-card-date {
    font-size: 13px;
    color: var(--color-text-dark-400);
    margin-bottom: 2px;
}

.listing-card-org {
    font-size: 14px;
    color: var(--color-text-dark-500);
}

.listing-card-age {
    font-size: 13px;
    color: var(--color-text-dark-400);
}

.listing-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.tag-more {
    background: #f5f5f5;
    color: #666;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.listing-card-rating {
    font-size: 15px;
    color: #4f7eff;
    display: flex;
    align-items: center;
    gap: 2px;
}

.listing-card-rating-star {
    color: #f4c402;
    font-size: 16px;
    margin-left: 2px;
}

.listing-card-rating-count {
    color: var(--color-text-dark-400);
    font-size: 13px;
    margin-left: 4px;
}

.listing-card-more {
    display: inline-block;
    margin-top: 8px;
    color: #4f7eff;
    font-weight: 500;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.listing-card-more:hover {
    color: #334f99;
}

/* Адаптивность для сетки объявлений */
@media (max-width: 1100px) {
    .listing-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .listing-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 700px) {
    .listing-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .listing-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Минималистичная карточка объявления */
.listing-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    width: 100%;
}

.listing-card-link:hover {
    background: none;
}

.listing-card-simple {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    width: 100%;
    background: #fff;
}



.listing-card-img-placeholder-simple {
    width: 100%;
    height: 180px;
    background: #e5edff;
    border-radius: 18px 18px 0 0;
}

.listing-card-org-simple {
    font-size: 14px;
    color: var(--color-text-dark-400);
    margin: 0 0 2px 0;
    padding: 0 12px;
}

.listing-card-age-simple {
    font-size: 13px;
    color: var(--color-text-dark-400);
    margin-bottom: 12px;
    padding: 0 12px;
}

/* Стили для поля загрузки изображений */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

input[type="file"]:hover {
    border-color: #007bff;
}

input[type="file"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Стили для подсказки о загрузке файлов */
.class-form-hint {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}




.listing-info {
    flex: 1;
    min-width: 0;
}

.listing-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.listing-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-900);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-badges {
    display: flex;
    gap: 6px;
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.badge-featured {
    background: #fff3cd;
    color: #856404;
}

.badge-premium {
    background: #f8d7da;
    color: #721c24;
}

.listing-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-600);
}

.listing-category {
    color: var(--blue-600);
    font-weight: 500;
}

.listing-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 80px;
}

.listing-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-600);
}

.listing-views svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.listing-price {
    font-size: 14px;
    font-weight: 600;
}

.price-value {
    color: var(--green-600);
}

.price-free {
    color: var(--text-600);
    font-weight: 500;
}

.listing-status {
    min-width: 80px;
    text-align: center;
}

.status-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.status-active {
    background: #d1f2eb;
    color: #0f5132;
}

.status-draft {
    background: #e9ecef;
    color: #495057;
}

.status-inactive {
    background: #fff3cd;
    color: #856404;
}

.listing-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.view-btn {
    background: #e3f2fd;
    color: var(--blue-600);
}

.view-btn:hover {
    background: var(--blue-100);
    color: var(--blue-700);
}

.edit-btn {
    background: #f3e5f5;
    color: var(--purple-600);
}

.edit-btn:hover {
    background: var(--purple-100);
    color: var(--purple-700);
}

.delete-btn {
    background: #ffebee;
    color: var(--red-600);
}

.delete-btn:hover {
    background: var(--red-100);
    color: var(--red-700);
}

/* Адаптивность */
@media (max-width: 768px) {
    
    .listing-image {
        width: 60px;
        height: 45px;
    }
    
    .listing-stats {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .listing-status {
        grid-column: 1 / -1;
        text-align: left;
    }
    
    .listing-actions {
        grid-column: 1 / -1;
        justify-content: center;
        padding-top: 8px;
        border-top: 1px solid #e5e5e5;
    }
    
    .listing-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}


/* Стили для предварительного просмотра изображений */
.image-preview-section {
    margin-top: 16px;
    margin-bottom: 24px;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-remove:hover {
    background: rgba(220, 53, 69, 1);
}

/* Стили для кастомного интерфейса загрузки изображений */
.image-upload-container {
    margin-top: 12px;
}

.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* Стили для drag & drop */
.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
    cursor: grab;
    transition: all 0.2s ease;
}

.image-preview-item:active {
    cursor: grabbing;
}

.image-preview-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-preview-item.drag-over {
    border-color: #007bff;
    background: #f0f8ff;
}

/* Индикатор основного фото */
.image-preview-item:first-child::before {
    content: "Основное";
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-preview-remove:hover {
    background: rgba(220, 53, 69, 1);
}

.image-upload-button {
    width: 120px;
    height: 120px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.image-upload-button:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.upload-icon {
    color: #6c757d;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

.image-upload-button:hover .upload-icon,
.image-upload-button:hover .upload-text {
    color: #007bff;
}



/* Стили для кнопок формы */
.class-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.save-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.save-btn:hover {
    background: #545b62;
}

.publish-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.publish-btn:hover {
    background: #1e7e34;
}

/* Новая карточка объявления */
.listing-card-new {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.listing-card-new:hover {
    background-color: #f8f9fa;
}

/* Простая карточка объявления */
.listing-card-simple {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: background-color 0.3s ease;
    position: relative;
    cursor: pointer;
    background: white;
    border-radius: 8px;
    padding: 12px;
}

.listing-card-simple:hover {
    background-color: #f8f9fa;
}

.listing-card-simple:hover .listing-title {
    color: #007bff;
}

/* Невидимая ссылка поверх всего блока для SEO */
.listing-card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
    color: transparent;
}

.listing-card-overlay-link:hover {
    text-decoration: none;
    color: transparent;
}

.listing-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.heart-icon {
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
}

.favorite-btn:hover .heart-icon {
    color: #e91e63;
}

.listing-content {
    padding: 0;
}

/* Плашка для черновика в карточке */
.listing-draft-badge {
    margin: 8px 0 4px 0;
}

.draft-badge {
    display: inline-flex;
    align-items: center;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

/* Плашка для скрытого объявления в карточке */
.listing-inactive-badge {
    margin: 8px 0 4px 0;
}

.inactive-badge {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #6c757d;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.listing-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
    transition: color 0.2s ease;
}


.listing-age {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.listing-location, .listing-online {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.location-icon, .online-icon {
    font-size: 12px;
}

/* Стили для горизонтального отображения объявлений в категориях */
.listing-card-new .listing-card-content {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
    position: relative;
    flex-direction: row;
}

/* Стили для детальной страницы объявления */
.listing-detail-content {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
}

/* Невидимая ссылка поверх всего блока для SEO (внутри listing-card-new) */
.listing-card-new .listing-card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
    color: transparent;
}

.listing-card-new .listing-card-overlay-link:hover {
    text-decoration: none;
    color: transparent;
}

/* Секция 1: Изображение */
.listing-card-new .listing-image-section {
    flex: 0 0 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.listing-card-new .listing-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Секция 2: Описание */
.listing-card-new .listing-main-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.listing-card-new .listing-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.listing-card-new .listing-title {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    color: #333;
}

.listing-card-new .listing-title-text {
    display: block;
}

.listing-title-link {
    color: inherit;
    text-decoration: none;
}

.listing-title-link:hover {
    color: #007bff;
    text-decoration: none;
}

.btn-favorite {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    font-family: monospace;
    position: relative;
    z-index: 2;
}

.btn-favorite:hover {
    color: #dc3545;
}

.btn-favorite.active {
    color: #dc3545 !important;
}

.btn-favorite.active svg {
    color: #dc3545 !important;
    fill: #dc3545 !important;
}

.btn-favorite svg {
    width: 20px;
    height: 20px;
}

.listing-card-new .listing-price-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.listing-lesson-type {
    color: #666;
    font-size: 14px;
}

.listing-price {
    font-weight: 600;
    color: #28a745;
    font-size: 16px;
}

.listing-card-new .listing-location {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    color: #666;
    font-size: 13px;
}

.location-icon svg {
    width: 14px;
    height: 14px;
}

.listing-card-new .listing-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

/* Секция 3: Информация о пользователе */
.listing-card-new .listing-author-section {
    flex: 0 0 150px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 8px;
    height: fit-content;
    padding: 4px 0;
}

.author-name {
    font-weight: 400;
    color: #333;
    font-size: 14px;
    position: relative;
    z-index: 2;
}

.author-badge .badge {
    font-size: 11px;
    padding: 4px 8px;
}

.show-contact-btn {
    width: 100%;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid #007bff;
    background: transparent;
    color: #007bff;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.show-contact-btn:hover {
    background: #007bff;
    color: white;
}

.show-contact-btn.phone-displayed {
    border: 1px solid #007bff;
    background: transparent;
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.show-contact-btn.phone-displayed:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}

.show-contact-btn.phone-displayed svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Переопределение Bootstrap gutter для .row > * */
.row > * {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

/* Кастомные стили для детальной страницы объявления */
.listing-detail-section {
    margin-bottom: 1rem;
}

.listing-detail-section-large {
    margin-bottom: 1.5rem;
}

.listing-detail-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.listing-detail-row-full {
    margin-bottom: 1rem;
}

.listing-detail-col {
    flex: 1;
    min-width: 0;
}

.listing-detail-col-half {
    flex: 0 0 50%;
    max-width: 100%;
}

.listing-detail-col-full {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .listing-detail-row {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 0;
    }
    
    .listing-detail-col-half {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.listing-detail-badges {
    margin-bottom: 1rem;
}

.listing-detail-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    margin-right: 0.5rem;
}

.listing-detail-badge-primary {
    color: #fff;
    background-color: #0d6efd;
}

.listing-detail-badge-info {
    color: #fff;
    background-color: #0dcaf0;
}

.listing-detail-label {
    color: #888888;
    font-weight: 400;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.listing-detail-value {
    color: #000;
    font-weight: 600;
    font-size: 0.95rem;
}

.listing-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 1rem;
    margin-top: 0;
}

.listing-detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.listing-detail-title-row-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

#listings-container {
    padding: 0 18px;
}

/* Адаптивность */
@media (max-width: 992px) {
    .listing-card-new .listing-card-content {
        flex-direction: row;
        gap: 15px;
        align-items: flex-start;
    }
    
    .listing-detail-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .listing-card-new .listing-image-section {
        flex: 0 0 130px;
        height: 80px;
    }
    
    .listing-card-new .listing-main-info {
        flex: 1;
        min-width: 0;
    }
    
    .listing-card-new .listing-author-section {
        display: none;
    }
}

@media (max-width: 576px) {
    .listing-card-new .listing-card-content {
        padding: 12px;
        gap: 12px;
    }
    
    .listing-detail-content {
        padding: 12px;
    }
    
    .listing-card-new .listing-title {
        font-size: 16px;
        font-weight: 500;
    }
    
    .listing-card-new .listing-image-section {
        width: 120px;
        height: 120px;
    }
    
    .listing-card-new .listing-author-section {
        flex: 0 0 160px;
        min-width: 140px;
    }
}

/* Стили для динамических цен */
.price-group {
    margin-bottom: 15px;
}

.btn-remove-price {
    background: transparent;
    color: #dc3545;
    border: none;
    width: 24px;
    height: 24px;
    font-size: 22px;
    cursor: pointer;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.price-input-spacer {
    width: 24px;
    height: 24px;
    margin-left: 10px;
    flex-shrink: 0;
}

/* Минимальная ширина для селекта "Тип стоимости" */
.price-type-select {
    min-width: 140px;
}

/* Уменьшаем поле стоимости до 2/3 от текущего размера */
.price-input-wrapper {
}

.btn-remove-price:hover {
    color: #c82333;
}

/* Выравнивание крестика по центру селектов */
.form-group[style*="flex: 0 0 auto"] {
    padding-top: 25px; /* Компенсируем высоту label */
}

/* Выравниваем крестик по горизонту с другими элементами */
.btn-remove-price {
    margin-top: 0;
    align-self: center;
    padding-top: 9px;
}

/* Скрытие полей цены при выборе "Бесплатно" */
.price-fields-row.hidden {
    display: none !important;
}

/* Подзаголовок для дополнительных цен */
.price-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* Увеличиваем отступ перед "Дополнительная услуга" */
.price-group:not(#price_group_1) .price-subtitle {
    margin-top: 30px;
}

/* Стили для дизейбленных полей при выборе "Бесплатно" */
.form-control:disabled {
    background-color: #f8f9fa;
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-wrapper input:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Добавляем отступ между "тип стоимости" и чекбоксом "бесплатно" */
.form-row .form-group:has(.checkbox-wrapper) {
    margin-left: 15px;
}

/* На мобилке убираем отступ слева */
@media (max-width: 768px) {
    .form-row .form-group:has(.checkbox-wrapper) {
        margin-left: 0;
    }
    #listings-container {
        padding: 0;
    }
    /* Убираем паддинг у .form-group[style*="flex: 0 0 auto"] */
    .form-group[style*="flex: 0 0 auto"] {
        padding: 0;
    }
    
    /* Обнуляем маргин у .form-group */
    .form-group {
        margin: 0;
    }
    
    /* Скрываем карту на мобилке */
    #map_iframe {
        display: none;
    }
}

/* Уменьшаем отступ между строкой с селектами и чекбоксом "Это начальная цена" */
.form-group-checkbox {
}

/* Уменьшаем расстояние между чекбоксами "бесплатно" и "это начальная цена" на мобилке */
@media (max-width: 768px) {
    .form-group-checkbox {
        margin-top: 0;
        padding-top: 0;
        margin-bottom: 5px;
    }
    
    /* Уменьшаем отступы у чекбоксов в ряду */
    .form-row .form-group:has(.checkbox-wrapper) {
        margin-bottom: 5px;
    }
}



#add_price_btn {
    margin-top: 10px;
}


/* Стили для ссылочной кнопки "Добавить тип занятия" */
.listingd-price-link {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
}

.listingd-price-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.price-prefix-dynamic {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-weight: 500;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.price-input-wrapper input.has-prefix {
    padding-left: 35px;
}

.price-suffix {
    color: #666;
    font-size: 14px;
    margin-left: 5px;
}

/* Стили для нового дизайна цен на странице списка */
.prices-list {
    margin: 10px 0;
}

.price-item {
    display: flex;
    align-items: flex-end;
    margin-bottom: 6px;
    font-size: 12px;
    color: #6c757d;
}

.price-label {
    flex-shrink: 0;
    font-weight: 400;
}

.price-dots {
    flex: 1;
    margin: 0 8px;
    min-width: 5px;
    align-self: flex-end;
    background-image: radial-gradient(circle, #ccc 1px, transparent 1px);
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: 0 100%;
    height: 1px;
}

.price-value {
    flex-shrink: 0;
    font-weight: 400;
    color: #6c757d;
}

/* Стили для кликабельных карточек */
.col-md-6 .card-link,
.col-lg-4 .card-link {
    display: block !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
    height: 100% !important;
}

.col-md-6 .card-link:hover,
.col-lg-4 .card-link:hover {
    transform: translateY(-2px) !important;
    text-decoration: none !important;
    color: inherit !important;
}

.col-md-6 .card-link:hover .card,
.col-lg-4 .card-link:hover .card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.col-md-6 .card-link .card-title,
.col-lg-4 .card-link .card-title {
    color: #333 !important;
}

.col-md-6 .card-link:hover .card-title,
.col-lg-4 .card-link:hover .card-title {
    color: #007bff !important;
}

/* Предотвращение кликов на кнопки внутри кликабельной карточки */
.col-md-6 .card-link .btn,
.col-lg-4 .card-link .btn {
    pointer-events: none !important;
}

/* Убираем подчеркивание у всех элементов внутри ссылки */
.col-md-6 .card-link *,
.col-lg-4 .card-link * {
    text-decoration: none !important;
}

/* Убираем стандартные стили ссылок */
.col-md-6 .card-link:focus,
.col-md-6 .card-link:active,
.col-lg-4 .card-link:focus,
.col-lg-4 .card-link:active {
    text-decoration: none !important;
    color: inherit !important;
    outline: none !important;
}

/* Убеждаемся, что карточка занимает всю высоту ссылки */
.col-md-6 .card-link .card,
.col-lg-4 .card-link .card {
    height: 100% !important;
    width: 100% !important;
}

/* Убираем стандартные стили Bootstrap для ссылок */
.col-md-6 .card-link.text-decoration-none,
.col-lg-4 .card-link.text-decoration-none {
    text-decoration: none !important;
}

/* Дополнительные стили для всех размеров колонок */
.col-12 .card-link,
.col-sm-6 .card-link,
.col-md-4 .card-link,
.col-lg-3 .card-link {
    display: block !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer !important;
    height: 100% !important;
}

.col-12 .card-link:hover,
.col-sm-6 .card-link:hover,
.col-md-4 .card-link:hover,
.col-lg-3 .card-link:hover {
    transform: translateY(-2px) !important;
    text-decoration: none !important;
    color: inherit !important;
}

.col-12 .card-link:hover .card,
.col-sm-6 .card-link:hover .card,
.col-md-4 .card-link:hover .card,
.col-lg-3 .card-link:hover .card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.col-12 .card-link .btn,
.col-sm-6 .card-link .btn,
.col-md-4 .card-link .btn,
.col-lg-3 .card-link .btn {
    pointer-events: none !important;
}

/* Убеждаемся, что контейнер карточки имеет правильную высоту */
.col-md-6,
.col-lg-4,
.col-12,
.col-sm-6,
.col-md-4,
.col-lg-3 {
    display: flex !important;
    flex-direction: column !important;
}

.col-md-6 .card-link,
.col-lg-4 .card-link,
.col-12 .card-link,
.col-sm-6 .card-link,
.col-md-4 .card-link,
.col-lg-3 .card-link {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.col-md-6 .card-link .card,
.col-lg-4 .card-link .card,
.col-12 .card-link .card,
.col-sm-6 .card-link .card,
.col-md-4 .card-link .card,
.col-lg-3 .card-link .card {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Стили для кликабельных карточек в category_classes.html */
.listing-card-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: color 0.2s ease !important;
}

.listing-card-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

.listing-card-link:hover .listing-card-new {
    background-color: #f8f9fa !important;
}

.listing-card-link .listing-title-text {
    color: #333 !important;
}

.listing-card-link:hover .listing-title-text {
    color: #007bff !important;
}

/* Предотвращение кликов на кнопки внутри кликабельной карточки */
.listing-card-link .btn-favorite,
.listing-card-link .show-contact-btn {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Убираем подчеркивание у всех элементов внутри ссылки */
.listing-card-link * {
    text-decoration: none !important;
}

/* Убираем стандартные стили ссылок */
.listing-card-link:focus,
.listing-card-link:active {
    text-decoration: none !important;
    color: inherit !important;
    outline: none !important;
}

/* Стили для ссылки на автора */
.author-name a {
    color: inherit;
    text-decoration: none;
}

.author-name a:hover {
    color: #007bff;
}

/* Стили для заглушки пустого состояния */
.empty-state-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.empty-state-content {
    text-align: center;
    max-width: 500px;
}

.empty-state-title {
    font-size: 32px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.empty-state-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.empty-state-image {
    width: 180px;
    height: auto;
    margin-bottom: 24px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-button {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.empty-state-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .empty-state-container {
        padding: 40px 20px;
        min-height: 300px;
    }
    
    .empty-state-title {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .empty-state-text {
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    .empty-state-image {
        width: 150px;
        margin-bottom: 16px;
    }
    
    .empty-state-button {
        padding: 10px 24px;
        font-size: 14px;
    }


    
}

/* Стили для информации о примененных фильтрах */
.filters-applied-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-size: 14px;
    color: #495057;
    font-weight: normal;
    text-decoration: none;
    cursor: default;
    box-shadow: none;
    outline: none;
}

.filters-count-text {
    color: #495057;
    font-weight: 500;
}

.reset-filters-text {
    color: #6c757d;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    user-select: none;
}

.reset-filters-text:hover {
    color: #dc3545;
    background-color: #fff;
    transform: scale(1.1);
}

/* Стили для адреса в карточках объявлений */
.listing-card-new .listing-location {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.listing-card-new .listing-location .location-icon {
    flex-shrink: 0;
}

.listing-card-new .listing-location span:not(.location-icon) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Стили для поискового блока */
.modern-search-wrapper {
    margin-bottom: 32px;
}

.modern-search-container {
    width: 100%;
    padding: 0;
}

.modern-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    border-radius: 4px;
    padding: 2px;
}

/* Кнопка категорий */
.categories-dropdown {
    position: relative;
}

.categories-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--blue-500);
    color: white;
    border: 1px solid var(--blue-500);
    border-radius: 3px;
    font-weight: 400;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    height: 40px;
    transition: all 0.2s ease;
}

.categories-btn:hover {
    background: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-icon svg {
    width: 14px;
    height: 14px;
    color: white;
}

.btn-arrow {
    transition: transform 0.15s ease;
    color: white;
}

.categories-dropdown.open .btn-arrow {
    transform: rotate(180deg);
}

.categories-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-3px);
    transition: all 0.15s ease;
    margin-top: 2px;
    min-width: 200px;
}

.categories-dropdown.open .categories-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 12px 8px;
    border-bottom: 1px solid #eee;
}

.dropdown-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.dropdown-content {
    padding: 8px 12px 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.15s ease;
    border: 1px solid transparent;
}

.category-item:hover {
    background: #f5f5f5;
}

.category-icon {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.category-icon img {
    width: 16px;
    height: 16px;
}

.category-item span {
    font-size: 0.8rem;
    font-weight: 400;
    text-align: center;
}

/* Поисковая форма */
.search-form {
    display: flex;
    flex: 1;
    gap: 0;
    background: white;
    border-radius: 3px;
    overflow: hidden;
    border: 2px solid var(--blue-500);
    height: 40px;
}

.search-form:focus-within {
    border-color: var(--blue-500);
    outline: none;
    box-shadow: none;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 8px;
    gap: 6px;
}

.search-icon {
    color: #999;
    flex-shrink: 0;
}

.search-input-classes {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #333;
    background: transparent;
}

.search-input:focus {
    outline: none;
    box-shadow: none;
}

.search-input::placeholder {
    color: #999;
}

/* Скрываем иконку лупы слева в поле поиска везде */
.search-icon {
    display: none;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
}

.search-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.search-btn span {
    display: none;
}

/* Кнопка размещения */
.create-listing-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--blue-500);
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid var(--blue-500);
    height: 40px;
}

.create-listing-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Адаптивность для поискового блока */
@media (max-width: 768px) {
    .modern-search-bar {
        flex-direction: row;
        gap: 4px;
        padding: 0;
    }

    .search-form {
        flex: 1;
    }

    /* Скрываем текст "Категории" и стрелку */
    .categories-btn .btn-text,
    .categories-btn .btn-arrow {
        display: none;
    }

    .categories-btn {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }

    /* Кнопка "Разместить" - только плюс */
    .create-listing-btn span {
        display: none;
    }

    .create-listing-btn {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }

    .dropdown-content {
        grid-template-columns: repeat(2, 1fr);
    }
}
