/* ==================================================
   ОБЩИЙ КОНТЕЙНЕР
   ================================================== */
.timeline-map-wrapper {
    display: flex;
    gap: 20px;
    margin: 0 auto;
    padding: 10px 20px;
    max-width: 1400px;
}

/* ==================================================
   ЛЕВАЯ КОЛОНКА — ЛЕНТА
   ================================================== */
.timeline-list {
    flex: 1;
    max-width: 50%;
    min-width: 300px;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 10px;
}

/* ==================================================
   ПРАВАЯ КОЛОНКА — КАРТА
   ================================================== */
#map-container {
    flex: 1;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #f0f0f0;
}

/* ==================================================
   КАРТОЧКИ
   ================================================== */
.timeline-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}
.timeline-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}
.timeline-item-link:hover .timeline-content {
    background: #f0f4f8;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding-left: 24px;
    border-left: 2px solid #d0d7de;
    position: relative;
    min-height: 34px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.timeline-item[data-type="offer"]::before { background: #FF9800; }
.timeline-item[data-type="company"]::before { background: #2196F3; }
.timeline-item[data-type="event"]::before { background: #9C27B0; }

.timeline-time {
    min-width: 56px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 15px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    text-align: left;
    padding-top: 2px;
    font-family: 'Courier New', monospace;
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px 0;
    background: transparent;
    padding: 4px 8px 4px 4px;
    border-radius: 6px;
    border: none;
    transition: background 0.15s;
    line-height: 1.5;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 6px 10px;
    flex-wrap: wrap;
}

.timeline-badge {
    display: inline-block;
    background: #ff6f00;
    color: #fff;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 20px;
    white-space: nowrap;
}
.timeline-badge[data-badge="Скидка!"] { background: #e53935; }
.timeline-badge[data-badge="Новинка!"] { background: #43a047; }
.timeline-badge[data-badge="Спеццена!"] { background: #fb8c00; }
.timeline-badge[data-badge="Новый магазин!"] { background: #1e88e5; }
.timeline-badge[data-badge="Событие"] { background: #8e24aa; }

.timeline-date {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

.timeline-content h4 {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
    word-break: break-word;
}

.timeline-description {
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
}

.company-block {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}
.company-name {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
}

/* Цены */
.price-block {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.price-text {
    font-size: 13px;
    color: #0f172a;
    font-weight: 500;
    background: #f1f5f9;
    padding: 0 10px;
    border-radius: 4px;
    line-height: 22px;
}
.old-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}
.new-price {
    font-size: 15px;
    font-weight: 700;
    color: #d32f2f;
}
.new-price:only-child { color: #0f172a; }

/* Кнопка "Карта" */
.btn-show-on-map {
    display: inline-block;
    background: #0d47a1;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 12px;
    margin-left: 8px;
    border-radius: 16px;
    color: #fff;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
    line-height: 1.8;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.btn-show-on-map:hover {
    background: #0a2a5c;
    transform: scale(1.02);
}

/* Подсветка карточки */
.timeline-item-wrapper.highlight .timeline-content {
    background: #e3f2fd;
    border-color: #0d47a1;
    box-shadow: 0 0 0 2px #0d47a1;
}

/* ==================================================
   ПАГИНАЦИЯ (уникальные классы timeline-*)
   ================================================== */
#mod-timeline-feed .timeline-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 0;
    flex-wrap: wrap;
}

#mod-timeline-feed .timeline-pagination .timeline-btn-prev,
#mod-timeline-feed .timeline-pagination .timeline-btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    line-height: 1.2;
    min-width: 100px;
    text-decoration: none;
}

/* Назад — светлая */
#mod-timeline-feed .timeline-pagination .timeline-btn-prev {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
#mod-timeline-feed .timeline-pagination .timeline-btn-prev:hover:not(:disabled) {
    background: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
#mod-timeline-feed .timeline-pagination .timeline-btn-prev:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Вперёд — акцентная */
#mod-timeline-feed .timeline-pagination .timeline-btn-next {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    color: #fff;
}
#mod-timeline-feed .timeline-pagination .timeline-btn-next:hover:not(:disabled) {
    background: linear-gradient(135deg, #1565c0, #0a2a5c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.35);
}
#mod-timeline-feed .timeline-pagination .timeline-btn-next:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(13, 71, 161, 0.3);
}

/* Отключённое состояние */
#mod-timeline-feed .timeline-pagination .timeline-btn-prev:disabled,
#mod-timeline-feed .timeline-pagination .timeline-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Информация о странице */
#mod-timeline-feed .timeline-pagination .timeline-page-info {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    padding: 0 8px;
    white-space: nowrap;
    user-select: none;
}

/* Индикация загрузки */
#mod-timeline-feed .timeline-pagination.loading .timeline-page-info {
    color: #94a3b8;
    font-style: italic;
}

/* Пустое сообщение */
.empty-message {
    text-align: center;
    color: #94a3b8;
    padding: 30px 0;
}

/* ==================================================
   АДАПТИВНОСТЬ
   ================================================== */
@media (max-width: 992px) {
    .timeline-map-wrapper {
        flex-direction: column;
        padding: 10px;
    }
    .timeline-list {
        max-width: 100%;
        max-height: none;
        padding-right: 0;
    }
    #map-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .btn-show-on-map {
        display: none !important;
    }
    .timeline-item {
        padding-left: 14px;
        flex-wrap: wrap;
        min-height: 28px;
    }
    .timeline-time {
        min-width: 44px;
        font-size: 13px;
    }
    .timeline-content {
        padding: 2px 4px;
    }
    .timeline-content h4 { font-size: 13px; }
    .timeline-description { font-size: 12px; }
    .company-name { font-size: 11px; }
    .price-block { flex-wrap: wrap; }
    #map-container { height: 300px; }
}

@media (max-width: 480px) {
    #mod-timeline-feed .timeline-pagination {
        gap: 8px;
    }
    #mod-timeline-feed .timeline-pagination .timeline-btn-prev,
    #mod-timeline-feed .timeline-pagination .timeline-btn-next {
        padding: 6px 14px;
        font-size: 13px;
        min-width: 80px;
    }
    #mod-timeline-feed .timeline-pagination .timeline-page-info {
        font-size: 12px;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 6px;
    }
    
}