/* ====== Launcher button ====== */
.camion-chat-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(10, 24, 120, .78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, .20),
        inset 0 1px 0 rgba(255, 255, 255, .20);
    cursor: pointer;
    z-index: 999999;
    display: grid;
    place-items: center;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.camion-chat-launcher:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, .25),
        inset 0 1px 0 rgba(255, 255, 255, .25);
}

.camion-chat-launcher.is-hidden {
    display: none;
}

.camion-chat-launcher-icon {
    font-size: 22px;
    line-height: 1;
    color: #f9be00;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
}

/* Mobile: поднять кнопку выше */
@media (max-width: 768px) {
    .camion-chat-launcher {
        bottom: 76px;
        right: 14px;
    }
}

/* ====== Widget ====== */
.camion-chat-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 360px;
    height: 520px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .25);
    z-index: 999999;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.camion-chat-widget.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .camion-chat-widget {
        right: 10px;
        left: 10px;
        bottom: 10px;
        width: auto;
        height: 70vh;
        border-radius: 20px;
    }
}

.camion-chat-header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: rgba(10, 24, 120, .92);
    color: #fff;
}

.camion-chat-title {
    font-weight: 700;
    letter-spacing: .2px;
}

.camion-chat-close {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .10);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease;
}

.camion-chat-close:hover {
    background: rgba(255, 255, 255, .18);
}

.camion-chat-body {
    height: calc(100% - 52px - 62px);
    padding: 14px;
    overflow: auto;
}

.camion-chat-footer {
    height: 62px;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    background: rgba(255, 255, 255, .75);
}

.camion-chat-input {
    flex: 1;
    border-radius: 14px;
    border: 1px solid rgba(10, 24, 120, .20);
    padding: 12px 12px;
    outline: none;
    background: rgba(255, 255, 255, .95);
}

.camion-chat-send {
    width: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .30);
    background: rgba(10, 24, 120, .92);
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .18);
}

/* ====== Bubbles ====== */
.camion-bubble {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 16px;
    margin: 0 0 10px 0;
    line-height: 1.25;
    font-size: 14px;
    white-space: pre-wrap;
}

.camion-bubble.is-bot {
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, .10),
        inset 0 1px 0 rgba(255, 255, 255, .55);
    color: #111;
}

.camion-bubble.is-user {
    margin-left: auto;
    background: rgba(10, 24, 120, .92);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .16);
}

/* ====== Quick buttons ====== */
.camion-quick-buttons {
    display: grid;
    gap: 10px;
    margin: 6px 0 14px;
}

.camion-quick-btn {
    text-align: left;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, .06);
    background: rgba(255, 255, 255, .88);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, .10),
        inset 0 1px 0 rgba(255, 255, 255, .65);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    color: #0b0b0b;
}

.camion-quick-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, .12),
        inset 0 1px 0 rgba(255, 255, 255, .70);
}

/* ====== Products ====== */
.camion-products {
    display: grid;
    gap: 10px;
    margin: 8px 0 12px;
}

.camion-product {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, .06);
    background: rgba(255, 255, 255, .90);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, .10),
        inset 0 1px 0 rgba(255, 255, 255, .65);
}

.camion-product-img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, .03);
    display: grid;
    place-items: center;
}

.camion-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camion-product-title {
    font-weight: 700;
    font-size: 14px;
    color: #0E0871;
}

.camion-product-price {
    margin-top: 4px;
    font-weight: 800;
    font-size: 14px;
    color: #111;
}


/* =====================================================
   CHAT LAUNCHER = стиль как у camion-main-btn
   ===================================================== */

/* Основная кнопка чата */
button.camion-chat-launcher {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;

    /* СИНИЙ Apple-style */
    background: linear-gradient(145deg,
            rgba(30, 45, 160, 0.95),
            rgba(14, 8, 113, 0.95));

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    display: flex;
    align-items: center;
    justify-content: center;

    position: fixed;
    /* если кнопка плавающая */
    right: 20px;
    bottom: 96px;
    /* ЧУТЬ ВЫШЕ, чем телефон */
    z-index: 9999;

    transition: transform .2s ease, box-shadow .2s ease;
}

/* Hover */
button.camion-chat-launcher:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Active */
button.camion-chat-launcher:active {
    transform: scale(0.96);
}

/* =====================================================
   ИКОНКА ЧАТА — больше и выразительнее
   ===================================================== */

button.camion-chat-launcher img,
button.camion-chat-launcher svg {
    width: 30px;
    height: 30px;

    /* лёгкий glow как в iOS */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}

/* =====================================================
   МОБИЛЬНАЯ ВЕРСИЯ — поднимаем кнопку выше
   ===================================================== */
@media (max-width: 768px) {
    button.camion-chat-launcher {
        bottom: 120px;
        /* чтобы не конфликтовала с UI */
        right: 16px;
    }
}






/* =================================================
   КНОПКА ЧАТА — ВЫШЕ, КАК ТЕЛЕФОН
   ================================================= */

button.camion-chat-launcher {
    position: fixed;
    right: 20px;
    bottom: 96px;
    /* ⬅️ ВЫШЕ, рядом с телефонной */
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;

    /* стеклянно-голубой фон */
    background: linear-gradient(145deg,
            rgba(180, 215, 255, 0.75),
            rgba(110, 160, 235, 0.85));

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow:
        0 14px 30px rgba(60, 120, 255, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);

    z-index: 9998;
}

/* =================================================
   ПУЛЬСАЦИЯ — ТОЧНО КАК У КНОПКИ ВЫШЕ
   ================================================= */

button.camion-chat-launcher::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    z-index: -1;

    background: rgba(120, 170, 255, 0.55);
    animation: camionPulsePhoneStyle 2.2s infinite;
}

@keyframes camionPulsePhoneStyle {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* =================================================
   ИКОНКА — БОЛЬШЕ + ЯРЧЕ
   ================================================= */

.camion-chat-launcher-icon img {
    width: 34px;
    /* ⬅️ БОЛЬШЕ */
    height: 34px;
    filter:
        drop-shadow(0 2px 6px rgba(40, 90, 220, 0.9)) brightness(1.3) saturate(1.4);
}

/* =================================================
   МОБИЛЬНАЯ ВЕРСИЯ — ПОДНЯТЬ ЧУТЬ ВЫШЕ
   ================================================= */

@media (max-width: 768px) {
    button.camion-chat-launcher {
        bottom: 112px;
        right: 16px;
    }
}







/* ================================
   КНОПКА ЧАТА — НИЖЕ ТЕЛЕФОНА
   ================================ */

button.camion-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 72px; /* ⬅️ ниже кнопки телефона */
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(60, 120, 255, 0.85); /* 🔵 синий бордер */
  cursor: pointer;

  background: linear-gradient(
    145deg,
    rgba(185, 220, 255, 0.75),
    rgba(120, 170, 245, 0.9)
  );

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 14px 30px rgba(60, 120, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);

  z-index: 9998;
}

/* ================================
   ПУЛЬСАЦИЯ — КАК У ТЕЛЕФОНА
   ================================ */

button.camion-chat-launcher::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  z-index: -1;

  border: 2px solid rgba(90, 150, 255, 0.55);
  animation: camionPulseBlue 2.2s infinite;
}

@keyframes camionPulseBlue {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ================================
   ИКОНКА — БОЛЬШАЯ И ЯРКАЯ
   ================================ */

.camion-chat-launcher-icon img {
  width: 36px;
  height: 36px;
  filter:
    drop-shadow(0 2px 8px rgba(40, 100, 255, 0.9))
    brightness(1.35)
    saturate(1.4);
}

/* ================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ================================ */

@media (max-width: 768px) {
  button.camion-chat-launcher {
    bottom: 65px;
    right: 16px;
  }
}








/* ===========================
   MOBILE: окно чата ниже в 2 раза
   =========================== */
@media (max-width: 768px) {

    /* само окно виджета */
    .camion-chat-widget.is-open {
        height: 48vh !important;
        /* ~в 2 раза ниже */
        max-height: 520px !important;
        min-height: 320px !important;
    }

    /* тело чата скроллится внутри */
    #camion-chat-body.camion-chat-body {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* чуть компактнее отступы внутри сообщений */
    #camion-chat-body.camion-chat-body {
        padding: 12px 12px 10px !important;
    }

    /* нижняя панель */
    .camion-chat-footer {
        padding: 10px 12px !important;
    }

    .camion-chat-footer input,
    .camion-chat-footer textarea {
        height: 40px !important;
        min-height: 40px !important;
        border-radius: 14px !important;
        font-size: 14px !important;
    }

    /* кнопка отправки НЕ уменьшаем сильно, но делаем ровной */
    .camion-chat-footer button {
        width: 44px !important;
        height: 44px !important;
        border-radius: 14px !important;
    }
}


/* ==========================================
   Плашки выбора: короткие, одна строка, 2 в ряд
   ВАЖНО: применяем только к кнопкам внутри BODY,
   футер (send) не трогаем.
   ========================================== */

/* контейнеры кнопок (на всякий случай несколько вариантов) */
#camion-chat-body.camion-chat-body .camion-chat-buttons,
#camion-chat-body.camion-chat-body .camion-buttons,
#camion-chat-body.camion-chat-body .camion-quick-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

/* сами кнопки выбора внутри body */
#camion-chat-body.camion-chat-body button {
    /* не трогаем кнопки, если это вдруг кнопка закрытия и т.п. — но в body обычно их нет */
    min-height: 44px !important;
    padding: 10px 14px !important;
    border-radius: 16px !important;

    /* одна строка */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    font-size: 14px !important;
    line-height: 1 !important;

    /* визуально “плашка” */
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 10px 26px rgba(18, 38, 86, 0.12) !important;
    border: 1px solid rgba(40, 70, 160, 0.10) !important;
}

/* НО: не применяем этот стиль к кнопке отправки (она в footer) */
.camion-chat-footer button {
    /* оставляем как есть (у тебя уже красивая) */
    background: none;
    box-shadow: none;
    border: none;
}

/* мобильная сетка кнопок: 2 в ряд */
@media (max-width: 768px) {

    /* целимся только в “кнопки выбора”, если они в контейнерах */
    #camion-chat-body.camion-chat-body .camion-chat-buttons button,
    #camion-chat-body.camion-chat-body .camion-buttons button,
    #camion-chat-body.camion-chat-body .camion-quick-buttons button {
        width: calc(50% - 5px) !important;
    }

    /* 3-я кнопка (обычно “Менеджер”) — на всю ширину */
    #camion-chat-body.camion-chat-body .camion-chat-buttons button:nth-child(3),
    #camion-chat-body.camion-chat-body .camion-buttons button:nth-child(3),
    #camion-chat-body.camion-chat-body .camion-quick-buttons button:nth-child(3) {
        width: 100% !important;
    }
}








/* ============================
   MOBILE ONLY - красоты кнопок
   ============================ */
@media (max-width: 520px) {

    /* Общий контейнер быстрых кнопок -> делаем сетку */
    .camion-quick-buttons {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px !important;
        align-items: stretch;
        margin-top: 10px;
    }

    /* Все быстрые кнопки - одинаковая высота/вид */
    .camion-quick-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        padding: 10px 12px !important;
        border-radius: 14px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ===== 1) Экран 1: Легковые / Грузовые / Менеджер в одну строку =====
     Первые 3 кнопки в первом наборе делаем в 3 колонки */
    .camion-quick-buttons:has(> .camion-quick-btn:nth-child(3)):not(:has(> .camion-quick-btn:nth-child(4))) {
        grid-template-columns: 1fr 1fr 1fr !important;
    }

    /* Чтобы "Менеджер" не был шире - отключаем растягивание на 2 колонки */
    .camion-quick-buttons .camion-quick-btn {
        grid-column: auto !important;
    }

    /* ===== 2) Экран менеджера: 4 кнопки -> 2 в ряд (тел/WA, Viber/Email) ===== */
    /* Ничего отдельного не нужно — текущая grid 2 колонки уже делает это */

    /* Настоящие иконки для WhatsApp / Viber / Email (заменяем эмодзи только визуально) */
    .camion-quick-btn img.emoji[alt="💬"] {
        content: url("https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/whatsapp.svg");
        width: 18px !important;
        height: 18px !important;
        filter: invert(31%) sepia(85%) saturate(455%) hue-rotate(89deg) brightness(92%) contrast(92%);
    }

    .camion-quick-btn img.emoji[alt="📲"] {
        content: url("https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/viber.svg");
        width: 18px !important;
        height: 18px !important;
        filter: invert(33%) sepia(46%) saturate(2067%) hue-rotate(242deg) brightness(93%) contrast(90%);
    }

    .camion-quick-btn img.emoji[alt="✉️"] {
        content: url("https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/gmail.svg");
        width: 18px !important;
        height: 18px !important;
        filter: invert(26%) sepia(93%) saturate(2461%) hue-rotate(347deg) brightness(92%) contrast(92%);
    }

    /* ===== 3) Блок результатов: чтобы нижние кнопки были ровными =====
     Везде где 4 кнопки (как в твоём 3 скрине) - 2 колонки: будет идеально */
    .camion-quick-buttons:has(> .camion-quick-btn:nth-child(4)) {
        grid-template-columns: 1fr 1fr !important;
    }

    /* “Открыть результаты…” иногда длинное — пусть занимает всю строку, если нужно */
    .camion-quick-btn:has(img.emoji[alt="🔎"]) {
        grid-column: 1 / -1;
        /* во всю ширину */
    }

    /* Чуть крупнее и ярче иконки в кнопках (на мобиле) */
    .camion-quick-btn img.emoji {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
}







/* ===== MOBILE ONLY ===== */
@media (max-width: 768px) {

    /* === ОБЩЕЕ: контейнер быстрых кнопок === */
    .camion-quick-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* === ОБЩЕЕ: кнопки === */
    .camion-quick-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        height: 44px;
        border-radius: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    /* =====================================================
     1️⃣ VIBER + EMAIL — В ОДИН РЯД
     ===================================================== */

    .camion-quick-btn:has(img[alt="📲"]),
    .camion-quick-btn:has(img[alt="✉️"]) {
        flex: 1 1 calc(50% - 5px);
    }

    /* Цвета брендов */
    .camion-quick-btn:has(img[alt="📲"]) {
        background: #ede7f6;
        color: #6a1b9a;
    }

    .camion-quick-btn:has(img[alt="✉️"]) {
        background: #fdecea;
        color: #c62828;
    }

    /* =====================================================
     2️⃣ ОСИ + КНОПКА РЕЗУЛЬТАТОВ
     ===================================================== */

    /* Рулевая ось + Открыть результаты */
    .camion-quick-btn:has(img[alt="🔎"]),
    .camion-quick-btn:not(:has(img)) {
        flex: 1 1 calc(50% - 5px);
    }

    /* Иконки крупнее */
    .camion-quick-btn img.emoji {
        width: 20px;
        height: 20px;
    }

}





/* ===== MOBILE: кнопка "Открыть результаты на сайте" ===== */
@media (max-width: 768px) {

    /* сама кнопка */
    .camion-quick-btn:has(img[alt="🔎"]) {
        flex: 1 1 calc(50% - 5px);
        padding: 8px 10px;
        font-size: 12px;
        /* 👈 уменьшаем текст */
        line-height: 1.2;
        white-space: nowrap;
        /* 👈 строго в одну строку */
        overflow: hidden;
        text-overflow: ellipsis;
        height: 44px;

        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;

        background: rgba(30, 64, 175, 0.08);
        color: #1e40af;
        border: 1px solid rgba(30, 64, 175, 0.25);
        border-radius: 14px;
    }

    /* иконка лупы */
    .camion-quick-btn img.emoji[alt="🔎"] {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

}





/* ===== MOBILE: исправление кнопки "Открыть результаты на сайте" ===== */
@media (max-width: 768px) {

    /* общий контейнер быстрых кнопок — чтобы 2 в ряд работали стабильно */
    .camion-quick-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* кнопка с лупой */
    .camion-quick-btn:has(img[alt="🔎"]) {
        flex: 1 1 calc(50% - 4px);
        /* 👈 ровно 2 кнопки в ряд */
        min-width: 0;
        /* 👈 КРИТИЧНО для текста */
        height: 44px;

        padding: 6px 8px;
        font-size: 11px;
        /* 👈 ещё чуть меньше */
        line-height: 1.1;

        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;

        white-space: nowrap;
        /* строго одна строка */
        overflow: hidden;
        text-overflow: ellipsis;

        background: rgba(30, 64, 175, 0.08);
        color: #1e40af;
        border: 1px solid rgba(30, 64, 175, 0.28);
        border-radius: 14px;
    }

    /* иконка лупы */
    .camion-quick-btn img.emoji[alt="🔎"] {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
        /* 👈 не сжимается */
    }

}