/* =========================================================================
   Рекомендательные технологии Mos77.ru (.mos77-rec-showcase)
   ========================================================================= */

.mos77-rec-showcase {
    margin: 24px 0 32px !important;
    padding: 24px 26px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box !important;
}

.rec-showcase__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
}

.rec-showcase__lead {
    width: 100%;
}

.rec-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #eff6ff 0%, #fdf2f8 100%);
    border: 1px solid #dbeafe;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.rec-badge__spark {
    font-size: 14px;
}

.rec-showcase__title {
    margin: 0 0 6px 0 !important;
    font-size: 23px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
}

.rec-showcase__sub {
    margin: 0 !important;
    font-size: 14px !important;
    color: #64748b !important;
    line-height: 1.45 !important;
}

/* Табы выбора рубрики: аккуратные интерактивные плашки */
.rec-tabs-wrapper {
    width: 100%;
    margin-top: 4px;
}

.rec-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    width: 100%;
    background: transparent;
}

.rec-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    color: #334155;
    background: #f8fafc;
    transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.rec-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.rec-tab.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

.rec-tab__emoji {
    font-size: 14px;
    line-height: 1;
}

.rec-tab__label {
    line-height: 1.2;
}

.rec-tab__reason {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    margin-left: 6px;
    letter-spacing: 0.2px;
    line-height: 1.2;
    transition: all .15s ease;
}

.rec-tab.is-active .rec-tab__reason {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* Кнопка «Ещё» и выпадающее меню всех 17 рубрик */
.rec-more-wrap {
    position: relative;
    display: inline-flex;
}

.rec-tab--more {
    border: 1px dashed #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
}

.rec-tab--more:hover {
    border-color: #2563eb !important;
    color: #2563eb !important;
    background: #eff6ff !important;
}

.rec-more-arrow {
    font-size: 10px;
    margin-left: 1px;
    color: #94a3b8;
    transition: transform .15s ease;
}

.rec-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    min-width: 320px;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    padding: 12px;
    box-sizing: border-box;
}

.rec-dropdown-title {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 4px;
}

.rec-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.rec-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    text-align: left;
    cursor: pointer;
    transition: all .15s ease;
    width: 100%;
    box-sizing: border-box;
}

.rec-dropdown-item:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.rec-dropdown-item__emoji {
    font-size: 13px;
    line-height: 1;
}

.rec-dropdown-item__label {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .rec-dropdown-menu {
        left: auto;
        right: 0;
        min-width: 280px;
    }
}

/* Чипы подборок */
.rec-chips-wrap {
    margin: 14px 0 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.rec-chips-wrap::-webkit-scrollbar {
    display: none;
}

.rec-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rec-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all .15s ease;
    cursor: pointer;
}

.rec-chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.rec-chip__tag {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    font-weight: 600;
}

/* Карточки мест */
.rec-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.rec-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: all .2s ease;
    display: flex;
    flex-direction: column;
}

.rec-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.rec-card__link {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rec-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
    overflow: hidden;
}

.rec-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.rec-card:hover .rec-card__media img {
    transform: scale(1.03);
}

.rec-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.rec-card__badge.is-popular { background: rgba(225, 29, 72, 0.9); }
.rec-card__badge.is-water   { background: rgba(2, 132, 199, 0.9); }
.rec-card__badge.is-estate  { background: rgba(124, 58, 237, 0.9); }
.rec-card__badge.is-active  { background: rgba(16, 185, 129, 0.9); }
.rec-card__badge.is-free    { background: rgba(217, 119, 6, 0.9); }

.rec-card__body {
    padding: 13px 14px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rec-card__title {
    margin: 0 0 6px 0 !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
}

.rec-card__sub {
    margin: 0 0 8px 0 !important;
    font-size: 12.5px !important;
    color: #64748b !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-card__metro {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
    margin-bottom: 8px;
}

.rec-card__stats {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
}

.rec-card__stats span {
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 500;
}

/* Связанные категории */
.rec-related-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
}

.rec-related-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.rec-related-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rec-related-all {
    font-size: 12.5px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}
.rec-related-all:hover {
    text-decoration: underline;
}

.rec-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.rec-rel-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--rc-color, #3b82f6);
    text-decoration: none !important;
    transition: all .15s ease;
}

.rec-rel-item:hover {
    transform: translateX(2px);
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.rec-rel-item__title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
}

.rec-rel-item__sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
}

/* =========================================================================
   Кросс-рекомендации в статьях (.mos77-single-rec)
   ========================================================================= */

.mos77-single-rec {
    margin: 36px 0 24px !important;
    padding: 22px 24px !important;
    background: #fdfdfd !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
}

.single-rec__head h2 {
    margin: 8px 0 4px 0 !important;
    font-size: 21px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

.single-rec__head p {
    margin: 0 0 14px 0 !important;
    font-size: 13.5px !important;
    color: #64748b !important;
}

.rec-cards--compact .rec-card {
    border-radius: 12px;
}

.rec-cards--compact .rec-card__media {
    aspect-ratio: 16 / 9;
}

/* =========================================================================
   Плавающая рекомендательная плашка (.mos77-floating-rec)
   ========================================================================= */

.mos77-floating-rec {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    font-size: 13.5px;
    font-weight: 600;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(120px);
    opacity: 0;
    pointer-events: none;
}

.mos77-floating-rec.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mos77-floating-rec a {
    color: #ffffff !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mos77-floating-rec a:hover {
    color: #93c5fd !important;
}

.mos77-floating-close {
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color .15s ease;
}
.mos77-floating-close:hover {
    color: #ffffff;
}

/* Адаптив для мобильных устройств */
@media (max-width: 640px) {
    .mos77-rec-showcase {
        padding: 16px !important;
        margin: 18px 0 24px !important;
        border-radius: 16px !important;
    }
    .rec-showcase__title {
        font-size: 19px !important;
    }
    .rec-tabs {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        gap: 6px;
        scrollbar-width: none;
    }
    .rec-tabs::-webkit-scrollbar {
        display: none;
    }
    .rec-tab {
        flex: 0 0 auto;
        font-size: 12.5px;
        padding: 6px 13px;
    }
    .rec-chips {
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .rec-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .rec-related-grid {
        grid-template-columns: 1fr;
    }
    .mos77-floating-rec {
        bottom: 74px; /* выше нижней навигации */
        right: 14px;
        left: 14px;
        justify-content: space-between;
        font-size: 12.5px;
        padding: 8px 14px;
    }
}
