/* AssistBox — кастомные переопределения поверх ClinicMaster */

:root {
    --font-family-base: 'Nunito', sans-serif;
    --font-family-title: 'Nunito', sans-serif;
    --bs-primary: #00BDE0;
    --bs-primary-rgb: 0, 189, 224;
    --bs-secondary: #031B4E;
    --bs-secondary-rgb: 3, 27, 78;
}

body,
h1, h2, h3, h4, h5, h6,
p, span, a, li, button, input, textarea, select,
.btn, .nav-link, .navbar-nav,
.title, .dz-title, .sub-title,
.icon-content, .footer-title,
.form-control, .content-text {
    font-family: 'Nunito', sans-serif !important;
}

/* Преloader — убрать быстро */
.dz-preloader-1 {
    transition: opacity 0.3s ease;
}

/* Карточки учреждений / мастеров */
.site-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.site-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Бейджи статуса работы */
.badge-open {
    background-color: #198754;
    color: #fff;
}
.badge-closed {
    background-color: #dc3545;
    color: #fff;
}
.badge-unknown {
    background-color: #6c757d;
    color: #fff;
}

/* Пагинация Bootstrap адаптация */
.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.pagination .page-link {
    color: var(--bs-secondary);
}
.pagination .page-link:hover {
    color: var(--bs-primary);
}

/* Теги */
.tag-link {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f0f0f0;
    color: #333;
    font-size: 13px;
    text-decoration: none;
    margin: 2px;
    transition: background 0.2s;
}
.tag-link:hover {
    background: var(--bs-primary);
    color: #fff;
}

/* Звёздный рейтинг */
.star-rating {
    color: #ffc107;
}
.star-rating .empty {
    color: #dee2e6;
}

/* Галерея изображений */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.gallery-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

/* Таблица расписания */
.schedule-table td:first-child {
    font-weight: 600;
    min-width: 120px;
}

/* Блог — карточка статьи */
.article-card .article-img {
    height: 220px;
    object-fit: cover;
}

/* Breadcrumb */
.breadcrumb-row .breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    font-size: 18px;
    line-height: 1;
    vertical-align: middle;
}

/* Compact inner section (under breadcrumbs) */
.content-inner-compact {
    padding-top: 14px;
    padding-bottom: 14px;
}

/* Кнопка scroll-to-top */
.scroltop {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 999;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}
.scroltop.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Убрать медицинские цвета если остались */
.text-vertical {
    display: none;
}

/* ── Support Chat Widget ── */
.support-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100050;
    font-family: 'Nunito', sans-serif;
    /* Панель absolute выходит за пределы FAB — не обрезать */
    overflow: visible;
    pointer-events: none;
}

.support-chat-widget .sc-fab,
.support-chat-widget .sc-panel {
    pointer-events: auto;
}

[x-cloak] {
    display: none !important;
}

.sc-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #0284C7;
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    position: relative;
}
.sc-fab:hover {
    transform: scale(1.05);
    background: #0277b3;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.sc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sc-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: min(520px, calc(100vh - 120px));
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100050;
}
.sc-enter { animation: sc-slide-up 0.2s ease-out; }
.sc-leave { animation: sc-slide-down 0.15s ease-in forwards; }
@keyframes sc-slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sc-slide-down { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(16px); } }

.sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #031B4E 100%);
    color: #fff;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}
.sc-header-info { display: flex; align-items: center; gap: 12px; }
.sc-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.sc-header-title { font-weight: 700; font-size: 15px; }
.sc-header-status { font-size: 12px; opacity: 0.8; }
.sc-typing { animation: sc-pulse 1.5s infinite; }
@keyframes sc-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.sc-header-actions { display: flex; gap: 4px; }
.sc-header-btn {
    background: none;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
}
.sc-header-btn:hover { background: rgba(255,255,255,0.2); }

.sc-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-loading, .sc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}
.sc-empty-icon { font-size: 40px; color: #dee2e6; margin-bottom: 12px; }
.sc-empty p { font-size: 14px; }

.sc-msg { display: flex; }
.sc-msg-admin { justify-content: flex-start; }
.sc-msg-user { justify-content: flex-end; }

.sc-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}
.sc-bubble-admin {
    background: #f0f2f5;
    color: #212529;
    border-bottom-left-radius: 4px;
}
.sc-bubble-user {
    background: var(--bs-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.sc-sender { font-size: 12px; font-weight: 700; color: var(--bs-primary); margin-bottom: 2px; }
.sc-text { white-space: pre-wrap; }
.sc-time { font-size: 10px; margin-top: 4px; opacity: 0.6; }

.sc-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}
.sc-textarea {
    flex: 1;
    resize: none;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    min-height: 38px;
    max-height: 80px;
}
.sc-textarea:focus { border-color: var(--bs-primary); }
.sc-textarea:disabled { background: #f8f9fa; }

.sc-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.sc-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sc-confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
}

/* Полноэкранный оверлей — виджет без открытой панели ≈ 56×56 px, absolute inset:0 не виден */
.sc-guest-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100051;
    padding: 16px;
}

.sc-guest-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.sc-confirm-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 280px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
    .support-chat-widget { bottom: 16px; right: 16px; }
    .sc-panel {
        width: calc(100vw - 32px);
        height: min(520px, calc(100vh - 100px));
        max-height: calc(100vh - 100px);
        right: 0;
    }
}

/* Inner-page banner with background image */
.site-page-banner {
    background-position: center;
    background-size: cover;
}

/* Generated AssistBox illustrations */
.site-illustration-wide {
    max-width: 1050px;
}

.site-illustration-portrait {
    max-width: 420px;
}

.site-capability-illustration {
    max-width: 320px;
}

.site-guide-category-illustration {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.site-quickstart-card .site-quickstart-img {
    display: block;
    max-height: 200px;
    object-fit: cover;
    object-position: center top;
}

/* Avatar stack (replaces tiny stock webp placeholders) */
.site-avatar-stack {
    display: inline-flex;
    align-items: center;
}

.site-avatar-stack--sm .site-avatar-dot {
    width: 36px;
    height: 36px;
    font-size: 14px;
    margin-left: -10px;
}

.site-avatar-stack--md .site-avatar-dot {
    width: 44px;
    height: 44px;
    font-size: 16px;
    margin-left: -12px;
    border-width: 3px;
}

.site-avatar-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #00a3c4);
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(3, 27, 78, 0.12);
}

.site-avatar-stack .site-avatar-dot:first-child {
    margin-left: 0;
}

.site-widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Card image fallbacks */
.site-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    background: linear-gradient(135deg, #e8f9fc 0%, #f0f4f8 100%);
    color: var(--bs-primary);
    font-size: 48px;
}

.site-avatar-placeholder {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #e8f9fc 0%, #d4f4fa 100%);
    color: var(--bs-primary);
    font-size: 32px;
    border: 2px solid #e5e7ef;
}

.site-quick-nav-link {
    display: inline-block;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--bs-secondary);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.site-quick-nav-link:hover {
    background: rgba(var(--bs-primary-rgb), .12);
    color: var(--bs-primary);
}

/* Skip link — доступность */
.site-skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10000;
    padding: .75rem 1rem;
    background: var(--bs-secondary);
    color: #fff;
    text-decoration: none;
    border-radius: 0 0 .5rem 0;
}
.site-skip-link:focus {
    clip: auto;
    width: auto;
    height: auto;
    overflow: visible;
}

.footer-bottom-links a {
    color: var(--bs-secondary);
    font-size: .875rem;
    text-decoration: none;
}
.footer-bottom-links a:hover {
    color: var(--bs-primary);
}

/* Footer — без затемняющего overlay шаблона */
.site-footer.style-1 {
    background-color: #f8fafc;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

.site-footer.style-1 > .footer-head,
.site-footer.style-1 > .footer-top,
.site-footer.style-1 > .footer-middle,
.site-footer.style-1 > .footer-bottom,
.site-footer.style-1 > .item1 {
    position: relative;
    z-index: 1;
}

.site-footer.style-1.overlay-primary-light::before,
.site-footer.style-1.overlay-primary::before {
    display: none;
}
