/* =====================================================
   STREET PATCH · ESTILOS DEL CHEF IA
   Se usa junto con css/restaurantes.css (que trae la barra de
   navegación, el encabezado y el footer) y las mismas variables
   de color: --negro, --carbon, --turquesa, --naranja, --dorado...
   Índice:
   1. Contenedor general
   2. Columna del perfil (logo + condiciones)
   3. Chat (mensajes, sugerencias y caja de texto)
   4. Celular y tablet
===================================================== */


/* ========== 1. CONTENEDOR GENERAL ========== */

.chef {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 5% 70px;
}

/* Dos columnas: perfil a la izquierda y chat a la derecha */
.chef__cuerpo {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);

    overflow: hidden;
    background: var(--carbon);
    border: 1px solid rgba(33, 212, 194, 0.35);
    border-top: 5px solid var(--naranja);
    border-radius: 22px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}


/* ========== 2. COLUMNA DEL PERFIL ========== */

.chef__perfil {
    padding: 28px 22px;
    background: linear-gradient(180deg, #151a19, #111414);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Logo redondo con aro turquesa y naranja */
.chef__logo {
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    padding: 4px;

    background: linear-gradient(135deg, var(--turquesa), var(--naranja));
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(33, 212, 194, 0.25);
}

.chef__logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 3px solid var(--negro);
    border-radius: 50%;
}

.chef__perfil h2 {
    margin-bottom: 4px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    text-align: center;
    text-transform: uppercase;
}

.chef__ayuda {
    margin-bottom: 16px;
    color: var(--gris);
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: center;
}

.chef__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Botones de condiciones (chips) */
.chip {
    padding: 8px 13px;

    background: transparent;
    border: 1.5px solid rgba(33, 212, 194, 0.4);
    border-radius: 30px;

    color: var(--blanco);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;

    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover {
    border-color: var(--turquesa);
}

/* Chip marcado: turquesa lleno */
.chip.activo {
    background: var(--turquesa);
    border-color: var(--turquesa);
    color: var(--negro);
    font-weight: 600;
}

/* Campo para escribir otra condición */
.chef__otra {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.chef__otra input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;

    background: var(--negro);
    border: 1px solid rgba(33, 212, 194, 0.35);
    border-radius: 30px;
    outline: none;

    color: var(--blanco);
    font-family: inherit;
    font-size: 0.82rem;
}

.chef__otra input:focus {
    border-color: var(--turquesa);
}

.chef__otra button {
    width: 40px;
    height: 40px;
    flex-shrink: 0;

    background: var(--naranja);
    border: none;
    border-radius: 50%;

    color: var(--negro);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
}

.chef__otra button:hover {
    background: var(--dorado);
}

.chef__aviso {
    margin-top: 20px;
    padding: 12px;

    background: rgba(255, 179, 71, 0.08);
    border: 1px dashed rgba(255, 179, 71, 0.5);
    border-radius: 12px;

    color: var(--dorado);
    font-size: 0.75rem;
    line-height: 1.6;
}


/* ========== 3. CHAT ========== */

.chef__chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 560px;
}

/* Barra superior del chat */
.chat__titulo {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 22px;

    background: rgba(33, 212, 194, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    color: var(--turquesa);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Puntico verde "en línea" */
.chat__punto {
    width: 9px;
    height: 9px;
    background: #3ddc97;
    border-radius: 50%;
    box-shadow: 0 0 8px #3ddc97;
}

/* Zona donde aparecen los mensajes (se desplaza por dentro) */
.chat__mensajes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;

    max-height: 440px;
    padding: 22px;
    overflow-y: auto;
}

/* Burbujas */
.msg {
    max-width: 85%;
    padding: 12px 16px;

    font-size: 0.92rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* Mensajes del cliente: turquesa, a la derecha */
.msg--yo {
    align-self: flex-end;
    background: var(--turquesa);
    border-radius: 18px 18px 4px 18px;
    color: var(--negro);
    font-weight: 500;
}

/* Mensajes del Chef: oscuros con borde, a la izquierda */
.msg--chef {
    align-self: flex-start;
    background: var(--negro);
    border: 1px solid rgba(33, 212, 194, 0.35);
    border-radius: 18px 18px 18px 4px;
}

.msg--chef strong {
    color: var(--dorado);
}

/* Notita discreta cuando la respuesta fue la rápida (sin IA) */
.msg-nota {
    margin-top: 8px;
    color: var(--gris);
    font-size: 0.72rem;
    font-style: italic;
}

/* Errores en rojo */
.msg--error {
    align-self: flex-start;
    background: rgba(255, 90, 79, 0.12);
    border: 1px solid rgba(255, 90, 79, 0.55);
    border-radius: 14px;
    color: #ff9a92;
}

/* "Pensando..." con tres puntitos animados */
.msg--pensando::after {
    content: "...";
    display: inline-block;
    animation: puntos 1.2s steps(4, end) infinite;
    width: 1.2em;
    overflow: hidden;
    vertical-align: bottom;
}

@keyframes puntos {
    0%   { width: 0; }
    100% { width: 1.2em; }
}

/* Sugerencias rápidas */
.chat__sugerencias {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 22px 14px;
}

.sugerencia {
    padding: 8px 14px;

    background: rgba(255, 122, 47, 0.1);
    border: 1px solid rgba(255, 122, 47, 0.5);
    border-radius: 30px;

    color: var(--blanco);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;

    transition: background 0.2s, color 0.2s;
}

.sugerencia:hover {
    background: var(--naranja);
    color: var(--negro);
}

/* Caja para escribir */
.chat__form {
    display: flex;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #151a19;
}

.chat__form input {
    flex: 1;
    min-width: 0;
    padding: 13px 18px;

    background: var(--negro);
    border: 1px solid rgba(33, 212, 194, 0.4);
    border-radius: 30px;
    outline: none;

    color: var(--blanco);
    font-family: inherit;
    font-size: 0.92rem;
}

.chat__form input:focus {
    border-color: var(--turquesa);
    box-shadow: 0 0 0 3px rgba(33, 212, 194, 0.18);
}

.chat__form button {
    padding: 0 26px;

    background: var(--naranja);
    border: none;
    border-radius: 30px;

    color: var(--negro);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;

    transition: background 0.2s, transform 0.2s;
}

.chat__form button:hover:not(:disabled) {
    background: var(--dorado);
    transform: translateY(-2px);
}

.chat__form button:disabled {
    opacity: 0.5;
    cursor: wait;
}


/* ========== 4. CELULAR Y TABLET ========== */

@media (max-width: 860px) {

    /* Una sola columna: perfil arriba y chat abajo */
    .chef__cuerpo {
        grid-template-columns: 1fr;
    }

    .chef__perfil {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* El logo y el título van uno al lado del otro para ahorrar espacio */
    .chef__chips {
        justify-content: center;
    }

    .chef__chat {
        min-height: 0;
    }

    .chat__mensajes {
        max-height: 380px;
    }
}

@media (max-width: 520px) {

    .chef {
        padding: 30px 4% 50px;
    }

    .chef__perfil {
        padding: 22px 16px;
    }

    .chef__logo {
        width: 76px;
        height: 76px;
    }

    .chat__mensajes {
        padding: 16px;
    }

    .msg {
        max-width: 92%;
        font-size: 0.88rem;
    }

    .chat__sugerencias,
    .chat__form {
        padding-left: 14px;
        padding-right: 14px;
    }

    .chat__form button {
        padding: 0 18px;
    }
}


/* =====================================================
   CHEF IA CONECTADO AL CARRITO
   Botones "Agregar" debajo de las recomendaciones y barra "Ver mi pedido".
===================================================== */
.chef-platos {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.chef-platos__titulo {
    margin-bottom: 8px;
    color: var(--turquesa);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chef-plato {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chef-plato__info {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.chef-plato__info small {
    display: block;
    color: var(--gris);
    font-size: 0.72rem;
    font-weight: 400;
}

.chef-plato__btn {
    flex-shrink: 0;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--turquesa);
    border-radius: 20px;
    color: var(--turquesa);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.chef-plato__btn:hover {
    background: var(--turquesa);
    color: var(--negro);
}

/* Barra "Ver mi pedido" sobre la caja de escribir */
.chef__barra-carrito {
    display: block;
    margin: 0 22px 12px;
    padding: 11px 16px;
    background: var(--turquesa);
    border-radius: 12px;
    color: var(--negro);
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.chef__barra-carrito[hidden] {
    display: none;
}

.chef__barra-carrito:hover {
    background: var(--naranja);
}
