@media screen and (min-width: 768px) {
    .btn-back-ride {
        position: absolute;
        display: inline-block;
        margin-top: 20px;
        text-decoration: none;
        color: #007bff;
        font-weight: 600;
        padding: 8px 12px;
        border: 1.5px solid #007bff;
        border-radius: 6px;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .btn-back-ride:hover {
        background-color: #007bff;
        color: white;
    }

    .ride-topbar {
      display: none;
    }

    /* Кнопка назад слева, не влияет на центрирование заголовка */
    .ride-back-btn {
      display: none;
    }
}


@media screen and (max-width: 768px) {
    .ride-topbar {
      display: block;
      position: sticky;
      top: 0;
      z-index: 1000;

      height: 56px;
      display: flex;
      align-items: center;
      padding: 0 12px;

      background: #fff;
      border-bottom: 1px solid rgba(0,0,0,0.08);
      border-bottom-left-radius: 8px;
      border-bottom-right-radius: 8px;
    }

    .ride-topbar-title {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        max-width: 70%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none;
    }

    .ride-topbar-name, .ride-topbar-name {
        font-size: 17px;
        font-weight: 600;
    }

    /* Кнопка назад слева, не влияет на центрирование заголовка */
    .ride-back-btn {
      width: 40px;
      height: 40px;
      display: block;
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      border: none;
      border-radius: 10px;
      background: transparent;
      cursor: pointer;
    }

    .ride-back-btn:active, .ride-back-btn:hover{
        background: rgba(0,0,0,.06);
    }

    /* Заголовок строго по центру экрана */
    .ride-topbar-title {
      display: block;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      text-align: center;
      max-width: 70%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      pointer-events: none; /* чтобы клики не блокировались */
    }

    .btn-back-ride {
        display: none;
    }
}