/* ============================================
   EiChat — Widget de Chat (cliente final)
   Paleta laranja/branco, estilo delivery empresarial
   Mesmos tokens de cor usados no painel admin,
   pra manter a marca consistente ponta a ponta.
   ============================================ */
:root {
    --brand-50:  #FFF4ED;
    --brand-100: #FFE6D5;
    --brand-400: #FF8A4C;
    --brand-500: #F2600C;
    --brand-600: #D9500A;
    --brand-700: #B33F08;
    --brand-gradient: linear-gradient(135deg, #FF7A29 0%, #E8500A 100%);

    --ink-900: #1F2328;
    --ink-700: #3D4450;
    --ink-500: #6B7280;
    --ink-300: #D8DCE1;
    --ink-100: #F3F4F6;
    --paper:   #FFFFFF;

    --money: #0E9F6E; /* verde reservado só pra preços/valores */

    --shadow-sm: 0 2px 8px rgba(31,35,40,.08);
    --shadow-md: 0 8px 24px rgba(31,35,40,.12);
    --shadow-brand: 0 8px 20px rgba(217,80,10,.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-container {
    background: var(--paper);
    border-radius: 20px;
    max-width: 450px;
    width: 100%;
    height: 90%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md), 0 20px 60px rgba(31,35,40,.18);
    overflow: hidden;
}

/* ==========================================================================
   Header
   ========================================================================== */
.chat-header {
    background: var(--brand-gradient);
    color: white;
    padding: 20px;
    text-align: center;
}

.chat-header h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 5px;
}

.chat-header p {
    font-size: 13px;
    opacity: 0.92;
}

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(255,255,255,0.22);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

/* ==========================================================================
   Mensagens
   ========================================================================== */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #FAF9F7;
}

.message {
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    text-align: left;
}

.message.user {
    text-align: right;
}

.message-content {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.message.bot .message-content {
    background: white;
    color: var(--ink-900);
    box-shadow: 0 2px 6px rgba(31,35,40,.08);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: var(--brand-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

/* ==========================================================================
   Opções em grid
   ========================================================================== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.option-btn {
    padding: 12px;
    background: white;
    border: 2px solid var(--brand-500);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-weight: 600;
    color: var(--brand-600);
}

.option-btn:hover {
    background: var(--brand-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

/* ==========================================================================
   Cards de produto
   ========================================================================== */
.product-card {
    flex-direction: column;
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--ink-100);
    transition: all 0.25s ease;
    cursor: pointer;
}

.product-card-linha {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--ink-100);
    transition: all 0.25s ease;
    cursor: pointer;
    margin-bottom: 7px;
}

.product-card:hover,
.product-card-linha:hover {
    border-color: var(--brand-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: var(--ink-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    flex: 1;
    padding: 10px 15px 10px 0;
}

.product-details h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--ink-900);
}

.product-details p {
    font-size: 13px;
    color: var(--ink-500);
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--money);
}

/* ==========================================================================
   Carrinho
   ========================================================================== */
.cart-item {
    background: var(--brand-50);
    padding: 10px;
    border-radius: 8px;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    background: var(--brand-gradient);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-top: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: var(--shadow-brand);
}

/* ==========================================================================
   Campo de entrada
   ========================================================================== */
.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--ink-100);
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--ink-100);
    border-radius: 25px;
    font-size: 14px;
    font-family: inherit;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--brand-500);
}

.chat-input button {
    padding: 12px 25px;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.chat-input button:hover {
    transform: scale(1.05);
    filter: brightness(1.05);
}

.loading {
    text-align: center;
    padding: 10px;
    color: var(--ink-500);
}

.hidden {
    display: none;
}

/* ==========================================================================
   Controle de quantidade
   ========================================================================== */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-control button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--brand-500);
    background: white;
    color: var(--brand-600);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.quantity-control button:hover {
    background: var(--brand-gradient);
    border-color: transparent;
    color: white;
}

.quantity-control span {
    font-weight: 700;
    font-size: 18px;
    min-width: 30px;
    text-align: center;
    color: var(--ink-900);
}

/* ==========================================================================
   Card de pedido (resumo/confirmação)
   ========================================================================== */
.pedido-card {
    background: var(--brand-gradient);
    border-radius: 16px;
    padding: 20px;
    margin: 10px 0;
    color: white;
    box-shadow: var(--shadow-brand);
    position: relative;
    overflow: hidden;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pedido-numero {
    font-size: 18px;
    font-weight: 800;
}

.pedido-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pedido-info-linha {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pedido-info-linha strong {
    min-width: 80px;
}

.pedido-valor {
    font-size: 24px;
    font-weight: 800;
    margin-top: 10px;
    text-align: right;
}

.pedido-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.25);
    font-size: 12px;
}