/* ===== BASE ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Nunito Sans', sans-serif;
  background-color: #ecd92a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Evita scroll horizontal */
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.encabezado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #020202;
  color: white;
  padding: 0.5rem 2rem;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ===== NAVBAR ===== */
.navbar ul {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
}

.logo img {
  width: 100px;
  border-radius: 100%;
  margin-left: 2rem;
  margin-top: 2rem;
  animation: girar 15s linear infinite;
}

@keyframes girar {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== CONTENEDOR CHAT ===== */
.contenedor-chat {
  max-width: 600px;
  width: 94%;
  margin: 50px auto;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px #ccc;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.imagen-mapache {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}
.imagen-mapache img {
  width: 70px;
  border-radius: 100%;
}

h2 {
  text-align: center;
  color: #f7f7f7;
}

/* ===== CHAT MENSAJES ===== */
.chat-mensajes {
  height: 350px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 15px;
  margin-bottom: 10px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: inset 0 0 8px #ddd;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 15px;
  color: #333;
  scroll-behavior: smooth;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.usuario {
  align-self: flex-end;
  background-color: #4CAF50;
  color: white;
  padding: 12px 18px;
  border-radius: 20px 20px 0 20px;
  max-width: 70%;
  box-shadow: 0 2px 5px rgba(76, 175, 80, 0.3);
  margin: 0;
}

.Mapachito {
  align-self: flex-start;
  color: #333;
  border-radius: 5px;
  max-width: 80%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0;
}

.usuario span, .Mapachito span {
  font-weight: bold;
  font-size: 0.9em;
  margin-right: 6px;
}

/* ===== FORMULARIO ===== */
form {
  display: flex;
  gap: 10px;
}

input {
  flex-grow: 1;
  padding: 10px;
}

button {
  padding: 10px;
  background-color: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
}

/* Botones categorías */
.contenedor-categorias {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.categoria-boton {
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 150px;
  text-align: center;
}

.categoria-boton:hover {
  background-color: #dff800;
  color: black;
}

/* Botón borrar historial */
#borrarHistorial {
  padding: 10px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#borrarHistorial:hover {
  background-color: #c82333;
}

/* ===== FOOTER ===== */
.footer {
  background-color: #000000;
  color: #ffffff;
  padding: 30px 20px;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.footer-contenedor {
  max-width: 800px;
  margin: 0 auto;
}
.footer-logo {
  font-size: 28px;
  margin-bottom: 10px;
}
.footer-texto {
  font-size: 16px;
  margin-bottom: 20px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}
.footer-links li a {
  color: #ffffff;
  text-decoration: none;
}
.footer-links li a:hover {
  text-decoration: underline;
}
.footer-copy {
  font-size: 14px;
  color: #a5d6a7;
}
.footer-redes {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.footer-redes img {
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;
}
.footer-redes img:hover {
  transform: scale(1.2);
}

/* ===== SEMILLAS ===== */
.contenedor-semillas {
  max-width: 1200px;
  margin: 40px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
}

.card-semilla {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 8px rgb(0 0 0 / 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.img-semilla {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 12px;
  object-fit: cover;
}

.btn-agregar {
  margin-top: auto;
  padding: 10px 16px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.btn-agregar:hover {
  background-color: #45a049;
}

/* ===== SWEETALERT ===== */
.swal2-popup.swal2-rounded {
  border-radius: 1.2rem;
  font-family: 'Nunito Sans', sans-serif;
}

.swal2-confirm-custom {
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: bold;
  background-color: #e6b800 !important;
  color: #fff !important;
}

.swal2-cancel-custom {
  border-radius: 8px;
  padding: 8px 16px;
  background-color: #aaa !important;
  color: #fff !important;
}

.mensaje-escribiendo {
  font-style: italic;
  opacity: 0.7;
  animation: aparecerDesaparecer 1.5s infinite;
}

@keyframes aparecerDesaparecer {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* ===== MENÚ HAMBURGUESA Y RESPONSIVE ===== */
@media (max-width: 1024px) {
  .contenedor-semillas {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #020202;
    position: absolute;
    top: 70px;
    right: 0;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    border-top: 2px solid #4CAF50;
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
    z-index: 999;
  }
  .navbar.mostrar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .menu-btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
  }
  .navbar ul {
    flex-direction: column;
    gap: 15px;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  .navbar a {
    padding: 10px 0;
    font-size: 18px;
    display: block;
    width: 100%;
  }
  .contenedor-chat {
    width: 100%;
    max-width: 100%;
    margin: 10px auto;
    border-radius: 0;
  }
  .contenedor-semillas {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    padding: 10px;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .contenedor-semillas {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 10px;
  }
}




/* Escritorio */
.contenedor-semillas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: auto;
}

/* Tablets grandes */
@media (max-width: 1024px) {
  .contenedor-semillas {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
  .contenedor-semillas {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
  }
}

/* Celulares */
@media (max-width: 480px) {
  .contenedor-semillas {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }
}
