/* /css/chat.css (Versión con ajustes responsive) */
/* ======================== */
/* == ESTILOS PARA CHAT == */
/* ======================== */
.chat-container {
    max-width: 800px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
.chat-messages {
    padding: 1.5rem;
    height: 50vh;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}
.chat-empty {
    text-align: center;
    color: #888;
    margin: auto;
}
.mensaje-burbuja {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.mensaje-burbuja p {
    margin: 0;
}
.mensaje-fecha {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 5px;
    text-align: right;
}
.mensaje-enviado {
    background-color: #dcf8c6;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.mensaje-recibido {
    background-color: #ffffff;
    border: 1px solid #eee;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.mensaje-recibido .mensaje-fecha {
    color: #999;
}
.chat-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background-color: #f0f0f0;
}
.chat-form textarea {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 18px;
    resize: none;
    height: 50px;
    margin-right: 1rem;
}
.chat-form button {
    white-space: nowrap;
}

/* ========================================================= */
/* == RESUMEN DE PRODUCTOS EN EL CHAT == */
/* ========================================================= */
.product-package-summary {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}
.product-package-summary h4 {
    margin: 0;
    padding: 1rem;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}
.summary-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}
.product-package-items .summary-product-item:last-child {
    border-bottom: none;
}
.summary-product-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.summary-product-info {
    display: flex;
    flex-direction: column;
}
.summary-product-info .product-name {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}
.summary-product-info .product-price-qty {
    font-size: 1.2em;
    color: #000000;
    margin-top: 3px;
}

/* ================================================== */
/* == LAYOUT DE PÁGINA DE CHAT (2 COLUMNAS) == */
/* ================================================== */
.chat-layout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr; 
    gap: 2rem;
    align-items: flex-start;
}

/*
================================================
  Estilos Responsive para la Página de Mensajes
================================================
*/
@media (max-width: 992px) {
  /* 1. Cambiamos el layout de 2 columnas a 1 */
  .chat-layout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* 2. Movemos el resumen de productos arriba del chat */
  .chat-sidebar-column {
    order: -1;
  }

  /* 3. Ajustamos los márgenes y el título */
  .chat-main-column h2 {
    font-size: 1.5em;
  }
  .container {
    padding: 10px;
  }

  /* --- INICIO DE CAMBIOS --- */

  /* 4. Estilos de las burbujas de chat (más angostas) */
  .mensaje-burbuja {
    max-width: 75%; /* <-- AJUSTE AQUÍ: De 85% a 75% */
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    word-wrap: break-word;
  }
  
  /* 5. Estilos para el resumen de producto (imagen arriba, texto abajo) */
  .summary-product-item {
      flex-direction: column; /* Apila los elementos verticalmente */
      text-align: center;      /* Centra el texto */
  }
  .summary-product-img {
      width: 80px;  /* <-- AJUSTE AQUÍ: Hacemos la imagen más grande */
      height: 80px;
  }
  .summary-product-info .product-name {
      white-space: normal; /* Permite que el nombre ocupe varias líneas */
      max-width: 100%;
  }
  
  /* --- FIN DE CAMBIOS --- */
  
  /* Tus mensajes (enviados) - a la derecha y en azul */
  .mensaje-enviado {
    margin-left: auto;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
  }
  .mensaje-enviado .mensaje-fecha {
    color: rgba(255, 255, 255, 0.7);
  }

  /* Mensajes del vendedor (recibidos) - a la izquierda y en gris */
  .mensaje-recibido {
    margin-right: auto;
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
  }

  /* Ajustes al formulario de envío */
  .chat-form {
    display: flex;
    gap: 10px;
  }
  .chat-form textarea {
    flex-grow: 1;
  }
}