:root {
    /* Цветовая палитра i-house (Modern Premium) */
    --ih-bg-main: #ffffff;
    --ih-bg-soft: #f8fafc;
    --ih-text-primary: #0f172a; /* Slate 900 */
    --ih-text-secondary: #64748b; /* Slate 500 */
    --ih-accent: #e11d48; /* Трендовый малиново-красный из референса */
    --ih-accent-hover: #be123c;
    --ih-border: #f1f5f9;
    --ih-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ih-radius-lg: 24px;
    --ih-radius-md: 16px;
    --ih-radius-sm: 12px;
}

/* 1. ПАРЯЩАЯ КНОПКА (Консультант с индикатором активности) */
.cw-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-color: #ffffff;
    padding: 3px;
    box-sizing: border-box;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.cw-float-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.cw-float-btn-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.cw-float-btn-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #f1f5f9;
}

/* Пульсирующий зеленый индикатор */
.cw-status-pulse {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: cwPulse 2s infinite;
}

@keyframes cwPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* 2. МОДАЛЬНОЕ ОКНО */
.cw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    padding-bottom: 15px;
    padding-right: 15px;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cw-modal-overlay.cw-active {
    opacity: 1;
    pointer-events: auto;
}

.cw-modal-card {
    background-color: var(--ih-bg-main);
    width: 100%;
    max-width: 440px;
    border-radius: var(--ih-radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cw-modal-overlay.cw-active .cw-modal-card {
    transform: translateY(0) scale(1);
}

/* Шапка модалки */
.cw-modal-header {
    padding: 20px 24px 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--ih-border);
}

.cw-modal-title {
    color: var(--ih-text-primary);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--ih-font);
    letter-spacing: -0.02em;
}

.cw-modal-close {
    background: none;
    border: none;
    color: var(--ih-text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    outline: none;
}

.cw-modal-close:hover {
    background-color: var(--ih-bg-soft);
    color: var(--ih-text-primary);
}

.cw-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Тело */
.cw-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    max-height: 85vh;
    overflow-y: auto;
}

/* Блок профиля */
.cw-profile-block {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
}

.cw-avatar-container {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.cw-profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--ih-bg-soft);
}

.cw-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.cw-profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cw-profile-welcome {
    font-family: var(--ih-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--ih-text-primary);
    margin: 0;
}

.cw-profile-desc {
    font-family: var(--ih-font);
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--ih-text-secondary);
    margin: 0;
}

/* Структурные контейнеры */
.cw-card-section {
    background-color: var(--ih-bg-soft);
    border-radius: var(--ih-radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.cw-section-subtitle {
    font-family: var(--ih-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--ih-text-primary);
    margin: 0 0 6px 0;
}

.cw-section-subtitle-center {
    font-family: var(--ih-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--ih-text-primary);
    text-align: center;
    margin: 0 0 14px 0;
}

.cw-section-desc {
    font-family: var(--ih-font);
    font-size: 13px;
    line-height: 1.45;
    color: var(--ih-text-secondary);
    margin: 0 0 16px 0;
}

/* Основная кнопка "Написать в чат" */
.cw-btn-primary {
    background-color: var(--ih-accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--ih-radius-sm);
    text-decoration: none;
    font-family: var(--ih-font);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s ease;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
}

.cw-btn-primary:hover {
    background-color: var(--ih-accent-hover);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.cw-arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.cw-btn-primary:hover .cw-arrow-icon {
    transform: translateX(3px);
}

/* Сетка мессенджеров и соцсетей */
.cw-messengers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.cw-msg-badge {
    background-color: #ffffff;
    border: 1px solid var(--ih-border);
    border-radius: var(--ih-radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ih-text-primary);
    font-family: var(--ih-font);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cw-msg-badge:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    color: var(--ih-text-primary);
    text-decoration: none;
    transform: translateY(-1px);
}

.cw-msg-icon {
    width: 18px;
    height: 18px;
    color: var(--ih-text-primary);
}

/* Телефонная кнопка */
.cw-phone-fullbtn {
    background-color: #ffffff;
    border: 1px solid var(--ih-border);
    border-radius: var(--ih-radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ih-text-primary);
    font-family: var(--ih-font);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.cw-phone-fullbtn:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    color: var(--ih-text-primary);
    text-decoration: none;
    transform: translateY(-1px);
}

.cw-phone-icon {
    width: 16px;
    height: 16px;
    color: var(--ih-text-secondary);
}

/* Популярные категории i-house */
.cw-categories-section {
    display: flex;
    flex-direction: column;
}

.cw-categories-section-title {
    font-family: var(--ih-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--ih-text-primary);
    text-align: center;
    margin: 4px 0 12px 0;
    letter-spacing: -0.01em;
}

.cw-categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cw-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--ih-border);
    background-color: #ffffff;
    border-radius: var(--ih-radius-sm);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cw-cat-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    text-decoration: none;
}

.cw-cat-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.cw-cat-text {
    display: flex;
    flex-direction: column;
}

.cw-cat-text-1 {
    font-family: var(--ih-font);
    font-size: 12px;
    font-weight: 700;
    color: var(--ih-text-primary);
    line-height: 1.25;
}

.cw-cat-text-2 {
    font-family: var(--ih-font);
    font-size: 11px;
    color: var(--ih-text-secondary);
    line-height: 1.2;
    margin-top: 1px;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 480px) {
    .cw-modal-overlay {
        padding-bottom: 0;
        padding-right: 0;
        align-items: center;
        justify-content: center;
    }
    .cw-float-btn {
        width: 68px;
        height: 68px;
        bottom: 80px;
        right: 20px;
    }
    .cw-modal-card {
        max-width: calc(100% - 24px);
        border-radius: var(--ih-radius-md);
    }
    .cw-modal-body {
        padding: 20px;
        gap: 14px;
    }
    .cw-messengers-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}