/* ========================================
   CONSULTANT WIDGET - Желтая тема
   ======================================== */

:root {
    --consultant-primary: #f0cf4c;
    --consultant-primary-dark: #d4b73f;
    --consultant-primary-darker: #b89d2f;
    --consultant-text-dark: #1f2937;
    --consultant-text-light: #4b5563;
}

.consultant-widget {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ========================================
   МИНИ-ВИДЖЕТ (свернутый)
   ======================================== */
.consultant-widget__mini {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.consultant-widget__mini:hover {
    transform: translateY(-2px);
}

.consultant-widget__mini.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Мини-шапка */
.consultant-header-mini {
    background: #31353e;
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    min-width: auto;
}

.consultant-header__info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.consultant-header__photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.consultant-header__text {
    display: flex;
    flex-direction: column;
}

.consultant-title {
    font-size: 8px;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
}

.consultant-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.consultant-toggle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--consultant-primary);
    border: none;
    color: #31353e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.consultant-toggle:hover {
    background: var(--consultant-primary-dark);
    transform: scale(1.1);
}

.consultant-toggle .toggle-icon-expand {
    font-size: 10px;
}

/* ========================================
   ПОЛНЫЙ ВИДЖЕТ
   ======================================== */
.consultant-widget__full {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 240px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(15px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.consultant-widget__full.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Шапка */
.consultant-widget__header {
    background: linear-gradient(135deg, var(--consultant-primary) 0%, var(--consultant-primary-dark) 100%);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.consultant-widget__header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.consultant-widget__header-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.consultant-widget__header-text {
    display: flex;
    flex-direction: column;
    color: var(--consultant-text-dark);
}

.consultant-widget__title {
    font-size: 8px;
    opacity: 0.8;
    font-weight: 600;
}

.consultant-widget__name {
    font-size: 12px;
    font-weight: 700;
}

.consultant-widget__toggle {
    width: 22px;
    height: 22px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: none;
    color: var(--consultant-text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.consultant-widget__toggle:hover {
    background: rgba(255,255,255,0.5);
}

.consultant-widget__toggle-icon {
    font-size: 10px;
}

/* Тело */
.consultant-widget__body {
    padding: 12px;
}

/* Контакты */
.consultant-widget__contacts-label {
    font-size: 9px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 6px;
}

.consultant-widget__phone {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-decoration: none;
    margin-bottom: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
}

.consultant-widget__phone-label {
    font-size: 9px;
    color: var(--consultant-text-light);
}

.consultant-widget__phone-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--consultant-text-dark);
}

/* Мессенджеры */
.consultant-widget__messengers {
    display: flex;
    gap: 6px;
}

.consultant-widget__messenger,
.consultant-widget__messengers a {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.consultant-widget__messenger:hover {
    transform: translateY(-2px);
}

.consultant-widget__messenger--whatsapp { background: #25d366; }
.consultant-widget__messenger--telegram { background: #0088cc; }
.consultant-widget__messenger--max { background: #6366f1; }

.consultant-widget__messenger img,
.consultant-widget__messengers a img {
    width: 14px;
    height: 14px;
    display: block;
}

/* Иконка MAX — показываем как есть, без фильтра; чуть крупнее */
.consultant-widget__messenger--max img {
    width: 18px;
    height: 18px;
    filter: none;
}

/* Футер */
.consultant-widget__footer {
    padding: 10px 12px 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.consultant-widget__btn {
    width: 100%;
    padding: 8px 14px;
    min-height: 44px;
    background: linear-gradient(135deg, var(--consultant-primary) 0%, var(--consultant-primary-dark) 100%);
    color: var(--consultant-text-dark);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(240,207,76,0.4);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.consultant-widget__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(240,207,76,0.5);
}

.consultant-widget__change-link {
    text-align: center;
    font-size: 10px;
    color: var(--consultant-text-light);
    text-decoration: none;
}

.consultant-widget__change-link:hover {
    color: var(--consultant-primary-dark);
}

/* ========================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ======================================== */
@media (max-width: 480px) {
    .consultant-widget {
        bottom: 10px;
        right: 10px;
        z-index: 10000;
    }

    .consultant-header-mini {
        padding: 5px 8px;
    }

    .consultant-header__photo {
        width: 28px;
        height: 28px;
    }

    .consultant-title {
        font-size: 7px;
    }

    .consultant-name {
        font-size: 10px;
    }

    .consultant-toggle {
        width: 22px;
        height: 22px;
    }

    .consultant-toggle .toggle-icon-expand {
        font-size: 8px;
    }

    .consultant-widget__full {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: auto;
        border-radius: 14px 14px 0 0;
        max-height: 80vh;
        transform: translateY(100%);
        z-index: 10000;
    }

    .consultant-widget__full.active {
        transform: translateY(0);
        z-index: 10000;
    }

    .consultant-widget__header {
        padding: 10px 14px;
    }

    .consultant-widget__body {
        padding: 14px;
    }

    .consultant-widget__footer {
        padding: 10px 14px 14px;
    }

    .consultant-widget__btn {
        padding: 10px;
        font-size: 13px;
    }
}

/* Оверлей (внутри виджета, под мини и панелью) */
.consultant-widget__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1;
}

.consultant-widget__overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.consultant-widget__mini {
    position: relative;
    z-index: 10;
}

.consultant-widget__full {
    z-index: 10;
}

/* Анимации */
.consultant-widget {
    animation: widgetAppear 0.5s ease 1s both;
}

@keyframes widgetAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.consultant-widget__mini.attention {
    animation: widgetShake 0.4s ease;
}

@keyframes widgetShake {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-4deg); }
    40%, 80% { transform: rotate(4deg); }
}
