/* ==================================== */
/* style.css - Estilos Generales */
/* ==================================== */

:root {
    --color-marron: #8B4513; /* Chocolate/Cacao */
    --color-dulce-leche: #D2B48C; /* Beige/Claro */
    --color-fondo: #f8f8f8;
    --color-blanco: white;
    --color-gris-claro: #ccc;
    --color-crema-fondo: #fffaf0;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-fondo);
    color: #333;
    line-height: 1.6;
}

/* ==================================== */
/* Header y Navegación */
/* ==================================== */

header {
    background-color: var(--color-marron);
    color: var(--color-blanco);
    padding: 1em 0;
    text-align: center;
}

nav a {
    color: var(--color-blanco);
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

nav a:hover,
nav a.active {
    background-color: var(--color-dulce-leche);
    color: var(--color-marron);
}

/* ==================================== */
/* Estilos Comunes de Sección */
/* ==================================== */

section {
    padding: 30px 20px;
    margin: 20px auto;
    max-width: 1000px;
    background-color: var(--color-blanco);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

h2 {
    color: var(--color-dulce-leche);
    border-bottom: 3px solid var(--color-dulce-leche);
    padding-bottom: 10px;
    text-align: center;
    margin-bottom: 30px;
}

/* ==================================== */
/* Estilos Específicos para cada Página */
/* ==================================== */

/* --- INICIO (index.html) --- */
.intro-gallery {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.intro-gallery img {
    width: 30%;
    height: auto;
    max-width: 300px;
    object-fit: cover;
    border: 3px solid var(--color-gris-claro);
    border-radius: 8px;
}

/* --- PRODUCTOS (productos.html) --- */
.producto-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}
.producto-card {
    border: 1px solid var(--color-dulce-leche);
    padding: 0;
    border-radius: 8px;
    width: 300px;
    text-align: center;
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.producto-card img {
    width: 100%;
    height: 220px; 
    object-fit: cover;
    margin-bottom: 10px;
}
.card-content {
    padding: 15px;
}
.card-content button {
    background-color: var(--color-marron);
    color: var(--color-blanco);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}
.card-content button:hover {
    background-color: #A0522D;
}

/* --- COMENTARIOS (comentarios.html) --- */
.testimonios-grid {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.testimonio-card {
    background-color: #f3f3f3;
    padding: 15px;
    border-left: 4px solid var(--color-dulce-leche);
    border-radius: 4px;
    flex: 1 1 45%; 
}
.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--color-gris-claro);
    border-radius: 8px;
    background-color: var(--color-crema-fondo);
}
.form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-container input[type="text"],
.form-container input[type="email"],
.form-container textarea {
    width: 95%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.form-container button[type="submit"] {
    display: block;
    width: 100%;
    background-color: var(--color-marron);
    color: var(--color-blanco);
    border: none;
    padding: 12px;
    border-radius: 4px;
}

/* --- SOBRE NOSOTROS (nosotros.html) --- */
.nosotros-contenido {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.nosotros-texto {
    flex: 2;
    text-align: justify;
}
.nosotros-puntos {
    flex: 1;
    background-color: var(--color-crema-fondo);
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed var(--color-dulce-leche);
}
.nosotros-puntos ul {
    list-style: none;
    padding: 0;
}
.nosotros-puntos li {
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--color-marron);
}
.nosotros-puntos li::before {
    content: "✅";
    margin-right: 8px;
}

/* ==================================== */
/* Footer */
/* ==================================== */

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: 20px;
}

/* --- Estilo para el nuevo comentario --- */
#lista-comentarios {
    min-height: 100px; /* Para mantener espacio si no hay comentarios */
    margin-bottom: 30px;
}
.nuevo-comentario {
    background-color: #fcf8e3; /* Fondo amarillo claro para destacar el nuevo comentario */
    padding: 15px;
    border-left: 4px solid #F0AD4E; /* Borde naranja */
    border-radius: 4px;
    margin-bottom: 10px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Estilo para imagen pequeña y centrada */
.img-pequena-centrada {
    display: block; /* Permite aplicar margin: auto para centrar */
    margin: 20px auto; /* 20px de margen vertical, auto para centrar horizontalmente */
    max-width: 50%; /* O el porcentaje que desees, por ejemplo 300px */
    height: auto; /* Mantiene la proporción */
    border-radius: 8px; /* Opcional: bordes redondeados */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Opcional: sombra */
}

/* ==================================== */
/* Estilos para el Chatbot */
/* ==================================== */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px; /* Ancho fijo para desktop */
    max-height: 450px; /* Altura máxima */
    background-color: var(--color-blanco);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    overflow: hidden;
    z-index: 1000;
    font-size: 0.9em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: none; /* Oculto por defecto */
    flex-direction: column; /* Para organizar el contenido internamente */
}

/* Encabezado del chatbot */
#chatbot-header {
    background-color: var(--color-marron);
    color: var(--color-blanco);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor: default; /* No queremos que el header cierre el chat al hacer click */
}

#chatbot-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
}

#chatbot-close-btn {
    background: none;
    border: none;
    color: var(--color-blanco);
    font-size: 1.5em; /* Icono X más grande */
    cursor: pointer;
    padding: 0 5px;
    line-height: 1; /* Para centrar la X */
    transition: color 0.2s;
}
#chatbot-close-btn:hover {
    color: var(--color-dulce-leche);
}

/* Cuerpo del chat (mensajes) */
#chatbot-body {
    padding: 15px;
    flex-grow: 1; /* Para que ocupe el espacio disponible */
    overflow-y: auto; /* Scroll si el contenido es largo */
    background-color: #fcfcfc;
    border-bottom: 1px solid #eee;
    display: flex; /* Usar flexbox para los mensajes */
    flex-direction: column; /* Mensajes uno debajo del otro */
}

/* Mensaje individual en el chat */
.chat-message {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    max-width: 100%;
}

/* Avatar del bot */
.chat-message.bot .avatar {
    margin-right: 8px;
    width: 35px; /* Tamaño del avatar */
    height: 35px;
    border-radius: 50%;
    background-color: var(--color-dulce-leche);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; /* Para que el avatar no se encoja */
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
}
.chat-message.bot .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contenido del mensaje del bot */
.chat-message.bot .message-content {
    background-color: var(--color-dulce-leche);
    color: var(--color-marron);
    padding: 10px 14px;
    border-radius: 18px 18px 18px 5px; /* Burbuja de chat */
    max-width: calc(100% - 45px); /* Ancho máximo para el mensaje */
    text-align: left;
    word-wrap: break-word; /* Para que el texto largo se rompa */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Mensajes del usuario */
.chat-message.user {
    justify-content: flex-end; /* Alinear a la derecha */
}

.chat-message.user .message-content {
    background-color: #e0f2f7; /* Color suave para el usuario */
    color: #333;
    padding: 10px 14px;
    border-radius: 18px 18px 5px 18px; /* Burbuja de chat */
    max-width: calc(100% - 45px);
    text-align: right;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* Estilos para enlaces dentro de los mensajes del bot */
.chat-message.bot .message-content a {
    color: var(--color-marron);
    font-weight: bold;
    text-decoration: underline;
}

/* Área de entrada de texto */
#chatbot-input-area {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background-color: var(--color-blanco);
    gap: 10px; /* Espacio entre input y botón */
}

#chatbot-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--color-gris-claro);
    border-radius: 25px; /* Bordes más redondeados */
    font-size: 0.95em;
    outline: none; /* Eliminar el borde al enfocar */
    transition: border-color 0.2s;
}
#chatbot-input:focus {
    border-color: var(--color-dulce-leche);
}

#chatbot-send-btn {
    background-color: var(--color-marron);
    color: var(--color-blanco);
    border: none;
    border-radius: 25px; /* Bordes más redondeados */
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

#chatbot-send-btn:hover {
    background-color: #A0522D;
    transform: translateY(-1px);
}
#chatbot-send-btn:active {
    transform: translateY(0);
}

/* Botón flotante para abrir el chatbot */
#open-chatbot-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-dulce-leche);
    border: none;
    border-radius: 50%;
    width: 65px; /* Tamaño del botón */
    height: 65px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1001;
    transition: background-color 0.3s, transform 0.2s;
    display: flex; /* Para centrar la imagen */
    justify-content: center;
    align-items: center;
}

#open-chatbot-btn:hover {
    background-color: #F0E68C; /* Un color ligeramente diferente */
    transform: scale(1.05);
}

#open-chatbot-btn img {
    width: 85%; /* La imagen del alfajor dentro del botón */
    height: 85%;
    object-fit: contain;
    border-radius: 50%; /* Asegurar que la imagen también sea redonda */
}

/* Media Queries para Responsividad */
@media (max-width: 600px) {
    #chatbot-container {
        width: 90%; /* Más ancho en móviles */
        right: 5%;
        left: 5%;
        bottom: 10px;
        max-height: 80vh; /* Altura máxima en porcentaje de la ventana */
    }
    #open-chatbot-btn {
        width: 55px;
        height: 55px;
        bottom: 10px;
        right: 10px;
    }
    #chatbot-close-btn {
        font-size: 1.3em;
    }
    #chatbot-header h4 {
        font-size: 1em;
    }
    .chat-message.bot .avatar,
    .chat-message.bot .avatar img {
        width: 30px;
        height: 30px;
    }
    .chat-message.bot .message-content,
    .chat-message.user .message-content {
        padding: 8px 12px;
        font-size: 0.85em;
    }
}