/**
 * Быстрая навигация «плитками» (mos77.ru) — адаптивно: ПК, планшеты, телефоны.
 * Полностью заменяет старый строчный бар с датой (.vc-date-bar).
 */

/* Скрываем старый строчный бар с датой на всех устройствах, где есть плитки */
.vc-date-bar {
    display: none !important;
}

/* ==========================================================
   КОНТЕЙНЕР ПЛИТОК (.mos77-qt) — ДЕСКТОП И ОБЩИЕ СТИЛИ
   ========================================================== */

.mos77-qt {
    display: grid;
    grid-template-columns: repeat(var(--qt-n, 4), minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}

.mos77-qt__tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 94px;
    padding: 12px 14px 11px;
    border-radius: 16px;
    background: linear-gradient(155deg, var(--qt-bg) 0%, rgba(255, 255, 255, 0.96) 65%, #ffffff 100%);
    border: 1px solid var(--qt-bd);
    color: #0f172a;
    text-decoration: none !important;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s ease, border-color .2s ease;
    animation: mos77QtIn .35s ease both;
    cursor: pointer;
    box-sizing: border-box;
}

.mos77-qt__tile:nth-child(1) { animation-delay: .02s; }
.mos77-qt__tile:nth-child(2) { animation-delay: .06s; }
.mos77-qt__tile:nth-child(3) { animation-delay: .10s; }
.mos77-qt__tile:nth-child(4) { animation-delay: .14s; }

/* Декоративное пятно-акцент в углу плитки */
.mos77-qt__tile::after {
    content: "";
    position: absolute;
    right: -16px;
    top: -16px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--qt-c);
    opacity: .08;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
}

/* Hover-эффекты для ПК и устройств с курсором */
@media (hover: hover) and (pointer: fine) {
    .mos77-qt__tile:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.04);
        border-color: var(--qt-c);
    }
    .mos77-qt__tile:hover::after {
        transform: scale(1.15);
        opacity: .13;
    }
    .mos77-qt__tile:hover .mos77-qt__icon {
        transform: scale(1.08);
    }
}

.mos77-qt__tile:active {
    transform: translateY(0) scale(.98);
}

.mos77-qt__tile:focus-visible {
    outline: 2px solid var(--qt-c);
    outline-offset: 2px;
}

/* Элементы внутри плитки */
.mos77-qt__icon {
    font-size: 24px;
    line-height: 1;
    height: 28px;
    display: flex;
    align-items: center;
    transition: transform .2s ease;
}

.mos77-qt__icon svg {
    display: block;
}

.mos77-qt__value {
    margin-top: 8px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.015em;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-variant-numeric: tabular-nums;
}

.mos77-qt__tile--kak-dobratsya .mos77-qt__value {
    font-size: 15px;
    letter-spacing: -0.02em;
}

.mos77-qt__label {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.25;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 450;
}

/* Статус мостов в СПб / тревога */
.mos77-qt__tile.is-alert .mos77-qt__label {
    color: #dc2626;
    font-weight: 600;
}

.mos77-qt__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
    background: #22c55e;
    vertical-align: 1px;
}

.mos77-qt__tile.is-alert .mos77-qt__dot {
    background: #ef4444;
    animation: mos77QtPulse 1.4s infinite;
}

/* ==========================================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И ТЕЛЕФОНОВ
   ========================================================== */

@media (max-width: 900px) and (min-width: 769px) {
    .mos77-qt {
        gap: 10px;
        margin: 0 0 14px;
    }
    .mos77-qt__tile {
        padding: 11px 11px 10px;
        min-height: 90px;
    }
    .mos77-qt__value {
        font-size: 15.5px;
    }
    .mos77-qt__tile--kak-dobratsya .mos77-qt__value {
        font-size: 13.5px;
    }
}

@media (max-width: 768px) {
    .mos77-qt {
        gap: 8px;
        margin: 10px 0 14px;
    }
    .mos77-qt__tile {
        min-height: 86px;
        padding: 10px 10px 9px;
        border-radius: 16px;
    }
    .mos77-qt__icon {
        font-size: 22px;
        height: 26px;
    }
    .mos77-qt__value {
        margin-top: 7px;
        font-size: 16px;
    }
    .mos77-qt__tile--kak-dobratsya .mos77-qt__value {
        font-size: 13px;
    }
    .mos77-qt__label {
        margin-top: 2px;
        font-size: 11.5px;
    }
}

@media (max-width: 360px) {
    .mos77-qt {
        gap: 6px;
    }
    .mos77-qt__tile {
        padding: 9px 8px 8px;
        min-height: 80px;
    }
    .mos77-qt__value {
        font-size: 14.5px;
    }
    .mos77-qt__tile--kak-dobratsya .mos77-qt__value {
        font-size: 12px;
    }
    .mos77-qt__label {
        font-size: 10.5px;
    }
}

@keyframes mos77QtIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes mos77QtPulse {
    50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .mos77-qt__tile { animation: none !important; }
}
