/* Стили для компактной карточки объявления */
.compact-ad-container {

    min-width: 200px;


}

.compact-ad-card {
    background: white;
    border-radius: 0.8rem;
    box-shadow: 0 0.2rem 1rem rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}

.compact-ad-card:hover {
   /*  transform: translateY(-0.2rem); */
    box-shadow: 0 0.4rem 1.5rem rgba(0,0,0,0.15);
}

.compact-ad-header {
    padding: 0.8rem;
}

.compact-ad-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.4rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.2rem;
}

.compact-ad-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.compact-ad-category {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.compact-ad-location {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #7f8c8d;
    font-size: 0.75rem;
}

.compact-ad-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.compact-ad-gallery {
    position: relative;
    margin: 0 0.8rem;
}

.compact-main-image {
    width: 100%;

    border-radius: 0.6rem;
    overflow: hidden;
    background: #f8f9fa;
    margin-bottom: 0.5rem;
    position: relative;
}

.compact-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 1.5rem;
}

.compact-ad-details {
    padding: 0 0.8rem 0.8rem;
}

.compact-price-section {
    text-align: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e9ecef;
}

.compact-ad-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: #27ae60;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.compact-price-discount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.original-price-mini {
    font-size: 0.8rem;
    color: #7f8c8d;
    text-decoration: line-through;
}

.discount-badge-mini {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 0.6rem;
    font-weight: 600;
}

.compact-negotiable-badge {
    display: inline-flex;
    align-items: center;
	justify-content: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 0.3rem 0.8rem;
	width: fit-content;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.65rem;
    box-shadow: 0 0.2rem 0.5rem rgba(243, 156, 18, 0.3);
}

.compact-seller-info {
    background: white;
    padding: 0.6rem;
    border-radius: 0.5rem;
    margin-bottom: 0.8rem;
    box-shadow: 0 0.1rem 0.3rem rgba(0,0,0,0.05);
}

.compact-seller-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.compact-seller-avatar {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    flex-shrink: 0;
}

.compact-seller-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-seller-rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: #f39c12;
    font-size: 0.7rem;
}

.compact-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.compact-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-decoration: none;
    font-size: 0.7rem;
    width: 100%;
}

.compact-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.compact-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-0.1rem);
}

.compact-btn-outline {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #5a6c7d;
}

.compact-btn-outline:hover {
    border-color: #3498db;
    color: #3498db;
}

.compact-ad-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.compact-btn-favorite {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 0.4rem;
    flex: 1;
}

.compact-btn-favorite:hover,
.compact-btn-favorite.active {
    background: #e74c3c;
    color: white;
}

.compact-btn-open {
    background: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 0.4rem;
    flex: 1;
    text-decoration: none;
}

.compact-btn-open:hover {
    background: #3498db;
    color: white;
}

/* Стили для кнопок управления в карточках аккаунта */
.compact-ad-management-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.compact-btn-archive {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 0.5rem;
    flex: 1;
    border-radius: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-size: 0.7rem;
}

.compact-btn-archive:hover {
    background: #e74c3c;
    color: white;
}

.compact-btn-edit {
    background: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 0.5rem;
    flex: 1;
    border-radius: 0.4rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-size: 0.7rem;
}

.compact-btn-edit:hover {
    background: #3498db;
    color: white;
}

.compact-ad-footer {
    padding: 0.6rem 0.8rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    font-size: 0.6rem;
    color: #7f8c8d;
}

/* Для десктопа */
@media (min-width: 768px) {
    .compact-main-image {

    }
    
    .compact-ad-container {
     
        min-width: 180px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

.icon {
    font-size: 0.8rem;
}


/* Исправление для заголовка объявления - чтобы он не обрезался */
.compact-ad-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    max-height: none !important;
    height: auto !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    font-size: 1.9rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1;
    padding: 0;
	  text-transform: uppercase;
}

/* Адаптивность для длинных заголовков */
@media (max-width: 768px) {
    .compact-ad-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
}

/* Дополнительные стили для карточки, чтобы вместить длинный заголовок */
.compact-ad-container {
    height: auto !important;
    min-height: 400px;
}

.compact-ad-card {
    height: auto !important;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.compact-ad-header {
    flex-shrink: 0;
}

.compact-ad-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* Адаптация для masonry */
.masonry .compact-ad-container {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 400px;
}

.masonry .compact-ad-card {
    width: 100% !important;
    height: auto !important;
}

/* Для лучшего отображения в masonry */
.compact-ad-container {
    break-inside: avoid;
}

/* Улучшаем адаптивность заголовка */
.compact-ad-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.2;
    padding: 0;
    text-transform: uppercase;
    word-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 768px) {
    .compact-ad-title {
        font-size: 1.4rem;
        line-height: 1.3;
    }
}

.compact-ad-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* Важно для корректной работы text-overflow в дочерних элементах */
}

.compact-ad-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* Важно для корректной работы text-overflow */
    width: 100%;
}

.compact-ad-category {
    flex-shrink: 1; /* Позволяет элементу сжиматься */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Критически важно для text-overflow во flex-контейнере */
    max-width: 100%; /* Ограничивает максимальную ширину */
    font-weight: 500;
    color: white;
    background: #3498db;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.compact-ad-location {
    flex-shrink: 0; /* Не позволяет сжиматься */
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: #888;
    font-size: 12px;
}

/* Альтернативный вариант: если compact-ad-meta должен быть flex-контейнером с переносом */
@media (max-width: 768px) {
    .compact-ad-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .compact-ad-category {
        max-width: calc(100% - 120px); /* Оставляет место для локации */
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .compact-ad-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .compact-ad-category {
        max-width: 100%;
    }
}


.compact-ad-title a {
	  text-decoration: none;
}


.compact-ad-title a:hover {
	  text-decoration: underline;
}


/* Исправление для compact-ad-container в masonry */
.masonry .compact-ad-container {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

